# HG changeset patch # User Matt Mackall # Date 2011-04-22 19:04:34 # Node ID b29b7cbc252f93a5dad761a16f21991144a315e3 # Parent f31a5b7f5c0713a1df3a47d30c3c61802b071092 run-tests: move test loop into a helper function diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -934,6 +934,12 @@ def runchildren(options, tests): 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 @@ def runtests(options, tests): 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