on master help sign in
Merge pull request #2904 from melted/par_on

Reenable parallel testing

commit4e5474ae82af8e4790e3e0d28af87ab673ea9f1b authorNiklas Larsson <metaniklas@gmail.com> dateFri 22 Jan 2016, 21:49 (11 years ago) parent6f269961ca661a
2 files changed+25−18
test/Makefile+6−2 test/runtest.pl+19−16
test/Makefile+6−2
@@ -1,11 +1,15 @@
11.PHONY: test test_js time update diff distclean $(TESTS)
22
3+TESTS = $(sort $(patsubst %/,%.test,$(wildcard */)))
34
4−test:
5+test: $(TESTS)
6+
7+
8+info:
59 /usr/bin/env perl ./runtest.pl all
610
711%.test:
8− @perl ./runtest.pl $(patsubst %.test,%,$@)
12+ @perl ./runtest.pl $(patsubst %.test,%,$@) -q
913
1014test_js:
1115 @perl ./runtest.pl without sugar004 reg029 reg052 io001 dsl002 io003 effects001 effects002 basic007 basic011 ffi006 --codegen node
test/runtest.pl+19−16
@@ -7,6 +7,7 @@ use Env;
77
88my $exitstatus = 0;
99my @idrOpts = ();
10+my $quiet = 0;
1011
1112
1213# Sets the PATH if there's a sandbox or stack present
@@ -26,15 +27,15 @@ sub set_path {
2627
2728 if ( -d $sandbox ) {
2829 my $sandbox_abs = abs_path($sandbox);
29− print "Using Cabal Sandbox\n";
30− printf("Sandbox located at: %s\n", $sandbox_abs);
30+ print "Using Cabal Sandbox\n" unless $quiet;
31+ printf("Sandbox located at: %s\n", $sandbox_abs) unless $quiet;
3132 $ENV{PATH} = $sandbox_abs . ":" . $path;
3233
3334 } elsif ( -d $stack_work_dir ) {
3435
3536 my $stack_work_abs = abs_path($stack_work_dir);
36− print "Using Stack Work\n";
37− printf("Stack work located at: %s\n", $stack_work_abs);
37+ print "Using Stack Work\n" unless $quiet;
38+ printf("Stack work located at: %s\n", $stack_work_abs) unless $quiet;
3839 $ENV{PATH} = $stack_work_abs . ":" . $path;
3940
4041 }
@@ -49,7 +50,6 @@ sub runtest {
4950 chdir($test);
5051
5152 my $startTime = time();
52− print "Running $test...";
5353 my $got = `./run @idrOpts`;
5454 my $exp = `cat expected`;
5555
@@ -87,19 +87,19 @@ sub runtest {
8787 }
8888
8989 if ($got eq $exp) {
90− print "success\n";
90+ print "$test finished...success\n";
9191 $statsref->{'succeeded'}++;
9292 }
9393 else {
9494 if ($update == 0) {
9595 $exitstatus = 1;
96− print "FAILURE\n";
96+ print "$test finished...FAILURE\n";
9797 system "diff output expected";
9898 push @$failedref, $test;
9999 $statsref->{'failed'}++;
100100 } else {
101101 system("cp output expected");
102− print "UPDATED\n";
102+ print "$test finished...UPDATED\n";
103103 $statsref->{'updated'}++;
104104 }
105105 }
@@ -179,6 +179,7 @@ while (my $opt = shift @opts) {
179179 elsif ($opt eq "-d") { $diff = 1; }
180180 elsif ($opt eq "-s") { $show = 1; }
181181 elsif ($opt eq "-t") { $showTime = 1; }
182+ elsif ($opt eq "-q") { $quiet = 1; }
182183 else { push(@idrOpts, $opt); }
183184}
184185
@@ -186,7 +187,7 @@ my $idris = $ENV{IDRIS};
186187
187188if (defined $ENV{IDRIS} && -e $idris ) {
188189 $ENV{IDRIS} = abs_path($idris);
189− print "Using $idris\n";
190+ print "Using $idris\n" unless $quiet;
190191} else {
191192 delete $ENV{IDRIS};
192193 set_path();
@@ -220,14 +221,16 @@ my $endTime = time();
220221my $elapsedTime = $endTime - $startTime;
221222
222223
223−print "----\n";
224−printf("%d tests run: %d succeeded, %d failed, %d updated.\n\n",
225− $stats{'total'}, $stats{'succeeded'}, $stats{'failed'}, $stats{'updated'} );
224+if(!$quiet) {
225+ print "----\n";
226+ printf("%d tests run: %d succeeded, %d failed, %d updated.\n\n",
227+ $stats{'total'}, $stats{'succeeded'}, $stats{'failed'}, $stats{'updated'} );
226228
227−if (@failed) {
228− print "Failed tests:\n";
229− foreach my $failure (@failed) {
230− print "$failure\n";
229+ if (@failed) {
230+ print "Failed tests:\n";
231+ foreach my $failure (@failed) {
232+ print "$failure\n";
233+ }
231234 }
232235}
233236