tests/run-tests.py
branchstable
changeset 1227 afafc1812f7b
parent 1226 0dd96ff409e9
child 1228 db145eefc724
--- a/tests/run-tests.py	Fri May 24 13:02:00 2013 -0500
+++ b/tests/run-tests.py	Fri May 24 13:23:19 2013 -0500
@@ -904,17 +904,16 @@
             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 @@
     if failed:
         sys.exit(1)
 
+testtypes = [('.py', pytest, '.out'),
+             ('.t', tsttest, '')]
+
 def main():
     (options, args) = parseargs()
     if not options.child: