run-tests.py: skipped tests shouldn't change working directory stable
authorMads Kiilerich <mads@kiilerich.com>
Tue, 09 Feb 2010 01:12:29 +0100
branchstable
changeset 693 8428f3bda904
parent 692 5ac40b193130
child 694 13b10c2621a5
child 697 876f5dff4e59
run-tests.py: skipped tests shouldn't change working directory [ original upstream message ]
tests/run-tests.py
--- a/tests/run-tests.py	Tue Dec 29 19:02:26 2009 -0200
+++ b/tests/run-tests.py	Tue Feb 09 01:12:29 2010 +0100
@@ -522,18 +522,11 @@
         hgrc.write('appendpid=True\n')
     hgrc.close()
 
-    err = os.path.join(TESTDIR, test+".err")
+    testpath = os.path.join(TESTDIR, test)
     ref = os.path.join(TESTDIR, test+".out")
-    testpath = os.path.join(TESTDIR, test)
-
+    err = os.path.join(TESTDIR, test+".err")
     if os.path.exists(err):
         os.remove(err)       # Remove any previous output files
-
-    # Make a tmp subdirectory to work in
-    tmpd = os.path.join(HGTMP, test)
-    os.mkdir(tmpd)
-    os.chdir(tmpd)
-
     try:
         tf = open(testpath)
         firstline = tf.readline().rstrip()
@@ -563,6 +556,11 @@
             return skip("not executable")
         cmd = '"%s"' % testpath
 
+    # Make a tmp subdirectory to work in
+    tmpd = os.path.join(HGTMP, test)
+    os.mkdir(tmpd)
+    os.chdir(tmpd)
+
     if options.timeout > 0:
         signal.alarm(options.timeout)