@@ -49,16 +49,24 @@ sub sandbox_path {
49# output and report results.
49# output and report results.
51sub runtest {
51sub runtest {
52− my ($test, $update) = @_;
52+ my ($test, $update, $showTime) = @_;
54 my $sandbox = sandbox_path($test);
54 my $sandbox = sandbox_path($test);
56 chdir($test);
56 chdir($test);
58+ my $startTime = time();
58 print "Running $test...\n";
59 print "Running $test...\n";
59 my $got = `$sandbox ./run @idrOpts`;
60 my $got = `$sandbox ./run @idrOpts`;
60 my $exp = `cat expected`;
61 my $exp = `cat expected`;
63+ my $endTime = time();
64+ my $elapsedTime = $endTime - $startTime;
66+ if ($showTime == 1 ){
67+ printf("Duration of $test was %d\n", $elapsedTime);
62 # Allow for variant expected output for tests by overriding expected
70 # Allow for variant expected output for tests by overriding expected
63 # when there is an expected.<os> file in the test.
71 # when there is an expected.<os> file in the test.
64 # This should be the exception but there are sometimes valid reasons
72 # This should be the exception but there are sometimes valid reasons
@@ -155,15 +163,17 @@ else {
156# Run the tests.
164# Run the tests.
158−my $update = 0;
166+my $update = 0;
159−my $diff = 0;
167+my $diff = 0;
160−my $show = 0;
168+my $show = 0;
161−my $usejava = 0;
169+my $usejava = 0;
163while (my $opt = shift @opts) {
172while (my $opt = shift @opts) {
164 if ($opt eq "-u") { $update = 1; }
173 if ($opt eq "-u") { $update = 1; }
165 elsif ($opt eq "-d") { $diff = 1; }
174 elsif ($opt eq "-d") { $diff = 1; }
166 elsif ($opt eq "-s") { $show = 1; }
175 elsif ($opt eq "-s") { $show = 1; }
176+ elsif ($opt eq "-t") { $showTime = 1; }
167 else { push(@idrOpts, $opt); }
177 else { push(@idrOpts, $opt); }
@@ -171,9 +181,11 @@ my $idris = $ENV{IDRIS};
171my $path = $ENV{PATH};
181my $path = $ENV{PATH};
172$ENV{PATH} = cwd() . "/" . $idris . ":" . $path;
182$ENV{PATH} = cwd() . "/" . $idris . ":" . $path;
184+my $startTime = time();
174foreach my $test (@tests) {
186foreach my $test (@tests) {
175 if ($diff == 0 && $show == 0) {
187 if ($diff == 0 && $show == 0) {
176− runtest($test,$update);
188+ runtest($test,$update,$showTime);
179 chdir $test;
191 chdir $test;
@@ -192,4 +204,11 @@ foreach my $test (@tests) {
207+my $endTime = time();
208+my $elapsedTime = $endTime - $startTime;
210+if ($showTime == 1) {
211+ printf("Duration of Entire Test Suite was %d\n", $elapsedTime);
195exit $exitstatus;
214exit $exitstatus;