changeset 4320:f9b61e0fc929

run-tests.py: small cleanup
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 07 Apr 2007 04:27:55 -0300
parents 8ece1ba156c7
children 99184c6fd88f
files tests/run-tests.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sat Apr 07 04:27:55 2007 -0300
+++ b/tests/run-tests.py	Sat Apr 07 04:27:55 2007 -0300
@@ -230,6 +230,7 @@
 
     err = os.path.join(TESTDIR, test+".err")
     ref = os.path.join(TESTDIR, test+".out")
+    testpath = os.path.join(TESTDIR, test)
 
     if os.path.exists(err):
         os.remove(err)       # Remove any previous output files
@@ -242,7 +243,7 @@
     lctest = test.lower()
 
     if lctest.endswith('.py'):
-        cmd = '%s "%s"' % (python, os.path.join(TESTDIR, test))
+        cmd = '%s "%s"' % (python, testpath)
     elif lctest.endswith('.bat'):
         # do not run batch scripts on non-windows
         if os.name != 'nt':
@@ -250,17 +251,17 @@
             return None
         # To reliably get the error code from batch files on WinXP,
         # the "cmd /c call" prefix is needed. Grrr
-        cmd = 'cmd /c call "%s"' % (os.path.join(TESTDIR, test))
+        cmd = 'cmd /c call "%s"' % testpath
     else:
         # do not run shell scripts on windows
         if os.name == 'nt':
             print '\nSkipping %s: shell script' % test
             return None
         # do not try to run non-executable programs
-        if not os.access(os.path.join(TESTDIR, test), os.X_OK):
+        if not os.access(testpath, os.X_OK):
             print '\nSkipping %s: not executable' % test
             return None
-        cmd = '"%s"' % (os.path.join(TESTDIR, test))
+        cmd = '"%s"' % testpath
 
     if options.timeout > 0:
         signal.alarm(options.timeout)