Changeset 2610 in /cluster/svnroot


Ignore:
Timestamp:
Sep 2, 2010 2:48:08 PM (10 years ago)
Author:
leemasa
Message:

Improved the test suite to be more developer-friendly

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

Legend:

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

    r2588 r2610  
    44#Written by Samuel Leeman-Munk
    55#Runs test scripts and compares with control output in BCCD.
    6 #Emails differences to bccd-developers@bccd.net
     6#with --mail, emails differences to bccd-developers@bccd.net
    77#**********************************************************#
    88
     
    1313
    1414use bccd_test_suite;
     15use test_defs;
    1516
    1617#Constants
     
    2223my $DEFAULT_DIFF_DIR = "tmp";
    2324my $DEFAULT_CONTROL_DIR = "control";
    24 my $DEFAULT_MAILTO = '<sleemanmunk@gmail.com>'; #the recipient of the summary email
     25my $DEFAULT_MAIL = $DEFAULSE;
     26my $DEFAULT_MAILTO = 'bccd-developers@bccd.net'; #the default recipient of the summary email
    2527
    2628#Global Arguments and Defaults
     
    3234my $buildcontrol = FALSE;
    3335my $verbose = $DEFAULSE;
    34 my $mail = TRUE;
     36my $mail = $DEFAULT_MAIL;
    3537my $mailto = $DEFAULT_MAILTO;
    3638my $messy = FALSE;
     
    4547        'verbose!' => \$verbose,
    4648        'mailto|t=s' => \$mailto,
    47         'messy' => \$messy,
     49        'messy|m' => \$messy,
    4850        );
     51if ($mail == $DEFAULSE){
     52        if ($mailto ne $DEFAULT_MAILTO){
     53                $mail = TRUE;
     54        }
     55        else{
     56                $mail = FALSE;
     57        }
     58}
    4959
    5060#By default, verbose turns on when mail is turned off
     
    7181    $testdir = $controldir;
    7282} elsif (not -e $controldir){
    73         die "control directory \"$controldir\" does not exist. Please specify an existing control directory or, if you are using this system as the control system, use option -c to create one";
     83        die "control directory \"$controldir\" does not exist. Please specify an existing control directory or, if you are using this system as the control system, use option -c to create one.\n";
    7484}
    7585
     
    8494    if ($test ne $SEPARATOR_STRING){
    8595        print "$test\n";
    86         $bccd_test_suite::tests{$test}->($testdir,$test);
     96        $tests::tests{$test}->($testdir,$test);
    8797    }
    8898}
     
    163173                }
    164174
    165                 my %mail = ("From"    , '<tests@bccd.net>',
     175                my %mail = ("From"    , '<noreply@bccd.net>',
    166176                                "To"      , '<sleemanmunk@gmail.com>',
    167177                                "Subject" , $subject,
  • bccd-ng/branches/leemasa-devel/trees/home/bccd/tests/bccd_test_suite.pm

    r2588 r2610  
    22package bccd_test_suite;
    33use strict;
    4 use vars qw(%tests);
    54
    65#Trim function to remove whitespace
     
    120119}
    121120
    122 #############################LIST OF TEST DEFINITIONS##########################
    123 
    124 %tests = (
    125                 'test' => sub { #Test the test suite
    126                 (my $testdir, my $testname) = @_;
    127                 my $storeOutput = generate_storeOutput($testdir,$testname);
    128                 system("
    129                 echo \"trireme\ngalley\ncaesar\" $storeOutput
    130                 echo \"ok, it works.\" $storeOutput
    131                 ")
    132                 },
    133 
    134                 'fail' => sub { #Guarantee an error report
    135                 (my $testdir, my $testname) = @_;
    136                 my $storeOutput = generate_storeOutput($testdir,$testname);
    137                 system( "seq 1 100 | sort -R $storeOutput");
    138                 },
    139 
    140                 'system' => sub { #Print system information
    141                 (my $testdir, my $testname) = @_;
    142                 my $storeOutput = generate_storeOutput($testdir,$testname);
    143                 system("       
    144                 uname -a $storeOutput
    145                 cat /proc/cpuinfo $storeOutput
    146                 ");
    147                 },
    148        
    149                 'BCCD' => sub { #Test the BCCD's built-in tests
    150                
    151                 },
    152                        
    153                 'GalaxSee' => sub { #Test GalaxSee
    154                         (my $testdir, my $testname) = @_;
    155                         mpi_test($testdir, $testname);
    156                 },
    157 
    158                 'Life' => sub { #Test Conway's Game of Life
    159                         (my $testdir, my $testname) = @_;
    160                         mpi_test($testdir, $testname);
    161                 })
     121return 1;
Note: See TracChangeset for help on using the changeset viewer.