[PATCH 1 of 1] tests: print progress counter when running tests

Idan Kamara idankk86 at gmail.com
Thu Apr 7 11:14:55 CDT 2011


# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1302192379 -10800
# Node ID 2eeefdc4bf11045ae1de10b989ec84f8fa95bd1d
# Parent  855a3b3fbca3ab7774d745d8281a5bb5d30b3cfe
tests: print progress counter when running tests

when verbose = False, print a progress counter '#-of-tests-ran/#-of-total-tests'
every 10 completed tests

diff -r 855a3b3fbca3 -r 2eeefdc4bf11 tests/run-tests.py
--- a/tests/run-tests.py	Thu Apr 07 18:13:39 2011 +0300
+++ b/tests/run-tests.py	Thu Apr 07 19:06:19 2011 +0300
@@ -920,7 +920,7 @@
         skips = []
         fails = []
 
-        for test in tests:
+        for (count, test) in enumerate(tests):
             if options.blacklist:
                 filename = options.blacklist.get(test)
                 if filename is not None:
@@ -944,6 +944,11 @@
                     continue
 
             ret = runone(options, test, skips, fails)
+
+            if not options.verbose and (count + 1) % 10 == 0:
+                sys.stdout.write('%d/%d' % (count + 1, len(tests)))
+                sys.stdout.flush()
+
             if ret is None:
                 skipped += 1
             elif not ret:


More information about the Mercurial-devel mailing list