Permalink
Browse files

The test suite framework now displays timing information.

git-svn-id: svn://deltup.org/bdelta@10 0b3c7260-62b7-4bd3-8502-661595b7e89c
  • Loading branch information...
jjwhitney committed Jun 2, 2010
1 parent bade4ec commit c475fc29d0c6b3f2bce3e126104e607db7b3181c
Showing with 8 additions and 2 deletions.
  1. +8 −2 test/suite.py
View
@@ -6,8 +6,10 @@
import sys
import os
import filecmp
+import time
basePath = sys.argv[1]
+initialTime = time.time()
def isValidFile(x):
return not x.startswith('.') and os.path.isdir(os.path.join(basePath, x))
@@ -18,14 +20,18 @@ def isValidFile(x):
for test in testFolders:
def path(fName):
return os.path.join(basePath, test, fName)
+ t1 = time.time()
os.system("../src/bdelta %s %s %s" % (path("1"), path("2"), path("patch.bdelta")))
+ t2 = time.time()
os.system("../src/bpatch %s %s %s" % (path("1"), path("2.new"), path("patch.bdelta")))
print ("%20s:" % test),
if filecmp.cmp(path("2"), path("2.new"), shallow=False):
- print "%10s" % os.stat(path("patch.bdelta")).st_size,
+ print "uncompressed=%s\t" % os.stat(path("patch.bdelta")).st_size,
os.system("bzip2 %s" % path("patch.bdelta"))
- print "%10s" % os.stat(path("patch.bdelta.bz2")).st_size
+ print "bz2=%s\t" % os.stat(path("patch.bdelta.bz2")).st_size,
+ print "time=%f" % (t2-t1)
else:
print "ERROR"
os.remove(path("patch.bdelta.bz2"))
os.remove(path("2.new"))
+print "Total time:", (time.time()-initialTime)

0 comments on commit c475fc2

Please sign in to comment.