run-tests: move test loop into a helper function stable
authorMatt Mackall <mpm@selenic.com>
Fri, 22 Apr 2011 14:04:34 -0500
branchstable
changeset 909 5ec26580cbb2
parent 908 78f81dc655ca
child 910 b8ae2e290420
run-tests: move test loop into a helper function [ original upstream message ]
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