run-tests: move test loop into a helper function
authorMatt Mackall <mpm@selenic.com>
Fri, 22 Apr 2011 14:04:34 -0500
changeset 13995 b29b7cbc252f
parent 13994 f31a5b7f5c07
child 13996 1cafa0426a1a
run-tests: move test loop into a helper function
tests/run-tests.py
--- a/tests/run-tests.py	Fri Apr 22 12:24:22 2011 -0500
+++ b/tests/run-tests.py	Fri Apr 22 14:04:34 2011 -0500
@@ -934,6 +934,12 @@
         outputcoverage(options)
     sys.exit(failures != 0)
 
+def runqueue(options, tests, results):
+    for test in tests:
+        ret = runone(options, test, results)
+        if options.first and ret is not None and not ret:
+            break
+
 def runtests(options, tests):
     global DAEMON_PIDS, HGRCPATH
     DAEMON_PIDS = os.environ["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids')
@@ -965,10 +971,7 @@
                 print "running all tests"
                 tests = orig
 
-        for test in tests:
-            ret = runone(options, test, results)
-            if options.first and ret is not None and not ret:
-                break
+        runqueue(options, tests, results)
 
         failed = len(results['f'])
         tested = len(results['p']) + failed