D1433: run-tests: fix TESTDIR if testdescs are absolute paths

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Thu Nov 16 15:42:51 EST 2017


spectral updated this revision to Diff 3578.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1433?vs=3549&id=3578

REVISION DETAIL
  https://phab.mercurial-scm.org/D1433

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

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,8 @@
         # 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
+            osenvironb[b'TESTDIR'] = os.path.join(osenvironb[b'TESTDIR'],
+                                                  pathname)
         if self.options.outputdir:
             self._outputdir = canonpath(_bytespath(self.options.outputdir))
         else:



To: spectral, #hg-reviewers, yuja
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list