# HG changeset patch # User Alexis S. L. Carvalho # Date 1175930875 10800 # Node ID 99184c6fd88fc8d69d8ef0ca63df8e92cf67516b # Parent f9b61e0fc92939c806227906f959dc21d078ed4e run-tests.py: use coverage.py with "#!/usr/bin/env python" tests diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -240,9 +240,15 @@ def run_one(test): os.mkdir(tmpd) os.chdir(tmpd) + try: + tf = open(testpath) + firstline = tf.readline().rstrip() + tf.close() + except: + firstline = '' lctest = test.lower() - if lctest.endswith('.py'): + if lctest.endswith('.py') or firstline == '#!/usr/bin/env python': cmd = '%s "%s"' % (python, testpath) elif lctest.endswith('.bat'): # do not run batch scripts on non-windows