IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5024


Ignore:
Timestamp:
Sep 13, 2005, 10:26:33 AM (21 years ago)
Author:
drobbin
Message:

copied pslib runTest to support the "--printdiff" option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/test/runTest

    r3696 r5024  
    2626#
    2727#  $Revison:  $  $Name: not supported by cvs2svn $
    28 #  $Date: 2005-04-12 21:51:00 $
     28#  $Date: 2005-09-13 20:26:33 $
    2929#
    3030#  Copyright 2004 Maui High Performance Computering Center, University of Hawaii
     
    3939# Assign variables based on the presence of command line options to the script
    4040GetOptions(
    41     "reset!"       => \$reset,
    42     "resetStderr!" => \$resetStderr,
    43     "resetStdout!" => \$resetStdout,
    44     "verified=s"   => \$verifiedDir,
    45     "help!"        => \$help,
    46     "quiet!"       => \$quiet,
    47     "printpassfail!"     => \$verbose
     41    "reset!"         => \$reset,
     42    "resetStderr!"   => \$resetStderr,
     43    "resetStdout!"   => \$resetStdout,
     44    "verified=s"     => \$verifiedDir,
     45    "help!"          => \$help,
     46    "quiet!"         => \$quiet,
     47    "printpassfail!" => \$verbose,
     48    "printdiff!"     => \$printdiff
    4849);
    4950
    5051if ($help || $#ARGV < 0) {
    51     print "Usage: runTest  [--help] [--verified=DIR] [--quiet] [--printpassfail] \\\n",
    52           "                [--reset] [--resetStderr] [--resetStdout] testfile(s)\n\n";
     52    print "\nUsage: runTest  [--help] [--quiet] [--resetStderr] [--resetStdout] [--reset] \\\n",
     53          "                [--verified=DIR] [--printpassfail] [--printdiff] testfile(s)\n\n",
     54          "Options include:\n",
     55          "    --help           Prints this help message\n",
     56          "    --quiet          Suppresses all messages\n",
     57          "    --resetStderr    Resets the STDERR expected output file in the verified\n",
     58          "                     directory\n",
     59          "    --resetStdout    Resets the STDOUT expected output file in the verified\n",
     60          "                     directory\n",
     61          "    --reset          Equivalent to --resetStderr plus --resetStdout\n",
     62          "    --verified=DIR   Specifies the location of the verified directory\n",
     63          "    --printpassfail  Prints a PASS or FAIL message for each test in each file\n",
     64          "    --printdiff      Prints any differences found in the test output and\n",
     65          "                     verified expected output.\n\n";
    5366    exit(0);
    5467}
     
    138151            s/allocate \d+ bytes at/allocate <N> bytes at/g;
    139152            s/v\d+.\d+.\d+/vX.X.X/g;
    140 
     153            s/'xxx' \(\d+\)/'xxx' \(NUM\)/;
    141154            if (m/TestPoint:\s*([^\*]+)/) {
    142155                $testfile = $1;
     
    181194            s/allocate \d+ bytes at/allocate <N> bytes at/g;
    182195            s/v\d+.\d+.\d+/vX.X.X/g;
     196            s/'xxx' \(\d+\)/'xxx' \(NUM\)/;
    183197
    184198            if (m/\*\*\*\*\*\* TESTPOINT \*\*\*\*\*\*/) {
     
    255269    exit(0);
    256270}
     271
    257272exit($exitValue);
    258273
     
    352367
    353368        # Perform difference on the STD stream files
    354         $diffstdout = `diff $streamFile $tempFile`;
     369        $diffstdout = `diff -b -y --suppress-common-lines $streamFile $tempFile`;
    355370
    356371        # Check the return value of the difference
     
    364379                # Display message of the failure of difference to user
    365380                print STDERR "\tFailed - STDOUT differences\n";
    366 
     381                print STDERR $diffstdout if $printdiff;
    367382                # Exit value to indicate STDOUT did not compare
    368383                $returnVal |= 8;
     
    372387                # Display message of the failure of difference to user
    373388                print STDERR "\tFailed - STDERR differences\n";
     389                print STDERR $diffstdout if $printdiff;
    374390
    375391                # Exit value to indicate STDERR did not compare
Note: See TracChangeset for help on using the changeset viewer.