comparison tests/run-tests.py @ 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 8f9478be9a94
comparison
equal deleted inserted replaced
13994:f31a5b7f5c07 13995:b29b7cbc252f
932 932
933 if options.anycoverage: 933 if options.anycoverage:
934 outputcoverage(options) 934 outputcoverage(options)
935 sys.exit(failures != 0) 935 sys.exit(failures != 0)
936 936
937 def runqueue(options, tests, results):
938 for test in tests:
939 ret = runone(options, test, results)
940 if options.first and ret is not None and not ret:
941 break
942
937 def runtests(options, tests): 943 def runtests(options, tests):
938 global DAEMON_PIDS, HGRCPATH 944 global DAEMON_PIDS, HGRCPATH
939 DAEMON_PIDS = os.environ["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids') 945 DAEMON_PIDS = os.environ["DAEMON_PIDS"] = os.path.join(HGTMP, 'daemon.pids')
940 HGRCPATH = os.environ["HGRCPATH"] = os.path.join(HGTMP, '.hgrc') 946 HGRCPATH = os.environ["HGRCPATH"] = os.path.join(HGTMP, '.hgrc')
941 947
963 tests.pop(0) 969 tests.pop(0)
964 if not tests: 970 if not tests:
965 print "running all tests" 971 print "running all tests"
966 tests = orig 972 tests = orig
967 973
968 for test in tests: 974 runqueue(options, tests, results)
969 ret = runone(options, test, results)
970 if options.first and ret is not None and not ret:
971 break
972 975
973 failed = len(results['f']) 976 failed = len(results['f'])
974 tested = len(results['p']) + failed 977 tested = len(results['p']) + failed
975 skipped = len(results['s']) 978 skipped = len(results['s'])
976 ignored = len(results['i']) 979 ignored = len(results['i'])