diff options
author | Chris Wilson <chris+github@qwirx.com> | 2006-07-27 23:18:35 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2006-07-27 23:18:35 +0000 |
commit | c7662795f519d2b6797e4b1ac7fa4a22afa26310 (patch) | |
tree | b1737dfa78d8e7bfb2d5a7e9831bab91869ade97 /runtest.pl.in | |
parent | a85b710c46ec79e968da349304f30945cb9b7bc1 (diff) |
* merge
- This is my current patch queue. I think that all of these are safe
to apply. This is just under half of the pending changes in
chris/general (the easy half).
Diffstat (limited to 'runtest.pl.in')
-rwxr-xr-x | runtest.pl.in | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/runtest.pl.in b/runtest.pl.in index f2b70a14..db58726d 100755 --- a/runtest.pl.in +++ b/runtest.pl.in @@ -1,11 +1,14 @@ #!@PERL@ +use strict; +use warnings; + use lib 'infrastructure'; use BoxPlatform; my ($test_name,$test_mode) = @ARGV; -$test_mode = 'debug' if $test_mode eq ''; +$test_mode = 'debug' if not defined $test_mode or $test_mode eq ''; if($test_name eq '' || ($test_mode ne 'debug' && $test_mode ne 'release')) { @@ -17,15 +20,26 @@ runtest.pl (test|ALL) [release|debug] Mode defaults to debug. __E - exit(0); + exit(2); } my @results; +my $exit_code = 0; if($test_name ne 'ALL') { - # run one test - runtest($test_name); + # run one or more specified test + if ($test_name =~ m/,/) + { + foreach my $test (split m/,/, $test_name) + { + runtest($test); + } + } + else + { + runtest($test_name); + } } else { @@ -57,6 +71,8 @@ else # report results print "--------\n",join("\n",@results),"\n"; +exit $exit_code; + sub runtest { my ($t) = @_; @@ -67,6 +83,7 @@ sub runtest if($make_res != 0) { push @results,"$t: make failed"; + $exit_code = 2; return; } @@ -82,8 +99,14 @@ sub runtest $last = $_ if m/\w/; } close RESULTS; + chomp $last; push @results,"$t: $last"; + + if ($last ne "PASSED") + { + $exit_code = 1; + } } else { |