Index: trunk/psLib/test/FullUnitTest
===================================================================
--- trunk/psLib/test/FullUnitTest	(revision 937)
+++ trunk/psLib/test/FullUnitTest	(revision 1034)
@@ -19,6 +19,6 @@
 #  RETURN : integer number of tests which failed
 #
-#  $Revision: 1.5 $  $Name: not supported by cvs2svn $
-#  $Date: 2004-06-08 23:50:56 $
+#  $Revision: 1.6 $  $Name: not supported by cvs2svn $
+#  $Date: 2004-06-15 00:13:57 $
 #
 #  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -37,5 +37,6 @@
 GetOptions("verbose!"=>\$verbose,
            "recursive!"=>\$recursive,
-           "silent!"=>\$silent);
+           "silent!"=>\$silent,
+           "clean!"=>\$clean);
 
 # Check if both silent and verbose options are set and if so stop the script
@@ -50,7 +51,5 @@
     # Set the environment variable
     $ENV{'PSLIB_ROOT'} = $PSLIB_ROOT;
-    if ($verbose) {
-        print("PSLIB_ROOT not found: set to $PSLIB_ROOT.\n");
-    }
+    print("PSLIB_ROOT not found: set to $PSLIB_ROOT.\n") if $verbose;
 }
 
@@ -63,6 +62,8 @@
 # total makes and tests performed
 $makeFailCount = 0;
-$testFailCount = 0;
-$totalTests = 0;
+$testpointFailCount = 0;
+$testDriverFailCount = 0;
+$totalTestpoints = 0;
+$totalTestDrivers = 0;
 $totalMakes = 0;
 
@@ -98,5 +99,5 @@
     # Display message to user that all directories under the current will be
     # tested
-    print("Recursively testing current directory tree.\n");
+    print("Recursively testing current directory tree.\n") if $verbose;
     # Invoke subroutine to go to recursively test each directory in tree
     &worm($ENV{"PWD"});
@@ -104,18 +105,18 @@
 
 # Check if there were any failures during make or testing
-if ($makeFailCount>0 || $testFailCount>0) {
+if ($makeFailCount>0 || $testDriverFailCount>0) {
     # Display summary of failures
     print("\nMake Failures = $makeFailCount out of $totalMakes");
-    print("\nTest Failures = $testFailCount out of $totalTests\n");
+    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 $testFailCount;
+    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 $totalTests Tests Passed.\n") if (! $silent);
+    print("\nAll $totalTestDrivers Test Drivers Passed with $totalTestpoints Testpoints.\n") if (! $silent);
 }
 
 # Exit with the number of tests that failed
-exit($testFailCount);
+exit($testDriverFailCount);
 
 
@@ -191,5 +192,5 @@
     # Display message to user in which directory testing is taken place only
     # if the silent command option was not specified
-    print("---- Testing: $pwd ----\n") if ( ! $silent);
+    print("---- Entering $pwd ----\n") if ( ! $silent);
 
     # Check for the existence of a file name Makefile in current directory
@@ -199,9 +200,11 @@
         $totalMakes++;
 
-        # Execute the make clean
-        `make clean`;
-
-        # Execute the make distclean
-        `make distclean`;
+        if ($clean) { 
+            # Execute the make clean
+            `make clean`;
+
+            # Execute the make distclean
+            `make distclean`;
+        }
 
         # Execute the make and save results
@@ -265,5 +268,5 @@
 
             # Increment total number of test drivers executed
-            $totalTests++;
+            $totalTestDrivers++;
 
             # Perform subdirectory checks only the first time a test
@@ -282,7 +285,7 @@
                     # exist eventhough TST files have been found
 #                    print("Unable to execute test drivers in $base_dir\n");
-                    print("No verified subdirectory present.\n");
+                    print("No verified subdirectory present.\n") if ($verbose);
                     # Increment test fail count
- #                   $testFailCount++;
+ #                   $testDriverFailCount++;
                     # Save the file failed
 #                    push(@testsFailed, $pwd . "/" . $files[$j]);
@@ -295,11 +298,20 @@
             # Execute the test driver
             system("./$files[$j] 1> temp/$files[$j].stdout 2> temp/$files[$j].stderr");
+            $retVal = $?;
+            # Count testpoints
+            $totalPoints = `grep -c '***** TESTPOINT *****' temp/$files[$j].stdout`;
+            $totalPoints += `grep -c '***** TESTPOINT *****' temp/$files[$j].stderr`;
+            $failPoints = `grep "> TESTPOINT FAILED" temp/$files[$j].stdout | wc -l`;
+            $failPoints += `grep "> TESTPOINT FAILED" temp/$files[$j].stderr | wc -l`;
+            $testpointFailCount += $failPoints;
+            $totalTestpoints += $totalPoints;
             # Check result of test driver
-            if ( ( ($? != 0) && ($files[$j] =~ /^TST/i) ) ||
-                 ( ($? == 0) && ($files[$j] =~ /^ATST/i ) ) ) {
+            if ( ( ($retVal != 0) && ($files[$j] =~ /^TST/i) ) ||
+                 ( ($retVal == 0) && ($files[$j] =~ /^ATST/i ) ) ) {
                 # Display test driver failed
-                print("Test driver: $files[$j] Failed (Return value $?).\n");
+                $failPoints++;
+                print("Test driver: $files[$j] Failed (Return value $retVal).\n");
                 # Increment the total number of test failed
-                $testFailCount++;
+                $testDriverFailCount++;
                 # Push the current working directory on the list of failed
                 push(@testsFailed, $pwd . "/" . $files[$j]);
@@ -318,6 +330,7 @@
                 if ( ($exitValue & 8) || ($exitValue & 64) ) {
                     # Increment the total number of test failed
-                    $testFailCount++;
+                    $testDriverFailCount++;
                     # Push test on failed list
+                    print("Test failed ($failPoints out of $totalPoints testpoints failed)\n") if ( ! $silent);
                     push(@testsFailed, $pwd . "/" . $files[$j]);
                 } else {
@@ -331,9 +344,10 @@
                     if ( ($exitValue & 16) || ($exitValue & 128) ) {
                         # Increment the total number of tests failed
-                        $testFailCount++;
+                        $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\n") if ( ! $silent);
+                       print("Test successful ($totalPoints testpoints)\n") if ( ! $silent);
                     }
                 }
@@ -414,5 +428,5 @@
 
         # Display message to user that verified STDOUT file doesn't exist
-        print("        File $streamFile doesn't exist.\n");
+        print("        File $streamFile doesn't exist.\n") if ($verbose);
 
         # Set exit value bit 1 to indicate proper failure
