Index: /trunk/psLib/test/FullUnitTest
===================================================================
--- /trunk/psLib/test/FullUnitTest	(revision 1489)
+++ /trunk/psLib/test/FullUnitTest	(revision 1490)
@@ -19,6 +19,6 @@
 #  RETURN : integer number of tests which failed
 #
-#  $Revision: 1.11 $  $Name: not supported by cvs2svn $
-#  $Date: 2004-08-06 21:50:13 $
+#  $Revision: 1.12 $  $Name: not supported by cvs2svn $
+#  $Date: 2004-08-11 23:42:49 $
 #
 #  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -35,18 +35,23 @@
 # The ! option allows for --nooption to be set to zero
 # (e.g. --noverbose --recursive causes $verbose=0 and $recursive=1)
-GetOptions("verbose!"=>\$verbose,
-           "recursive!"=>\$recursive,
-           "silent!"=>\$silent,
-           "clean!"=>\$clean);
+GetOptions(
+    "verbose!"   => \$verbose,
+    "recursive!" => \$recursive,
+    "silent!"    => \$silent,
+    "clean!"     => \$clean
+);
 
 # Check if both silent and verbose options are set and if so stop the script
-die "Can't specify both verbose and silent options." if ($verbose && $silent);
+die "Can't specify both verbose and silent options." if ( $verbose && $silent );
 
 # Set up the PSLIB_ROOT environment variable if the user doesn't have
-if (! $ENV{'PSLIB_ROOT'})  {
+if ( !$ENV{'PSLIB_ROOT'} ) {
+
     # Use the directory directly above where FullUnitTest script resides
     $PSLIB_ROOT = `cd ..;pwd`;
+
     # Remove newline for the end of path returned
     chomp($PSLIB_ROOT);
+
     # Set the environment variable
     $ENV{'PSLIB_ROOT'} = $PSLIB_ROOT;
@@ -56,15 +61,15 @@
 # add PSLIB_ROOT/lib to LD_LIBRARY_PATH and DYLD_LIBRARY_PATH environment
 # variables
-$ENV{'LD_LIBRARY_PATH'} = "$ENV{'PSLIB_ROOT'}/lib:$ENV{'LD_LIBRARY_PATH'}";
+$ENV{'LD_LIBRARY_PATH'}   = "$ENV{'PSLIB_ROOT'}/lib:$ENV{'LD_LIBRARY_PATH'}";
 $ENV{'DYLD_LIBRARY_PATH'} = "$ENV{'PSLIB_ROOT'}/lib:$ENV{'DYLD_LIBRARY_PATH'}";
 
 # Initialize variables for counting the makes and test failures and the
 # total makes and tests performed
-$makeFailCount = 0;
-$testpointFailCount = 0;
+$makeFailCount       = 0;
+$testpointFailCount  = 0;
 $testDriverFailCount = 0;
-$totalTestpoints = 0;
-$totalTestDrivers = 0;
-$totalMakes = 0;
+$totalTestpoints     = 0;
+$totalTestDrivers    = 0;
+$totalMakes          = 0;
 
 # Initialize variable indicating how many arguements were passed
@@ -73,22 +78,31 @@
 # Loop through all the arguements passed to the script
 foreach (@ARGV) {
+
     # Remove newline if there is one
     chomp;
+
     # Increment number of arguements found
     $args++;
+
     # Set variable to current working directory
     $cwd = cwd;
+
     # Change directory to the directory of the arguement
     chdir($_);
+
     # Check for the recursive option
     if ($recursive) {
+
         # Invoke subroutine to go to the lowest directory in tree
         # starting at the specified directory
         &worm($_);
-    } else {
+    }
+    else {
+
         # Invoke subroutines to run the test at the specified directory
         &makeTestDrivers($_);
         &executeTestDrivers($_);
     }
+
     # Change directory back to the directory where FullUnitTest was invoked
     chdir($cwd);
@@ -96,23 +110,28 @@
 
 # Check if there were no arguements specified
-if ($args == 0){
+if ( $args == 0 ) {
+
     # Display message to user that all directories under the current will be
     # tested
     print("Recursively testing current directory tree.\n") if $verbose;
+
     # Invoke subroutine to go to recursively test each directory in tree
-    &worm($ENV{"PWD"});
+    &worm( $ENV{"PWD"} );
 }
 
 # Check if there were any failures during make or testing
-if ($makeFailCount>0 || $testDriverFailCount>0) {
+if ( $makeFailCount > 0 || $testDriverFailCount > 0 ) {
+
     # Display summary of failures
     print("\nMake Failures = $makeFailCount out of $totalMakes");
     print("\nTest Driver Failures = $testDriverFailCount out of $totalTestDrivers\n");
-    print("\nMakes that failed:\n  ".join("\n  ",@makesFailed) . "\n") if $makeFailCount;
-    print("\nTests that failed:\n  ".join("\n  ",@testsFailed) . "\n") if $testDriverFailCount;
-} else {
+    print( "\nMakes that failed:\n  " . join( "\n  ", @makesFailed ) . "\n" ) if $makeFailCount;
+    print( "\nTests that failed:\n  " . join( "\n  ", @testsFailed ) . "\n" ) if $testDriverFailCount;
+}
+else {
+
     # Display message of all makes and tests pass to user if silent option
     # not specified
-    print("\nAll $totalTestDrivers Test Drivers Passed with $totalTestpoints Testpoints.\n") if (! $silent);
+    print("\nAll $totalTestDrivers Test Drivers Passed with $totalTestpoints Testpoints.\n") if ( !$silent );
 }
 
@@ -120,5 +139,4 @@
 exit($testDriverFailCount);
 
-
 ################################################################################
 #
@@ -127,5 +145,5 @@
 #     Description:  This subroutine will perform the necessary unit tests be
 #                   calling makeTestDrivers and executeTestDrivers  subroutines
-#                   and then check each subdirectory below the base directory 
+#                   and then check each subdirectory below the base directory
 #                   recursively.
 #
@@ -137,7 +155,8 @@
 
 sub worm {
+
     # Assign local variable to input parameter
-    local($base_dir) = @_;
-    local(@files, $i);
+    local ($base_dir) = @_;
+    local ( @files, $i );
 
     # Invoke subroutine to make test driver in the base directory
@@ -153,15 +172,23 @@
     # labelled CVS and recursively invoke subroutine worm
     $i = 0;
-    while ($files[$i]) {
+    while ( $files[$i] ) {
+
         # Check for directory and directory not labelled CVS
-        if (-d $files[$i] && ($files[$i] ne "CVS") && ($files[$i] ne "temp")
-                          && ($files[$i] ne "verified")) {
+        if (   -d $files[$i]
+            && ( $files[$i] ne "CVS" )
+            && ( $files[$i] ne "temp" )
+            && ( $files[$i] ne "verified" ) )
+        {
+
             # Change current directory to directory found
-            chdir($files[$i]);
+            chdir( $files[$i] );
+
             # Invoke subroutine worm again
-            &worm($files[$i]);
+            &worm( $files[$i] );
+
             # Change current directory back to parent
             chdir("..");
         }
+
         # Increment file list index
         $i++;
@@ -183,7 +210,7 @@
 ################################################################################
 
-sub makeTestDrivers{
-    local($base_dir) = @_;
-    local($pwd);
+sub makeTestDrivers {
+    local ($base_dir) = @_;
+    local ($pwd);
 
     # Set variable pwd to current working directory
@@ -192,13 +219,14 @@
     # Display message to user in which directory testing is taken place only
     # if the silent command option was not specified
-    print("---- Entering $pwd ----\n") if ( ! $silent);
+    print("---- Entering $pwd ----\n") if ( !$silent );
 
     # Check for the existence of a file name Makefile in current directory
-    if (-e "Makefile") {
+    if ( -e "Makefile" ) {
 
         # Increment the total number of makes executed
         $totalMakes++;
 
-        if ($clean) { 
+        if ($clean) {
+
             # Execute the make clean
             `make clean`;
@@ -209,24 +237,36 @@
 
         # Execute the make and save results
-        $_ = join("\n|| ",split("\n", "\n" . `make`) );
+        $_ = join( "\n|| ", split( "\n", "\n" . `make` ) );
 
         # Check the output of make for return value != 0 or any of the
         # following words: FAILED, FAULT, ERROR, Not found, SIGNAL
-        if (($? != 0) || m/FAILED/i || m/FAULT/i || m/\bERROR/i
-                      || m/Not found/i || m/SIGNAL/i) {
+        if (   ( $? != 0 )
+            || m/FAILED/i
+            || m/FAULT/i
+            || m/\bERROR/i
+            || m/Not found/i
+            || m/SIGNAL/i )
+        {
+
             # Display the errored output of make if silent option not enabled
-            print("$_\n") if ( ! $silent );
+            print("$_\n") if ( !$silent );
+
             # Display the make failed in the current directory
             print("\nMake for $pwd Failed\n");
+
             # Increment the number of makes that have failed
             $makeFailCount++;
+
             # Push the current working directory onto the list of failed
             # make directories list
-            push(@makesFailed, $pwd);
-        } else {
+            push( @makesFailed, $pwd );
+        }
+        else {
+
             # Display the results of the successful make if verbose option set
             print("$_\n") if $verbose;
+
             # Display the make was successful if silent option not set
-            print("\nMake successful.\n") if ( ! $silent);
+            print("\nMake successful.\n") if ( !$silent );
             if ($clean) {
                 `make install`;
@@ -248,9 +288,9 @@
 ################################################################################
 
-sub executeTestDrivers{
-    local($base_dir) = @_;
-    local(@files,$j);
-    local($pwd);
-    local($exitValue) = 0;
+sub executeTestDrivers {
+    local ($base_dir) = @_;
+    local ( @files, $j );
+    local ($pwd);
+    local ($exitValue) = 0;
 
     # Set variable to pwd to current test directory
@@ -262,10 +302,13 @@
     # Loop through all the items in the files array
     $initialTest = 0;
-    $j = 0;
-    while ( $files[$j]) {
+    $j           = 0;
+    while ( $files[$j] ) {
+
         # Check that the item is not a directory and is executable and
         # conforms to the test driver naming convention TST
-        if ( ! (-d $files[$j]) && (-x $files[$j]) && 
-             ( $files[$j] =~ /^TST/i || $files[$j] =~ /^ATST/i ) ) {
+        if (   !( -d $files[$j] )
+            && ( -x $files[$j] )
+            && ( $files[$j] =~ /^TST/i || $files[$j] =~ /^ATST/i ) )
+        {
 
             # Increment total number of test drivers executed
@@ -283,74 +326,96 @@
                 # Check for the presence of verified directory
                 if ( &checkForVerifiedDirectory() ) {
-            
-                    # Display message to user that verified directories do not 
+
+                    # 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("Unable to execute test drivers in $base_dir\n");
                     print("No verified subdirectory present.\n") if ($verbose);
+
                     # Increment test fail count
- #                   $testDriverFailCount++;
+                    #                   $testDriverFailCount++;
                     # Save the file failed
-#                    push(@testsFailed, $pwd . "/" . $files[$j]);
-#                    return;
+                    #                    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 );
+            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");
             $retVal = $?;
+
             # Count testpoints
-	    $testPattern = "\"\\*\\*\\*\\* TESTPOINT \\*\\*\\*\\*\"";
+            $testPattern = "\"\\*\\*\\*\\* TESTPOINT \\*\\*\\*\\*\"";
             $totalPoints = `grep -c $testPattern temp/$files[$j].stdout`;
             $totalPoints += `grep -c $testPattern temp/$files[$j].stderr`;
             $failPoints = `grep "> TESTPOINT FAILED" temp/$files[$j].stdout | wc -l`;
-            $failPoints += `grep "> TESTPOINT FAILED" temp/$files[$j].stderr | wc -l`;
+            $failPoints         += `grep "> TESTPOINT FAILED" temp/$files[$j].stderr | wc -l`;
             $testpointFailCount += $failPoints;
-            $totalTestpoints += $totalPoints;
+            $totalTestpoints    += $totalPoints;
+
             # Check result of test driver
-            if ( ( ($retVal != 0) && ($files[$j] =~ /^TST/i) ) ||
-                 ( ($retVal == 0) && ($files[$j] =~ /^ATST/i ) ) ) {
+            if (   ( ( $retVal != 0 ) && ( $files[$j] =~ /^TST/i ) )
+                || ( ( $retVal == 0 ) && ( $files[$j] =~ /^ATST/i ) ) )
+            {
+
                 # Display test driver failed
                 $failPoints++;
                 print("Test driver: $files[$j] Failed (Return value $retVal).\n");
+
                 # Increment the total number of test failed
                 $testDriverFailCount++;
+
                 # Push the current working directory on the list of failed
-                push(@testsFailed, $pwd . "/" . $files[$j]);
-            } else {
+                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]);
+                &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) ) {
+                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 {
+                    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) ) {
+                    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);
+                        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 );
                     }
                 }
@@ -378,20 +443,27 @@
 
 sub errorStrSearch {
-    local($fileName) = @_;
-    local($returnVal) = 0;
+    local ($fileName)  = @_;
+    local ($returnVal) = 0;
 
     # Open the captured file
-    open(CAPT_FILE, "<temp/$fileName");
+    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 ) {
+    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/ ) {
+            }
+            elsif ( $fileName =~ m/err/ ) {
                 print("        Failed - File $fileName contains error strings.\n");
                 $returnVal = 128;
@@ -400,8 +472,10 @@
         }
     }
+
     # Close the capture file
     close(CAPT_FILE);
+
     # Return the return value
-    return($returnVal);
+    return ($returnVal);
 }
 
@@ -424,10 +498,10 @@
 
 sub compareStream {
-    local($streamFile) = @_;
-    local($returnVal) = 0;
-    local($tempFile) = "";
+    local ($streamFile) = @_;
+    local ($returnVal)  = 0;
+    local ($tempFile)   = "";
 
     # Check for existence of verified STD stream files
-    if ( !( -e $streamFile) ) {
+    if ( !( -e $streamFile ) ) {
 
         # Display message to user that verified STDOUT file doesn't exist
@@ -437,8 +511,10 @@
         if ( $streamFile =~ /out$/ ) {
             $returnVal |= 2;
-        } elsif ( $streamFile =~ /err$/ ) {
+        }
+        elsif ( $streamFile =~ /err$/ ) {
             $returnVal |= 4;
         }
-    } else {
+    }
+    else {
 
         # Verified STD stream file exists
@@ -459,15 +535,18 @@
             # 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;
+
+                # 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;
             }
         }
@@ -475,7 +554,6 @@
 
     # Return the result of the compare
-    return($returnVal);
-}
-
+    return ($returnVal);
+}
 
 ################################################################################
@@ -493,12 +571,14 @@
 ################################################################################
 
-sub checkForTempDirectory{
+sub checkForTempDirectory {
 
     # Check if a temp directory already exists in the current work directory
-    if ( !( -e "temp" )) {
+    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 );
+        print("Creating temp directory\n") if ($verbose);
     }
 }
@@ -519,12 +599,14 @@
 ################################################################################
 
-sub checkForVerifiedDirectory{
+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);
+    if ( !( -e "verified" ) ) {
+
+        # Set return value to 1
+        $returnValue = 1;
+    }
+    return ($returnValue);
 }
 
@@ -543,53 +625,63 @@
 ################################################################################
 
-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/<HOST>/g;
-       s/: Line \d+/: Line <LINENO>/g;
-       s/\:\d+/\:<LINENO>/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/<HOST>/g;
-       s/: Line \d+/: Line <LINENO>/g;
-       s/\:\d+/\:<LINENO>/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);
-}
-
+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/<HOST>/g;
+        s/: Line \d+/: Line <LINENO>/g;
+        s/\:\d+/\:<LINENO>/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/<HOST>/g;
+        s/: Line \d+/: Line <LINENO>/g;
+        s/\:\d+/\:<LINENO>/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);
+}
+
Index: /trunk/psLib/test/runTest
===================================================================
--- /trunk/psLib/test/runTest	(revision 1489)
+++ /trunk/psLib/test/runTest	(revision 1490)
@@ -6,9 +6,9 @@
 #  deemed a failure.  STDOUT and STDERR files will be place in a subdirectory
 #  named temp and the files will be compared with verified STDOUT, STDERR files
-#  in a subdirectory named verified.  If there are no STDOUT, STDERR files in 
+#  in a subdirectory named verified.  If there are no STDOUT, STDERR files in
 #  the verified directory, the captured STDOUT, STDERR files will be scanned
 #  for words which indicate a failure.
 #
-#  Assumptions:  A verified subdirectory with STDOUT, STDERR files exists for 
+#  Assumptions:  A verified subdirectory with STDOUT, STDERR files exists for
 #                the test driver specified in the arguements if an exact
 #                match of the streams STDOUT, STDERR is necessary.
@@ -30,5 +30,5 @@
 #
 #  $Revison:  $  $Name: not supported by cvs2svn $
-#  $Date: 2004-08-06 21:50:13 $
+#  $Date: 2004-08-11 23:42:49 $
 #
 #  Copyright 2004 Maui High Performance Computering Center, University of Hawaii
@@ -40,8 +40,10 @@
 
 # Assign variables based on the presence of command line options to the script
-GetOptions("reset!"=>\$reset,
-           "resetStderr!"=>\$resetStderr,
-           "resetStdout!"=>\$resetStdout,
-           "help!"=>\$help);
+GetOptions(
+    "reset!"       => \$reset,
+    "resetStderr!" => \$resetStderr,
+    "resetStdout!" => \$resetStdout,
+    "help!"        => \$help
+);
 
 if ($help) {
@@ -54,22 +56,26 @@
     $resetStdout = 1;
 }
-    
+
 # Initialize exit value
 $exitValue = 0;
 
 # Set up the PSLIB_ROOT environment variable if the user doesn't have it set
-if ( ! $ENV{'PSLIB_ROOT'}) {
+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 
+
+    # 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{'LD_LIBRARY_PATH'}   = "$ENV{'PSLIB_ROOT'}/lib:$ENV{'LD_LIBRARY_PATH'}";
 $ENV{'DYLD_LIBRARY_PATH'} = "$ENV{'PSLIB_ROOT'}/lib:$ENV{'DYLD_LIBRARY_PATH'}";
 
@@ -80,57 +86,66 @@
 
     # 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");
-    }
-    
+    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");
+    }
+
     # Check if a verified directory exists in the current work directory
-    if ( !( -e "verified" )) {
+    if ( !( -e "verified" ) ) {
+
         # Display message that verified subdirectory doesn't exist
         print("        Verified directory doesn't exist.\n");
+
         # Exit script since the test cannot be run with verified files
         $exitValue = 1;
     }
-    
+
     # Check if the test driver file exists and is executable
-    if ( (-e $testFile) && (-x $testFile) ) {
-    
+    if ( ( -e $testFile ) && ( -x $testFile ) ) {
+
         # Display message the test driver is being executed
         print("--- Executing test driver: $testFile\n");
-    
+
         # Invoke the test driver
         system("./$testFile 1> temp/$testFile.stdout 2> temp/$testFile.stderr");
-        
+
         # Check the return value of the test driver.  A value other than 0
         # indicates failure of the test driver unless the test driver is name
         # with a leading 'a' which indicates the test driver is expecting an
         # abort condition to terminate the driver.
-        if ( ( $? != 0  && ( $testFile !~ /^A/i)) || 
-            ( $? == 0  && ( $testFile =~ /^A/i)) ) {
-    
+        if (   ( $? != 0 && ( $testFile !~ /^A/i ) )
+            || ( $? == 0 && ( $testFile =~ /^A/i ) ) )
+        {
+
             # Display failure message with return value to user
-            if ( $? != 0 && ( $testFile !~ /^A/i) ) {
+            if ( $? != 0 && ( $testFile !~ /^A/i ) ) {
                 print("        Failed - Test Driver expected 0 return value (Return value $?)\n");
-            } elsif ( $? == 0 && ( $testFile =~ /^A/i) ) {
+            }
+            elsif ( $? == 0 && ( $testFile =~ /^A/i ) ) {
                 print("        Failed - Test Driver expected abort (Return value $?)\n");
             }
             $exitValue |= 256;
-        } else {
-    
+        }
+        else {
+
             # Test driver succeeded.
-    
+
             # Create filtered version of stdout and stderr
-                
-            # Open the STDOUT file for reading       
-            open(OUTFILE, "< temp/$testFile.stdout");
+
+            # 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;
+            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> ) {
+            while (<OUTFILE>) {
                 s/\s+\d+:\d+:\d+\w/<TIME>/g;
                 s/\d+:\d+:\d+/<DATE>/g;
@@ -138,24 +153,29 @@
                 s/: Line \d+/: Line <LINENO>/g;
                 s/\:\d+/\:<LINENO>/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;
+                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 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;
+            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> ) {
+            while (<OUTFILE>) {
                 s/\s+\d+:\d+:\d+\w/<TIME>/g;
                 s/\d+:\d+:\d+/<DATE>/g;
@@ -163,34 +183,37 @@
                 s/: Line \d+/: Line <LINENO>/g;
                 s/\:\d+/\:<LINENO>/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;
+                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
@@ -198,9 +221,11 @@
             }
         }
-    } else {
-        # Since test driver doesn't exist or is not executable then display 
+    }
+    else {
+
+        # 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");
-        
+
         # Exit value set to indicate test driver doesn't exist or not executable
         $exitValue |= 32;
@@ -211,7 +236,8 @@
 # Ignore the first three bit flags in exitValue since there are not indicators
 # of a failed test
-if ( ($exitValue >> 3) != 0 ) {
+if ( ( $exitValue >> 3 ) != 0 ) {
     print("Test failed - return status = $exitValue\n\n");
-} else {
+}
+else {
     print("Test successful\n\n");
 }
@@ -235,19 +261,26 @@
 
 sub errorStrSearch {
-    local($fileName) = @_;
-    local($returnVal) = 0;
+    local ($fileName)  = @_;
+    local ($returnVal) = 0;
 
     # Open the captured file
-    open(CAPT_FILE, "<temp/$fileName");
+    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 ) {
+    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 )
+        {
             if ( $fileName =~ m/out/ ) {
                 print("        Failed - File $fileName contains error strings.\n");
                 $returnVal = 64;
-            } elsif ( $fileName =~ m/err/ ) {
+            }
+            elsif ( $fileName =~ m/err/ ) {
                 print("        Failed - File $fileName contains error strings.\n");
                 $returnVal = 128;
@@ -256,8 +289,10 @@
         }
     }
+
     # Close the capture file
     close(CAPT_FILE);
+
     # Return the return value
-    return($returnVal);
+    return ($returnVal);
 }
 
@@ -280,29 +315,31 @@
 
 sub compareStream {
-    local($streamFile) = @_;
-    local($returnVal) = 0;
-    local($tempFile) = "";
+    local ($streamFile) = @_;
+    local ($returnVal)  = 0;
+    local ($tempFile)   = "";
 
     # Check for existence of verified STD stream files
-    if ( !( -e $streamFile) ) {
-            
+    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$/ ) {
+        }
+        elsif ( $streamFile =~ /err$/ ) {
             $returnVal |= 4;
         }
-    } else {
+    }
+    else {
 
         # Verified STD stream file exists
 
         # Create name of the temp file to compare
-        $tempFile = $streamFile; 
+        $tempFile = $streamFile;
         $tempFile =~ s/verified/temp/;
         $tempFile = $tempFile . ".mod";
-   
+
         # Perform difference on the STD stream files
         $diffstdout = `diff $streamFile $tempFile`;
@@ -310,26 +347,29 @@
         # 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;
-            }
-        }
-    }
-    
+
+                # 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);
-}
-
+    return ($returnVal);
+}
+
