Changeset 2505 in /cluster/svnroot


Ignore:
Timestamp:
Jun 29, 2010 2:52:46 PM (10 years ago)
Author:
leemasa
Message:

Allowed bccd_test_suite to take arbitrary files of tests

Location:
bccd-ng/branches/leemasa-devel/trees/home/bccd/tests
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/leemasa-devel/trees/home/bccd/tests/bccd_test_suite.pl

    r2498 r2505  
    55use strict;
    66use File::Path;
     7use Getopt::Long;
    78
    8 use bccd_tests;
     9use bccd_test_suite;
    910
     11#Global Arguments and Defaults
     12my $tempdir = "tmp";
    1013my $testdir = "test";
     14my $controldir = "control";
     15my $listfile = "test_lists/std";
     16my $buildcontrol = 0;
    1117
     18GetOptions(
     19        'control|c' => \$buildcontrol,
     20        'controldir=s' => \$controldir,
     21        'testdir|d=s' => \$testdir,
     22        'file|f=s' => \$listfile,
     23        );
    1224
    13 my $testname;
    14 my $storeOutput;
     25#get test list
     26my @testlist;
     27if (-r $listfile){
     28        @testlist = bccd_test_suite::read_list($listfile);     
     29} else {
     30        die "Could not read the list file.";
     31}
    1532
     33if ($buildcontrol){
     34        print "Using control directory: $controldir\n";
     35        $testdir = $controldir;
     36}
     37
     38#initialize test result directory
    1639if (-e $testdir){
    17   rmtree($testdir) or die "Could not replace existing test directory: $!";
     40  rmtree($testdir) or die "Could not clear existing test directory for replacement: $!";
    1841  }
    1942mkdir($testdir) or die "Could not make test directory: $!";
    2043
    21 $tests{'Life'}->('Life')
    22 $tests{'Gal'}->('Gal')
     44#Run tests
     45foreach my $test (@testlist){
     46        if ($test ne "|"){
     47                print "$test\n";
     48                $bccd_test_suite::tests{$test}->($testdir,$test);
     49        }
     50}
     51
     52#Check tests
     53if ( $buildcontrol ){
     54        if (-e $tempdir){
     55                rmtree $tempdir or die "Could not delete existing temporary directory: $!";
     56        }
     57
     58        mkdir($tempdir);
     59
     60        for (my $i = 0; $testlist[$i] ne "|" and $i < length(@testlist); ++$i){
     61                my $test = $testlist[$i];
     62                system ("diff $testdir/$test.dat $controldir/$test.dat >> $tempdir/$test.diff");
     63        }
     64}
Note: See TracChangeset for help on using the changeset viewer.