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

login
register
mail settings
Submitter phabricator
Date Nov. 17, 2017, 2:12 p.m.
Message ID <443fbbf49921bfb7877211f7b587dd48@localhost.localdomain>
Download mbox | patch
Permalink /patch/25619/
State Not Applicable
Headers show

Comments

phabricator - Nov. 17, 2017, 2:12 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGdb5da5c563d0: run-tests: fix TESTDIR if testdescs are absolute paths (authored by spectral, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D1433?vs=3578&id=3590#toc

REPOSITORY
  rHG Mercurial

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

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,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: