Index: trunk/psModules/test/runTest
===================================================================
--- trunk/psModules/test/runTest	(revision 2140)
+++ trunk/psModules/test/runTest	(revision 3623)
@@ -18,17 +18,13 @@
 #                 0    Test run successfull and all tests passed
 #                 1    Verified directory did not exist
-#                 2    Verified STDOUT file did not exist
-#                 4    Verified STDERR file did not exist
 #                 8    STDOUT files did not compare
 #                16    STDERR files did not compare
 #                32    Test driver doesn't exist or is not executable
-#                64    STDOUT captured contains error strings
-#               128    STDERR captured contains error strings
-#               256    Test driver did not return zero
+#                64    Test driver did not return zero
 #
 #  SYNOSIS:  runTest testDriverName
 #
 #  $Revison:  $  $Name: not supported by cvs2svn $
-#  $Date: 2004-10-14 23:58:56 $
+#  $Date: 2005-04-01 20:11:19 $
 #
 #  Copyright 2004 Maui High Performance Computering Center, University of Hawaii
@@ -36,6 +32,8 @@
 ################################################################################
 
-# Provides functions for handling long command line options
+# Provides functions for handling psS64 command line options
 use Getopt::Long;
+
+$verifiedDir = "verified";
 
 # Assign variables based on the presence of command line options to the script
@@ -44,8 +42,9 @@
     "resetStderr!" => \$resetStderr,
     "resetStdout!" => \$resetStdout,
+    "verified=s"   => \$verifiedDir,
     "help!"        => \$help
 );
 
-if ($help) {
+if ($help || $#ARGV < 0) {
     print
 "Usage: runTest [--reset] [--resetStderr] [--resetStdout] testfile(s)\n\n";
@@ -62,22 +61,10 @@
 
 # Set up the PSLIB_ROOT environment variable if the user doesn't have it set
-if ( !$ENV{'PSLIB_ROOT'} ) {
-
-    # Use the directory directly above test
-    $PSLIB_ROOT = `cd ..;pwd`;
-
-    # Remove newline for the end of path returned
-    chomp($PSLIB_ROOT);
-
-    # Set the environment variable
-    $ENV{'PSLIB_ROOT'} = $PSLIB_ROOT;
-
-    # Display message that PSLIB_ROOT not found and set to
-    print("PSLIB_ROOT not found: set to $PSLIB_ROOT\n");
-}
-
-# Add PSLIB_ROOT/lib to LD_LIBRARY_PATH and DYLD_LIBRARY_PATH environment vars
-$ENV{'LD_LIBRARY_PATH'}   = "$ENV{'PSLIB_ROOT'}/lib:$ENV{'LD_LIBRARY_PATH'}";
-$ENV{'DYLD_LIBRARY_PATH'} = "$ENV{'PSLIB_ROOT'}/lib:$ENV{'DYLD_LIBRARY_PATH'}";
+if ( $ENV{'PSLIB_ROOT'} ) {
+
+	# Add PSLIB_ROOT/lib to LD_LIBRARY_PATH and DYLD_LIBRARY_PATH environment vars
+	$ENV{'LD_LIBRARY_PATH'}   = "$ENV{'PSLIB_ROOT'}/src/.libs:$ENV{'LD_LIBRARY_PATH'}";
+	$ENV{'DYLD_LIBRARY_PATH'} = "$ENV{'PSLIB_ROOT'}/src/.libs:$ENV{'DYLD_LIBRARY_PATH'}";
+}
 
 # Loop through the arguements passed to the script
@@ -97,5 +84,5 @@
 
     # Check if a verified directory exists in the current work directory
-    if ( !( -e "verified" ) ) {
+    if ( !( -e $verifiedDir ) ) {
 
         # Display message that verified subdirectory doesn't exist
@@ -125,108 +112,106 @@
             # Display failure message with return value to user
             if ( $? != 0 && ( $testFile !~ /^A/i ) ) {
-                print(
-"        Failed - Test Driver expected 0 return value (Return value $?)\n"
-                );
+                print("Failed - Test Driver returned $?, expected 0.\n");
             }
             elsif ( $? == 0 && ( $testFile =~ /^A/i ) ) {
-                print(
-"        Failed - Test Driver expected abort (Return value $?)\n"
-                );
-            }
-            $exitValue |= 256;
-        }
-        else {
-
-            # Test driver succeeded.
-
-            # Create filtered version of stdout and stderr
-
-            # Open the STDOUT file for reading
-            open( OUTFILE, "< temp/$testFile.stdout" );
-
-            # Open mod file to place filtered STDOUT
-            open( MODFILE,  "> temp/$testFile.stdout.mod" );
-            open( MODFILE2, "> verified/$testFile.stdout" ) if $resetStdout;
-
-           # Replace the variable date, time and host information with constants
-            $hostname = `hostname`;
-            chop $hostname;
-            while (<OUTFILE>) {
-                s/\s+\d+:\d+:\d+\w/<TIME>/g;
-                s/\d+:\d+:\d+/<DATE>/g;
-                s/$hostname\s*/<HOST>/g;
-                s/: Line \d+/: Line <LINENO>/g;
-                s/\:\d+/\:<LINENO>/g;
-                s/allocate \d+ bytes at/allocate <N> bytes at/g;
-
-              # Filter lines with malloc.  This is an artifact of memory testing
-              # with the Mac testbed
-                if ( !m/\*\*\*\smalloc/ ) {
-                    print MODFILE ($_);
-                    print MODFILE2 ($_) if $resetStdout;
-                }
-            }
-
-            # Close mod file
-            close(MODFILE);
-            close(MODFILE2) if $resetStdout;
-
-            # Close STDERR file
-            close(OUTFILE);
-
-            # Open the STDERR file for reading
-            open( OUTFILE, "< temp/$testFile.stderr" );
-
-            # Open mod file to place filtered STDERR
-            open( MODFILE,  "> temp/$testFile.stderr.mod" );
-            open( MODFILE2, "> verified/$testFile.stderr" ) if $resetStderr;
-
-           # Replace the variable date, time and host information with constants
-            while (<OUTFILE>) {
-                s/\s+\d+:\d+:\d+\w/<TIME>/g;
-                s/\d+:\d+:\d+/<DATE>/g;
-                s/$hostname\s*/<HOST>/g;
-                s/: Line \d+/: Line <LINENO>/g;
-                s/\:\d+/\:<LINENO>/g;
-                s/allocate \d+ bytes at/allocate <N> bytes at/g;
-
-              # Filter lines with malloc.  This is an artifact of memory testing
-              # with the Mac testbed
-                if ( !m/\*\*\*\smalloc/ ) {
-                    print MODFILE ($_);
-                    print MODFILE2 ($_) if $resetStderr;
-                }
-            }
-
-            # Close mod file
-            close(MODFILE);
-            close(MODFILE2) if $resetStderr;
-
-            # Close STDERR file
-            close(OUTFILE);
-
-            # Compare STDOUT capture with verified file
-            $exitValue |= &compareStream("verified/$testFile.stdout");
-
-            # Check exit value to determine if verified file doesn't exist
-            if ( $exitValue & 2 ) {
-
-                # STDOUT verified doesn't exist.  Search STDOUT capture
-                # for strings indicating error or failure
-                $exitValue |= &errorStrSearch("$testFile.stdout");
-            }
-
-            # Compare STDERR capture with verified file
-            $exitValue |= &compareStream("verified/$testFile.stderr");
-
-            # Check exit value to determine if verified file doesn't exist
-            if ( $exitValue & 4 ) {
-
-                # STDERR verified doesn't exist.  Search STDERR capture
-                # for strings indicating error or failure
-                $exitValue |= &errorStrSearch("$testFile.stderr");
-            }
-        }
-    }
+                print("Failed - Test Driver returned $?, expected abort.\n");
+            }
+            $exitValue |= 64;
+        }
+
+        # Test driver succeeded.
+
+        # Create filtered version of stdout and stderr
+
+        # Open the STDOUT file for reading
+        open( OUTFILE, "< temp/$testFile.stdout" );
+
+        # Open mod file to place filtered STDOUT
+        open( MODFILE,  "> temp/$testFile.stdout.mod" );
+        open( MODFILE2, "> $verifiedDir/$testFile.stdout" ) if $resetStdout;
+
+        # Replace the variable date, time and host information with constants
+        $hostname = `hostname`;
+        chop $hostname;
+        while (<OUTFILE>) {
+            s/\s+\d+:\d+:\d+\w/<TIME>/g;
+            s/\d+:\d+:\d+/<DATE>/g;
+            s/$hostname\s*/<HOST>/g;
+            s/: Line \d+/: Line <LINENO>/g;
+            s/\(.*\:\d+\)/\(FILE\:LINENO\)/g;
+            s/\s+[\_\-\/\.\w]+\:\d+/ FILE\:LINENO/g;
+            s/allocate \d+ bytes at/allocate <N> bytes at/g;
+            s/v\d+.\d+.\d+/vX.X.X/g;
+
+            # Filter lines with malloc.  This is an artifact of memory testing
+            # with the Mac testbed
+            if ( !m/\*\*\*\smalloc/ ) {
+                print MODFILE ($_);
+                print MODFILE2 ($_) if $resetStdout;
+            }
+        }
+
+        # Close mod file
+        close(MODFILE);
+        close(MODFILE2) if $resetStdout;
+
+        # Close STDERR file
+        close(OUTFILE);
+
+        # Open the STDERR file for reading
+        open( OUTFILE, "< temp/$testFile.stderr" );
+
+        # Open mod file to place filtered STDERR
+        open( MODFILE,  "> temp/$testFile.stderr.mod" );
+        open( MODFILE2, "> $verifiedDir/$testFile.stderr" ) if $resetStderr;
+
+        # Replace the variable date, time and host information with constants
+        while (<OUTFILE>) {
+            s/\s+\d+:\d+:\d+\w/<TIME>/g;
+            s/\d+:\d+:\d+/<DATE>/g;
+            s/$hostname\s*/<HOST>/g;
+            s/: Line \d+/: Line <LINENO>/g;
+            s/\(.*\:\d+\)/\(FILE\:LINENO\)/g;
+            s/\s+[\_\-\/\.\w]+\:\d+/ FILE\:LINENO/g;
+            s/allocate \d+ bytes at/allocate <N> bytes at/g;
+            s/v\d+.\d+.\d+/vX.X.X/g;
+
+            # Filter lines with malloc.  This is an artifact of memory testing
+            # with the Mac testbed
+            if ( !m/\*\*\*\smalloc/ ) {
+                print MODFILE ($_);
+                print MODFILE2 ($_) if $resetStderr;
+            }
+        }
+
+        # Close mod file
+        close(MODFILE);
+        close(MODFILE2) if $resetStderr;
+
+        # Close STDERR file
+        close(OUTFILE);
+
+        # Compare STDOUT capture with verified file
+        $exitValue |= &compareStream("$verifiedDir/$testFile.stdout");
+
+        # Check exit value to determine if verified file doesn't exist
+        if ( $exitValue & 2 ) {
+
+            # STDOUT verified doesn't exist.  Search STDOUT capture
+            # for strings indicating error or failure
+            $exitValue |= &errorStrSearch("$testFile.stdout");
+        }
+
+        # Compare STDERR capture with verified file
+        $exitValue |= &compareStream("$verifiedDir/$testFile.stderr");
+
+        # Check exit value to determine if verified file doesn't exist
+        if ( $exitValue & 4 ) {
+
+            # STDERR verified doesn't exist.  Search STDERR capture
+            # for strings indicating error or failure
+            $exitValue |= &errorStrSearch("$testFile.stderr");
+        }
+   }
     else {
 
@@ -320,6 +305,4 @@
 #
 #      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
@@ -333,18 +316,5 @@
 
     # Check for existence of verified STD stream files
-    if ( !( -e $streamFile ) ) {
-
-        # Display message to user that verified STDOUT file doesn't exist
-        print("        File $streamFile doesn't exist.\n");
-
-        # Set exit value bit 1 to indicate proper failure
-        if ( $streamFile =~ /out$/ ) {
-            $returnVal |= 2;
-        }
-        elsif ( $streamFile =~ /err$/ ) {
-            $returnVal |= 4;
-        }
-    }
-    else {
+    if ( -e $streamFile ) {
 
         # Verified STD stream file exists
@@ -352,5 +322,5 @@
         # Create name of the temp file to compare
         $tempFile = $streamFile;
-        $tempFile =~ s/verified/temp/;
+        $tempFile =~ s/$verifiedDir/temp/;
         $tempFile = $tempFile . ".mod";
 
