@@ -49,16 +49,24 @@ sub sandbox_path {
4949# output and report results.
5050#
5151sub runtest {
52− my ($test, $update) = @_;
52+ my ($test, $update, $showTime) = @_;
5353
5454 my $sandbox = sandbox_path($test);
5555
5656 chdir($test);
5757
58+ my $startTime = time();
5859 print "Running $test...\n";
5960 my $got = `$sandbox ./run @idrOpts`;
6061 my $exp = `cat expected`;
6162
63+ my $endTime = time();
64+ my $elapsedTime = $endTime - $startTime;
65+
66+ if ($showTime == 1 ){
67+ printf("Duration of $test was %d\n", $elapsedTime);
68+ }
69+
6270 # Allow for variant expected output for tests by overriding expected
6371 # when there is an expected.<os> file in the test.
6472 # This should be the exception but there are sometimes valid reasons
@@ -155,15 +163,17 @@ else {
155163
156164# Run the tests.
157165
158−my $update = 0;
159−my $diff = 0;
160−my $show = 0;
161−my $usejava = 0;
166+my $update = 0;
167+my $diff = 0;
168+my $show = 0;
169+my $usejava = 0;
170+my $showTime = 0;
162171
163172while (my $opt = shift @opts) {
164173 if ($opt eq "-u") { $update = 1; }
165174 elsif ($opt eq "-d") { $diff = 1; }
166175 elsif ($opt eq "-s") { $show = 1; }
176+ elsif ($opt eq "-t") { $showTime = 1; }
167177 else { push(@idrOpts, $opt); }
168178}
169179
@@ -171,9 +181,11 @@ my $idris = $ENV{IDRIS};
171181my $path = $ENV{PATH};
172182$ENV{PATH} = cwd() . "/" . $idris . ":" . $path;
173183
184+my $startTime = time();
185+
174186foreach my $test (@tests) {
175187 if ($diff == 0 && $show == 0) {
176− runtest($test,$update);
188+ runtest($test,$update,$showTime);
177189 }
178190 else {
179191 chdir $test;
@@ -192,4 +204,11 @@ foreach my $test (@tests) {
192204 }
193205}
194206
207+my $endTime = time();
208+my $elapsedTime = $endTime - $startTime;
209+
210+if ($showTime == 1) {
211+ printf("Duration of Entire Test Suite was %d\n", $elapsedTime);
212+}
213+
195214exit $exitstatus;