# HG changeset patch # User Matt Mackall # Date 2013-05-24 18:23:19 # Node ID db978c792b02174166dde8e9aa9fdf3643c14712 # Parent 4122de8003e41f9eec94b630dcd6c9eb23fb40bb run-tests: make a table of test types diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -904,17 +904,16 @@ def runone(options, test): hgrc.write('[%s]\n%s\n' % (section, key)) hgrc.close() - ref = os.path.join(TESTDIR, test+".out") err = os.path.join(TESTDIR, test+".err") if os.path.exists(err): os.remove(err) # Remove any previous output files lctest = test.lower() - if lctest.endswith('.py'): - runner = pytest - elif lctest.endswith('.t'): - runner = tsttest - ref = testpath + for ext, func, out in testtypes: + if lctest.endswith(ext): + runner = func + ref = os.path.join(TESTDIR, test + out) + break else: return skip("unknown test type") @@ -1234,6 +1233,9 @@ def runtests(options, tests): if failed: sys.exit(1) +testtypes = [('.py', pytest, '.out'), + ('.t', tsttest, '')] + def main(): (options, args) = parseargs() if not options.child: