[PATCH] run-tests.py: skipped tests shouldn't change working directory
Mads Kiilerich
mads at kiilerich.com
Mon Feb 8 18:13:22 CST 2010
# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1265674349 -3600
# Node ID 69179afd4aee55e0da0374db0768f69c3bb4d63b
# Parent e7b97b54cb023209618673820d8872c5f934bb6c
run-tests.py: skipped tests shouldn't change working directory
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -522,18 +522,11 @@
hgrc.write('appendpid=True\n')
hgrc.close()
+ testpath = os.path.join(TESTDIR, test)
+ ref = os.path.join(TESTDIR, test+".out")
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
-
- # 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)
More information about the Mercurial-devel
mailing list