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

login
register
mail settings
Submitter phabricator
Date Nov. 16, 2017, 8:42 p.m.
Message ID <6a07b2dab4719d827ea4c2636f6fdead@localhost.localdomain>
Download mbox | patch
Permalink /patch/25611/
State Not Applicable
Headers show

Comments

phabricator - Nov. 16, 2017, 8:42 p.m.
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




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

Patch

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: