# HG changeset patch # User Kyle Lippincott # Date 1510797267 28800 # 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 -r a1de4ffaa7a8 -r 57d56f603f70 tests/run-tests.py --- a/tests/run-tests.py Thu Nov 16 22:21:03 2017 +0800 +++ b/tests/run-tests.py Wed Nov 15 17:54:27 2017 -0800 @@ -2356,9 +2356,9 @@ # 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: