IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 12, 2005, 11:51:00 AM (21 years ago)
Author:
desonia
Message:

adjusted to match the latest SDRS for psLib (change of function names).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/runTest

    r3630 r3696  
    2626#
    2727#  $Revison:  $  $Name: not supported by cvs2svn $
    28 #  $Date: 2005-04-01 21:52:22 $
     28#  $Date: 2005-04-12 21:51:00 $
    2929#
    3030#  Copyright 2004 Maui High Performance Computering Center, University of Hawaii
     
    4343    "resetStdout!" => \$resetStdout,
    4444    "verified=s"   => \$verifiedDir,
    45     "help!"        => \$help
     45    "help!"        => \$help,
     46    "quiet!"       => \$quiet,
     47    "printpassfail!"     => \$verbose
    4648);
    4749
    4850if ($help || $#ARGV < 0) {
    49     print
    50 "Usage: runTest [--reset] [--resetStderr] [--resetStdout] [--verified=DIR] testfile(s)\n\n";
     51    print "Usage: runTest  [--help] [--verified=DIR] [--quiet] [--printpassfail] \\\n",
     52          "                [--reset] [--resetStderr] [--resetStdout] testfile(s)\n\n";
    5153    exit(0);
    5254}
     
    7577    # Check if a temp directory already exists in the current work directory
    7678    if ( !( -e "temp" ) ) {
    77 
    7879        # Create temp directory to store STDOUT, STDERR files during test run
    7980        `mkdir temp`;
    80 
    81         # Display message of new directory created
    82         print("Creating temp directory\n");
    8381    }
    8482
     
    8785
    8886        # Display message that verified subdirectory doesn't exist
    89         print("        Verified directory doesn't exist.\n");
     87        print STDERR "        Verified directory doesn't exist.\n";
    9088
    9189        # Exit script since the test cannot be run with verified files
     
    9593    # Check if the test driver file exists and is executable
    9694    if ( ( -e $testFile ) && ( -x $testFile ) ) {
    97 
    98         # Display message the test driver is being executed
    99         print("--- Executing test driver: $testFile\n");
    10095
    10196        # Invoke the test driver
     
    112107            # Display failure message with return value to user
    113108            if ( $? != 0 && ( $testFile !~ /^A/i ) ) {
    114                 print("Failed - Test Driver returned $?, expected 0.\n");
     109                print STDERR "Failed - Test Driver returned $?, expected 0.\n";
    115110            }
    116111            elsif ( $? == 0 && ( $testFile =~ /^A/i ) ) {
    117                 print("Failed - Test Driver returned $?, expected abort.\n");
     112                print STDERR "Failed - Test Driver returned $?, expected abort.\n";
    118113            }
    119114            $exitValue |= 64;
     
    144139            s/v\d+.\d+.\d+/vX.X.X/g;
    145140
     141            if (m/TestPoint:\s*([^\*]+)/) {
     142                $testfile = $1;
     143            }
     144            if (m/^---> TESTPOINT\s(\S+)/) {
     145                print "\t$testfile- $1\n" if ($verbose || $1 eq "FAILED");
     146                if ($1 eq "FAILED") {
     147                    print $testoutput;
     148                }
     149            }
     150
    146151            # Filter lines with malloc.  This is an artifact of memory testing
    147152            # with the Mac testbed
     
    177182            s/v\d+.\d+.\d+/vX.X.X/g;
    178183
     184            if (m/\*\*\*\*\*\* TESTPOINT \*\*\*\*\*\*/) {
     185                $testoutput = $_;
     186            }
     187            $testoutput += $_;
     188
     189            if (m/ TestPoint:\s*([^\*]+)/) {
     190                $testfile = $1;
     191            }
     192            if (m/^---> TESTPOINT\s(\S+)/) {
     193                print "\t$testfile- $1\n" if ($verbose || $1 eq "FAILED");
     194                if ($1 eq "FAILED") {
     195                    print $testoutput;
     196                }
     197            }
     198
    179199            # Filter lines with malloc.  This is an artifact of memory testing
    180200            # with the Mac testbed
     201
    181202            if ( !m/\*\*\*\smalloc/ ) {
    182203                print MODFILE ($_);
     
    193214
    194215        # Compare STDOUT capture with verified file
    195         $exitValue |= &compareStream("$verifiedDir/$testFile.stdout");
     216        $exitValue = &compareStream("$verifiedDir/$testFile.stdout");
    196217
    197218        # Check exit value to determine if verified file doesn't exist
     
    218239        # Since test driver doesn't exist or is not executable then display
    219240        # message to user.
    220         print(
    221 "        Need to specify an executable test file within directory.\n"
    222         );
     241        print STDERR "\tNeed to specify an executable test file.\n";
    223242
    224243        # Exit value set to indicate test driver doesn't exist or not executable
     
    231250# of a failed test
    232251if ( ( $exitValue >> 3 ) != 0 ) {
    233     print("Test failed - return status = $exitValue\n\n");
     252    print STDERR "Test failed - return status = $exitValue\n\n";
    234253}
    235254else {
    236     print("Test successful\n\n");
     255    exit(0);
    237256}
    238257exit($exitValue);
     
    272291            || m/\|A\|/i )
    273292        {
     293            print STDERR "\tFailed - File $fileName contains error strings.\n";
    274294            if ( $fileName =~ m/out/ ) {
    275                 print(
    276                     "        Failed - File $fileName contains error strings.\n"
    277                 );
    278295                $returnVal = 64;
    279296            }
    280297            elsif ( $fileName =~ m/err/ ) {
    281                 print(
    282                     "        Failed - File $fileName contains error strings.\n"
    283                 );
    284298                $returnVal = 128;
    285299            }
     
    305319#
    306320#      Return:   0  -  Compare successful
     321#                2  -  STDOUT verified file doesn't exist
     322#                4  -  STDERR verified file doesn't exist
    307323#                8  -  STDOUT verified file doesn't compare
    308324#               16  -  STDERR verified file doesn't compare
     
    316332
    317333    # Check for existence of verified STD stream files
    318     if ( -e $streamFile ) {
     334    if ( !( -e $streamFile ) ) {
     335
     336        # Set exit value bit 1 to indicate proper failure
     337        if ( $streamFile =~ /out$/ ) {
     338            $returnVal |= 2;
     339        }
     340        elsif ( $streamFile =~ /err$/ ) {
     341            $returnVal |= 4;
     342        }
     343    }
     344    else {
    319345
    320346        # Verified STD stream file exists
     
    337363
    338364                # Display message of the failure of difference to user
    339                 print("        Failed - STDOUT difference\n$diffstdout\n");
     365                print STDERR "\tFailed - STDOUT differences\n";
    340366
    341367                # Exit value to indicate STDOUT did not compare
     
    345371
    346372                # Display message of the failure of difference to user
    347                 print("        Failed - STDERR difference\n$diffstdout\n");
     373                print STDERR "\tFailed - STDERR differences\n";
    348374
    349375                # Exit value to indicate STDERR did not compare
Note: See TracChangeset for help on using the changeset viewer.