Changeset 3696 for trunk/psModules/test/runTest
- Timestamp:
- Apr 12, 2005, 11:51:00 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psModules/test/runTest (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/test/runTest
r3630 r3696 26 26 # 27 27 # $Revison: $ $Name: not supported by cvs2svn $ 28 # $Date: 2005-04- 01 21:52:22$28 # $Date: 2005-04-12 21:51:00 $ 29 29 # 30 30 # Copyright 2004 Maui High Performance Computering Center, University of Hawaii … … 43 43 "resetStdout!" => \$resetStdout, 44 44 "verified=s" => \$verifiedDir, 45 "help!" => \$help 45 "help!" => \$help, 46 "quiet!" => \$quiet, 47 "printpassfail!" => \$verbose 46 48 ); 47 49 48 50 if ($help || $#ARGV < 0) { 49 print 50 "Usage: runTest [--reset] [--resetStderr] [--resetStdout] [--verified=DIR] testfile(s)\n\n";51 print "Usage: runTest [--help] [--verified=DIR] [--quiet] [--printpassfail] \\\n", 52 " [--reset] [--resetStderr] [--resetStdout] testfile(s)\n\n"; 51 53 exit(0); 52 54 } … … 75 77 # Check if a temp directory already exists in the current work directory 76 78 if ( !( -e "temp" ) ) { 77 78 79 # Create temp directory to store STDOUT, STDERR files during test run 79 80 `mkdir temp`; 80 81 # Display message of new directory created82 print("Creating temp directory\n");83 81 } 84 82 … … 87 85 88 86 # Display message that verified subdirectory doesn't exist 89 print (" Verified directory doesn't exist.\n");87 print STDERR " Verified directory doesn't exist.\n"; 90 88 91 89 # Exit script since the test cannot be run with verified files … … 95 93 # Check if the test driver file exists and is executable 96 94 if ( ( -e $testFile ) && ( -x $testFile ) ) { 97 98 # Display message the test driver is being executed99 print("--- Executing test driver: $testFile\n");100 95 101 96 # Invoke the test driver … … 112 107 # Display failure message with return value to user 113 108 if ( $? != 0 && ( $testFile !~ /^A/i ) ) { 114 print ("Failed - Test Driver returned $?, expected 0.\n");109 print STDERR "Failed - Test Driver returned $?, expected 0.\n"; 115 110 } 116 111 elsif ( $? == 0 && ( $testFile =~ /^A/i ) ) { 117 print ("Failed - Test Driver returned $?, expected abort.\n");112 print STDERR "Failed - Test Driver returned $?, expected abort.\n"; 118 113 } 119 114 $exitValue |= 64; … … 144 139 s/v\d+.\d+.\d+/vX.X.X/g; 145 140 141 if (m/TestPoint:\s*([^\*]+)/) { 142 $testfile = $1; 143 } 144 if (m/^---> TESTPOINT\s(\S+)/) { 145 print "\t$testfile- $1\n" if ($verbose || $1 eq "FAILED"); 146 if ($1 eq "FAILED") { 147 print $testoutput; 148 } 149 } 150 146 151 # Filter lines with malloc. This is an artifact of memory testing 147 152 # with the Mac testbed … … 177 182 s/v\d+.\d+.\d+/vX.X.X/g; 178 183 184 if (m/\*\*\*\*\*\* TESTPOINT \*\*\*\*\*\*/) { 185 $testoutput = $_; 186 } 187 $testoutput += $_; 188 189 if (m/ TestPoint:\s*([^\*]+)/) { 190 $testfile = $1; 191 } 192 if (m/^---> TESTPOINT\s(\S+)/) { 193 print "\t$testfile- $1\n" if ($verbose || $1 eq "FAILED"); 194 if ($1 eq "FAILED") { 195 print $testoutput; 196 } 197 } 198 179 199 # Filter lines with malloc. This is an artifact of memory testing 180 200 # with the Mac testbed 201 181 202 if ( !m/\*\*\*\smalloc/ ) { 182 203 print MODFILE ($_); … … 193 214 194 215 # Compare STDOUT capture with verified file 195 $exitValue |= &compareStream("$verifiedDir/$testFile.stdout");216 $exitValue = &compareStream("$verifiedDir/$testFile.stdout"); 196 217 197 218 # Check exit value to determine if verified file doesn't exist … … 218 239 # Since test driver doesn't exist or is not executable then display 219 240 # message to user. 220 print( 221 " Need to specify an executable test file within directory.\n" 222 ); 241 print STDERR "\tNeed to specify an executable test file.\n"; 223 242 224 243 # Exit value set to indicate test driver doesn't exist or not executable … … 231 250 # of a failed test 232 251 if ( ( $exitValue >> 3 ) != 0 ) { 233 print ("Test failed - return status = $exitValue\n\n");252 print STDERR "Test failed - return status = $exitValue\n\n"; 234 253 } 235 254 else { 236 print("Test successful\n\n");255 exit(0); 237 256 } 238 257 exit($exitValue); … … 272 291 || m/\|A\|/i ) 273 292 { 293 print STDERR "\tFailed - File $fileName contains error strings.\n"; 274 294 if ( $fileName =~ m/out/ ) { 275 print(276 " Failed - File $fileName contains error strings.\n"277 );278 295 $returnVal = 64; 279 296 } 280 297 elsif ( $fileName =~ m/err/ ) { 281 print(282 " Failed - File $fileName contains error strings.\n"283 );284 298 $returnVal = 128; 285 299 } … … 305 319 # 306 320 # Return: 0 - Compare successful 321 # 2 - STDOUT verified file doesn't exist 322 # 4 - STDERR verified file doesn't exist 307 323 # 8 - STDOUT verified file doesn't compare 308 324 # 16 - STDERR verified file doesn't compare … … 316 332 317 333 # Check for existence of verified STD stream files 318 if ( -e $streamFile ) { 334 if ( !( -e $streamFile ) ) { 335 336 # Set exit value bit 1 to indicate proper failure 337 if ( $streamFile =~ /out$/ ) { 338 $returnVal |= 2; 339 } 340 elsif ( $streamFile =~ /err$/ ) { 341 $returnVal |= 4; 342 } 343 } 344 else { 319 345 320 346 # Verified STD stream file exists … … 337 363 338 364 # Display message of the failure of difference to user 339 print (" Failed - STDOUT difference\n$diffstdout\n");365 print STDERR "\tFailed - STDOUT differences\n"; 340 366 341 367 # Exit value to indicate STDOUT did not compare … … 345 371 346 372 # Display message of the failure of difference to user 347 print (" Failed - STDERR difference\n$diffstdout\n");373 print STDERR "\tFailed - STDERR differences\n"; 348 374 349 375 # Exit value to indicate STDERR did not compare
Note:
See TracChangeset
for help on using the changeset viewer.
