Changeset 2728 in /cluster/svnroot


Ignore:
Timestamp:
Oct 14, 2010 9:40:42 PM (10 years ago)
Author:
skylar
Message:

fixing system test by cd'ing back to tests directory (#520)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bccd-ng/branches/skylar-test_fw/trees/home/bccd/tests/test_defs.pm

    r2614 r2728  
    33use bccd_test_suite;
    44use vars qw/ %tests /;
     5use Cwd;
     6use POSIX;
     7use Carp;
    58
    69%tests = (
    710                'test' => sub { #Test the test suite
    8                 (my $testdir, my $testname) = @_;
    9                 my $storeOutput =
    10                 bccd_test_suite::generate_storeOutput($testdir,$testname);
    11                 system("
     11                    (my $testdir, my $testname) = @_;
     12                    my $storeOutput =
     13                        bccd_test_suite::generate_storeOutput($testdir,$testname);
     14                    system("
    1215                echo \"BCCD\nBCCD\nBCCD\" $storeOutput
    1316                echo \"ok, it works.\" $storeOutput
    1417                ")
    15                 },
    16 
    17                 'fail' => sub { #Guarantee an error report
    18                 (my $testdir, my $testname) = @_;
    19                 my $storeOutput =
    20                  bccd_test_suite::generate_storeOutput($testdir,$testname);
    21                 system( "seq 1 100 | sort -R $storeOutput");
    22                 },
    23 
    24                 'system' => sub { #Print system information
    25                 (my $testdir, my $testname) = @_;
    26                 my $storeOutput =
    27                  bccd_test_suite::generate_storeOutput($testdir,$testname);
    28                 system("       
    29                 uname -a $storeOutput
    30                 cat /proc/cpuinfo $storeOutput
    31                 ");
    32                 },
    33        
    34                 'BCCD' => sub { #Test the BCCD's built-in tests
    35                
    36                 },
    37                        
    38                 'GalaxSee' => sub { #Test GalaxSee
    39                         (my $testdir, my $testname) = @_;
    40                         bccd_test_suite::mpi_test($testdir, $testname);
    41                 },
    42 
    43                 'Life' => sub { #Test Conway's Game of Life
    44                         (my $testdir, my $testname) = @_;
    45                         bccd_test_suite::mpi_test($testdir, $testname);
    46                 })
     18    },
     19   
     20    'fail' => sub { #Guarantee an error report
     21        (my $testdir, my $testname) = @_;
     22        my $storeOutput =
     23            bccd_test_suite::generate_storeOutput($testdir,$testname);
     24        system( "seq 1 100 | sort -R $storeOutput");
     25    },
     26   
     27    'system' => sub { #Print system information
     28        (my $testdir, my $testname) = @_;
     29        chdir("$ENV{HOME}/tests"); # Hack time
     30        my $storeOutput =
     31            bccd_test_suite::generate_storeOutput($testdir,$testname);
     32        my $out = getcwd()."/$testdir/$testname.dat";
     33        open(my $OUT, '>>', $out) or
     34            croak "Can't open $out for appending: $!\n";
     35        my @uname = POSIX::uname();
     36        print $OUT "@uname\n";
     37        open(my $CPUI, '<', '/proc/cpuinfo') or
     38            croak "Can't open /proc/cpuinfo for reading: $!\n";
     39        while(my $line = <$CPUI>) {
     40            chomp $line;
     41            print $OUT "$line\n";
     42        }
     43        close($CPUI);
     44        close($OUT);
     45    },
     46   
     47    'BCCD' => sub { #Test the BCCD's built-in tests
     48       
     49    },
     50   
     51    'GalaxSee' => sub { #Test GalaxSee
     52        (my $testdir, my $testname) = @_;
     53        bccd_test_suite::mpi_test($testdir, $testname);
     54    },
     55   
     56    'Life' => sub { #Test Conway's Game of Life
     57        (my $testdir, my $testname) = @_;
     58        bccd_test_suite::mpi_test($testdir, $testname);
     59    })
     60   
Note: See TracChangeset for help on using the changeset viewer.