changeset 13995:b29b7cbc252f

run-tests: move test loop into a helper function
author Matt Mackall <mpm@selenic.com>
date Fri, 22 Apr 2011 14:04:34 -0500
parents f31a5b7f5c07
children 1cafa0426a1a
files tests/run-tests.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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