Ignore:
Timestamp:
01/09/2006 00:43:40 (6 years ago)
Author:
chris
Message:

(refs #3)

Use strict and warnings for code safety.

Exit with status 2 on invalid usage.

Allow running multiple tests, comma separated.

Exit with status 2 if make fails for any test.

Exit with status 1 if any test fails.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/chris/merge/runtest.pl.in

    r909 r910  
    11#!@PERL@ 
     2 
     3use strict; 
     4use warnings; 
    25 
    36use lib 'infrastructure'; 
     
    69my ($test_name,$test_mode) = @ARGV; 
    710 
    8 $test_mode = 'debug' if $test_mode eq ''; 
     11$test_mode = 'debug' if not defined $test_mode or $test_mode eq ''; 
    912 
    1013if($test_name eq '' || ($test_mode ne 'debug' && $test_mode ne 'release')) 
     
    1821 
    1922__E 
    20         exit(0); 
     23        exit(2); 
    2124} 
    2225 
    2326my @results; 
     27my $exit_code = 0; 
    2428 
    2529if($test_name ne 'ALL') 
    2630{ 
    27         # run one test 
    28         runtest($test_name); 
     31        # run one or more specified test 
     32        if ($test_name =~ m/,/) 
     33        { 
     34                foreach my $test (split m/,/, $test_name) 
     35                { 
     36                        runtest($test); 
     37                } 
     38        } 
     39        else 
     40        { 
     41                runtest($test_name); 
     42        } 
    2943} 
    3044else 
     
    5872print "--------\n",join("\n",@results),"\n"; 
    5973 
     74exit $exit_code; 
     75 
    6076sub runtest 
    6177{ 
     
    6884        { 
    6985                push @results,"$t: make failed"; 
     86                $exit_code = 2; 
    7087                return; 
    7188        } 
     
    83100                } 
    84101                close RESULTS; 
     102 
    85103                chomp $last; 
    86104                push @results,"$t: $last"; 
     105 
     106                if ($last ne "PASSED")  
     107                {  
     108                        $exit_code = 1; 
     109                } 
    87110        } 
    88111        else 
Note: See TracChangeset for help on using the changeset viewer.