# HG changeset patch # User Kyle Lippincott # Date 2017-11-16 01:54:27 # Node ID 57d56f603f7062d9c5a0f6d9c4bf39e1a26c5388 # Parent a1de4ffaa7a8fd1590048e39c5ed61c1f96c21f3 run-tests: fix TESTDIR if testdescs are absolute paths Commit a18eef03d879 made TESTDIR be the location of the arguments that were passed to run-tests.py instead of just PWD. It assumed that these tests were specified using relative paths, so if pwd was /tmp/foo, and the first argument was /tmp/baz, it would set TESTDIR to /tmp/foo//tmp/baz. Differential Revision: https://phab.mercurial-scm.org/D1433 diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -2356,9 +2356,9 @@ class TestRunner(object): # assume all tests in same folder for now if testdescs: pathname = os.path.dirname(testdescs[0]['path']) - if pathname and not osenvironb[b'TESTDIR'].endswith(b'/'): - osenvironb[b'TESTDIR'] += b'/' - osenvironb[b'TESTDIR'] += pathname + if pathname: + osenvironb[b'TESTDIR'] = os.path.join(osenvironb[b'TESTDIR'], + pathname) if self.options.outputdir: self._outputdir = canonpath(_bytespath(self.options.outputdir)) else: