Index: trunk/psModules/test/FullUnitTest
===================================================================
--- trunk/psModules/test/FullUnitTest	(revision 3623)
+++ trunk/psModules/test/FullUnitTest	(revision 3696)
@@ -19,10 +19,14 @@
 #  RETURN : integer number of tests which failed
 #
-#  $Revision: 1.2 $  $Name: not supported by cvs2svn $
-#  $Date: 2005-04-01 20:11:19 $
+#  $Revision: 1.3 $  $Name: not supported by cvs2svn $
+#  $Date: 2005-04-12 21:51:00 $
 #
 #  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
 #
 ##############################################################################
+
+use FindBin qw($Bin);
+
+$runTest = "$Bin/runTest";
 
 # Provide functions for determining the pathname of current working directory
@@ -311,36 +315,15 @@
             $totalTestDrivers++;
 
-            # Perform subdirectory checks only the first time a test
-            # file is found with the list of enteries
-            if ( $initialTest == 0 ) {
-                $initialTest++;
-
-                # Check for a temp subdirectory already exists and if not
-                # then create one
-                &checkForTempDirectory();
-
-                # Check for the presence of verified directory
-                if ( &checkForVerifiedDirectory() ) {
-
-    # Display message to user that verified directories do not
-    # exist eventhough TST files have been found
-    #                    print("Unable to execute test drivers in $base_dir\n");
-                    print("No verified subdirectory present.\n") if ($verbose);
-
-               # Increment test fail count
-               #                   $testDriverFailCount++;
-               # Save the file failed
-               #                    push(@testsFailed, $pwd . "/" . $files[$j]);
-               #                    return;
-                }
-            }
-
             # Display message to user of which test driver is being executed
             print("--- Executing test driver $files[$j]\n") if ( !$silent );
 
             # Execute the test driver
-            system(
-"./$files[$j] 1> temp/$files[$j].stdout 2> temp/$files[$j].stderr"
-            );
+            if ($silent) {
+                system("$runTest --quiet ./$files[$j]");
+            } elsif ($verbose) {
+                system("$runTest --printpassfail ./$files[$j]");
+            } else {
+                system("$runTest ./$files[$j]");
+            }
             $retVal = $?;
 
@@ -357,6 +340,5 @@
 
             # Check result of test driver
-            if (   ( ( $retVal != 0 ) && ( $files[$j] =~ /^TST/i ) )
-                || ( ( $retVal == 0 ) && ( $files[$j] =~ /^ATST/i ) ) )
+            if ( $retVal != 0 )
             {
 
@@ -372,59 +354,4 @@
                 push( @testsFailed, $pwd . "/" . $files[$j] );
             }
-            else {
-
-               # Create filter versions of STDOUT and STDERR to replace variable
-               # items such as date, time and host
-                &filterStdFiles( $files[$j] );
-
-                # Perform difference on STDOUT file collected
-                # with verified files
-                $exitValue = &compareStream("verified/$files[$j].stdout");
-                if ( $exitValue & 2 ) {
-
-                    # STDOUT verified doesn't exist. Search STDOUT capture
-                    # for strings indicating error or failure
-                    $exitValue |= &errorStrSearch("$files[$j].stdout");
-                }
-                if ( ( $exitValue & 8 ) || ( $exitValue & 64 ) ) {
-
-                    # Increment the total number of test failed
-                    $testDriverFailCount++;
-
-                    # Push test on failed list
-                    print(
-"Test failed ($failPoints out of $totalPoints testpoints failed)\n"
-                      )
-                      if ( !$silent );
-                    push( @testsFailed, $pwd . "/" . $files[$j] );
-                }
-                else {
-
-                    # Perform difference on STDERR file collection with verified
-                    $exitValue = &compareStream("verified/$files[$j].stderr");
-                    if ( $exitValue & 4 ) {
-
-                        # STDERR verified doesn't exist. Search STDERR capture
-                        # for strings indicating error or failure
-                        $exitValue |= &errorStrSearch("$files[$j].stderr");
-                    }
-                    if ( ( $exitValue & 16 ) || ( $exitValue & 128 ) ) {
-
-                        # Increment the total number of tests failed
-                        $testDriverFailCount++;
-
-                        # Push test on failed list
-                        print(
-"Test failed ($failPoints out of $totalPoints testpoints failed)\n"
-                          )
-                          if ( !$silent );
-                        push( @testsFailed, $pwd . "/" . $files[$j] );
-                    }
-                    else {
-                        print("Test successful ($totalPoints testpoints)\n")
-                          if ( !$silent );
-                    }
-                }
-            }
         }
         $j++;
@@ -432,272 +359,2 @@
 }
 
-################################################################################
-#
-#  SUBROUTINE: errorStrSearch
-#
-#      Description:  This subroutine will search the file specified in its
-#                    parameter for error strings and if they do exists
-#                    the appropriate value will be returned.
-#
-#      Parameter(s): fileName - input file to search for strings
-#
-#      Return:   0  -  No error strings found
-#               64  -  Error strings found in STDOUT
-#              128  -  Error strings found in STDERR
-#
-###############################################################################
-
-sub errorStrSearch {
-    local ($fileName)  = @_;
-    local ($returnVal) = 0;
-
-    # Open the captured file
-    open( CAPT_FILE, "<temp/$fileName" );
-
-    # Scan through all the lines of the file searching for error strings
-    while (<CAPT_FILE>) {
-        if (   m/FAIL/i
-            || m/FAULT/i
-            || m/ERROR/i
-            || m/Not Found/i
-            || m/SIGNAL/i
-            || m/NO SUCH FILE/i
-            || m/\|E\|/i
-            || m/\|A\|/i )
-        {
-            print;
-            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;
-            }
-            last;
-        }
-    }
-
-    # Close the capture file
-    close(CAPT_FILE);
-
-    # Return the return value
-    return ($returnVal);
-}
-
-################################################################################
-#
-#  SUBROUTINE: compareStream
-#
-#      Description:  This subroutine will compare the captured stream file with
-#                    a file in the verified directory if one exists.
-#
-#      Parameter(s): streamFile - input file to compare
-#
-#      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
-#
-###############################################################################
-
-sub compareStream {
-    local ($streamFile) = @_;
-    local ($returnVal)  = 0;
-    local ($tempFile)   = "";
-
-    # 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") if ($verbose);
-
-        # 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
-
-        # Create name of the temp file to compare
-        $tempFile = $streamFile;
-        $tempFile =~ s/verified/temp/;
-        $tempFile = $tempFile . ".mod";
-
-        # Perform difference on the STD stream files
-        $diffstdout = `diff $streamFile $tempFile`;
-
-        # Check the return value of the difference
-        if ( $? != 0 ) {
-
-            # Difference of STD stream files failed
-
-            # Check for STDOUT in file name to convey appropirate return value
-            if ( $streamFile =~ /out$/ ) {
-
-                # Display message of the failure of difference to user
-                print("        Failed - STDOUT difference\n$diffstdout\n");
-
-                # Exit value to indicate STDOUT did not compare
-                $returnVal |= 8;
-            }
-            elsif ( $streamFile =~ /err$/ ) {
-
-                # Display message of the failure of difference to user
-                print("        Failed - STDERR difference\n$diffstdout\n");
-
-                # Exit value to indicate STDERR did not compare
-                $returnVal |= 16;
-            }
-        }
-    }
-
-    # Return the result of the compare
-    return ($returnVal);
-}
-
-################################################################################
-#
-#  SUBROUTINE: checkForTempDirectory
-#
-#      Description:  This subroutine will check for the existence of a temp
-#                    directory to store STDOUT, STDERR files during test.  If
-#                    the subdirectory doesn't exist, it will be created.
-#
-#      Parameter(s):  None
-#
-#      Return: None
-#
-################################################################################
-
-sub checkForTempDirectory {
-
-    # 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
-        `mkdir temp`;
-
-        # Display message of new directory created
-        print("Creating temp directory\n") if ($verbose);
-    }
-}
-
-################################################################################
-#
-#  SUBROUTINE: checkForVerifiedDirectory
-#
-#      Description:  This subroutine will check for the existence of a verified
-#                    directory which stores verified STDOUT, STDERR files for
-#                    comparison during the test.
-#
-#      Parameter(s):  None
-#
-#      Return: 0 - subdirectory present
-#              1 - subdirectory not present
-#
-################################################################################
-
-sub checkForVerifiedDirectory {
-    $returnValue = 0;
-
-    # Check if verified subdirectory exists in the current working directory
-    if ( !( -e "verified" ) ) {
-
-        # Set return value to 1
-        $returnValue = 1;
-    }
-    return ($returnValue);
-}
-
-################################################################################
-#
-#  SUBROUTINE: filterStdFiles
-#
-#      Description:  This subroutine will filter variable items in the STDOUT
-#                    and STDERR files captured.  Date, time and host names
-#                    are variable items in the log messages captured.
-#
-#      Parameter(s):  test file name
-#
-#      Return: None
-#
-################################################################################
-
-sub filterStdFiles {
-
-    local ($fileName) = @_;
-
-    # Open the STDOUT file for reading
-    open( OUTFILE, "< temp/$fileName.stdout" );
-
-    # Open mod file to place filtered STDOUT
-    open( MODFILE, "> temp/$fileName.stdout.mod" );
-
-    # Replace the variable data, 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 Mac testing of
-        # memory functions
-        if ( !m/\*\*\*\smalloc/ ) {
-            print MODFILE ($_);
-        }
-    }
-
-    # Close mod file
-    close(MODFILE);
-
-    # Close STDERR file
-    close(OUTFILE);
-
-    # Open the STDERR file for reading
-    open( OUTFILE, "< temp/$fileName.stderr" );
-
-    # Open mod file to place filtered STDERR
-    open( MODFILE, "> temp/$fileName.stderr.mod" );
-
-    # 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 Mac testing of
-        # memory functions
-        if ( !m/\*\*\*\smalloc/ ) {
-            print MODFILE ($_);
-        }
-    }
-
-    # Close mod file
-    close(MODFILE);
-
-    # Close STDERR file
-    close(OUTFILE);
-}
-
