# HG changeset patch # User Mads Kiilerich # Date 2010-02-09 00:12:29 # Node ID 6586a6889f6612bbaa2c2a48537d91b179d79adb # Parent 2d30d66a89ad29f471aa6918fc46121a4bc3fbe8 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 @@ def runone(options, test, skips, fails): 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 @@ def runone(options, test, skips, fails): 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)