Index: trunk/psLib/test/runTest
===================================================================
--- trunk/psLib/test/runTest	(revision 3682)
+++ trunk/psLib/test/runTest	(revision 3690)
@@ -26,5 +26,5 @@
 #
 #  $Revison:  $  $Name: not supported by cvs2svn $
-#  $Date: 2005-04-07 20:27:41 $
+#  $Date: 2005-04-09 00:04:57 $
 #
 #  Copyright 2004 Maui High Performance Computering Center, University of Hawaii
@@ -43,10 +43,12 @@
     "resetStdout!" => \$resetStdout,
     "verified=s"   => \$verifiedDir,
-    "help!"        => \$help
+    "help!"        => \$help,
+    "quiet!"       => \$quiet,
+    "printpassfail!"     => \$verbose
 );
 
 if ($help || $#ARGV < 0) {
-    print
-"Usage: runTest [--reset] [--resetStderr] [--resetStdout] testfile(s)\n\n";
+    print "Usage: runTest  [--help] [--verified=DIR] [--quiet] [--printpassfail] \\\n",
+          "                [--reset] [--resetStderr] [--resetStdout] testfile(s)\n\n";
     exit(0);
 }
@@ -75,10 +77,6 @@
     # Check if a temp directory already exists in the current work directory
     if ( !( -e "temp" ) ) {
-
         # Create temp directory to store STDOUT, STDERR files during test run
         `mkdir temp`;
-
-        # Display message of new directory created
-        print("Creating temp directory\n");
     }
 
@@ -87,5 +85,5 @@
 
         # Display message that verified subdirectory doesn't exist
-        print("        Verified directory doesn't exist.\n");
+        print STDERR "        Verified directory doesn't exist.\n";
 
         # Exit script since the test cannot be run with verified files
@@ -95,7 +93,4 @@
     # Check if the test driver file exists and is executable
     if ( ( -e $testFile ) && ( -x $testFile ) ) {
-
-        # Display message the test driver is being executed
-        print("--- Executing test driver: $testFile\n");
 
         # Invoke the test driver
@@ -112,8 +107,8 @@
             # Display failure message with return value to user
             if ( $? != 0 && ( $testFile !~ /^A/i ) ) {
-                print("Failed - Test Driver returned $?, expected 0.\n");
+                print STDERR "Failed - Test Driver returned $?, expected 0.\n";
             }
             elsif ( $? == 0 && ( $testFile =~ /^A/i ) ) {
-                print("Failed - Test Driver returned $?, expected abort.\n");
+                print STDERR "Failed - Test Driver returned $?, expected abort.\n";
             }
             $exitValue |= 64;
@@ -148,5 +143,8 @@
             }
             if (m/^---> TESTPOINT\s(\S+)/) {
-                print "\t$testfile- $1\n";
+                print "\t$testfile- $1\n" if ($verbose || $1 eq "FAILED");
+                if ($1 eq "FAILED") {
+                    print $testoutput;
+                }
             }
 
@@ -184,9 +182,17 @@
             s/v\d+.\d+.\d+/vX.X.X/g;
 
+            if (m/\*\*\*\*\*\* TESTPOINT \*\*\*\*\*\*/) {
+                $testoutput = $_;
+            }
+            $testoutput += $_;
+
             if (m/ TestPoint:\s*([^\*]+)/) {
                 $testfile = $1;
             }
             if (m/^---> TESTPOINT\s(\S+)/) {
-                print "\t$testfile- $1\n";
+                print "\t$testfile- $1\n" if ($verbose || $1 eq "FAILED");
+                if ($1 eq "FAILED") {
+                    print $testoutput;
+                }
             }
 
@@ -208,5 +214,5 @@
 
         # Compare STDOUT capture with verified file
-        $exitValue |= &compareStream("$verifiedDir/$testFile.stdout");
+        $exitValue = &compareStream("$verifiedDir/$testFile.stdout");
 
         # Check exit value to determine if verified file doesn't exist
@@ -233,7 +239,5 @@
         # Since test driver doesn't exist or is not executable then display
         # message to user.
-        print(
-"        Need to specify an executable test file within directory.\n"
-        );
+        print STDERR "\tNeed to specify an executable test file.\n";
 
         # Exit value set to indicate test driver doesn't exist or not executable
@@ -246,8 +250,8 @@
 # of a failed test
 if ( ( $exitValue >> 3 ) != 0 ) {
-    print("Test failed - return status = $exitValue\n\n");
+    print STDERR "Test failed - return status = $exitValue\n\n";
 }
 else {
-    print("Test successful\n\n");
+    exit(0);
 }
 exit($exitValue);
@@ -287,14 +291,9 @@
             || m/\|A\|/i )
         {
+            print STDERR "\tFailed - File $fileName contains error strings.\n";
             if ( $fileName =~ m/out/ ) {
-                print(
-                    "        Failed - File $fileName contains error strings.\n"
-                );
                 $returnVal = 64;
             }
             elsif ( $fileName =~ m/err/ ) {
-                print(
-                    "        Failed - File $fileName contains error strings.\n"
-                );
                 $returnVal = 128;
             }
@@ -320,4 +319,6 @@
 #
 #      Return:   0  -  Compare successful
+#                2  -  STDOUT verified file doesn't exist
+#                4  -  STDERR verified file doesn't exist
 #                8  -  STDOUT verified file doesn't compare
 #               16  -  STDERR verified file doesn't compare
@@ -331,5 +332,15 @@
 
     # Check for existence of verified STD stream files
-    if ( -e $streamFile ) {
+    if ( !( -e $streamFile ) ) {
+
+        # Set exit value bit 1 to indicate proper failure
+        if ( $streamFile =~ /out$/ ) {
+            $returnVal |= 2;
+        }
+        elsif ( $streamFile =~ /err$/ ) {
+            $returnVal |= 4;
+        }
+    }
+    else {
 
         # Verified STD stream file exists
@@ -352,5 +363,5 @@
 
                 # Display message of the failure of difference to user
-                print("        Failed - STDOUT difference\n$diffstdout\n");
+                print STDERR "\tFailed - STDOUT differences\n";
 
                 # Exit value to indicate STDOUT did not compare
@@ -360,5 +371,5 @@
 
                 # Display message of the failure of difference to user
-                print("        Failed - STDERR difference\n$diffstdout\n");
+                print STDERR "\tFailed - STDERR differences\n";
 
                 # Exit value to indicate STDERR did not compare
