Changeset 505 for pkpgcounter/trunk/tests/gstests.py
- Timestamp:
- 11/22/07 12:58:46 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/tests/gstests.py
r504 r505 27 27 import os 28 28 import glob 29 import md5 29 30 import tempfile 30 31 … … 68 69 def computeSize(filename) : 69 70 """Computes the size in pages of a file in the testsuite.""" 70 answerfd = os.popen('pkpgcounter "%(filename)s" ' % locals(), "r")71 answerfd = os.popen('pkpgcounter "%(filename)s" 2>/dev/null' % locals(), "r") 71 72 try : 72 73 try : … … 82 83 if not mastersize : 83 84 raise RuntimeError, "Unable to compute the size of the testsuite's master file %(masterfilename)s" % locals() 84 85 else : 86 sys.stdout.write("Master file's contains %(mastersize)i pages.\n" % locals()) 85 87 passed = 0 86 88 failed = 0 … … 100 102 sys.stdout.write("OK\n") 101 103 passed += 1 102 print "Passed : %i (%.2f%%)" % (passed, 100.0 * passed / nbtests)103 print "Failed : %i (%.2f%%)" % (failed, 100.0 * failed / nbtests)104 sys.stdout.write("Passed : %i (%.2f%%)\n" % (passed, 100.0 * passed / nbtests)) 105 sys.stdout.write("Failed : %i (%.2f%%)\n" % (failed, 100.0 * failed / nbtests)) 104 106 105 107 def main() : … … 111 113 sys.exit(-1) 112 114 else : 115 checksum = md5.new() # Ensures we'll recreate a new testsuite if input is different 113 116 infilename = sys.argv[1] 114 117 istemp = False … … 124 127 break 125 128 tmp.write(data) 129 checksum.update(data) 126 130 tmp.flush() 127 128 genTestSuite(infilename, "testsuite") 131 else : 132 checksum.update(infilename) 133 genTestSuite(infilename, "testsuite.%s" % checksum.hexdigest()) 129 134 runTests(infilename, "testsuite") 130 135