Mercurial > hg
comparison tests/run-tests.py @ 49047:c827bb7b5806 stable
run-tests: introduce "forward-slash" version of everything on windows
This should be useful for some shell invocation.
Differential Revision: https://phab.mercurial-scm.org/D12480
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 06 Apr 2022 18:50:20 +0200 |
parents | 29eb80d190b2 |
children | ea98850a136e c95e5ba4de1e |
comparison
equal
deleted
inserted
replaced
49046:dd384ad01d88 | 49047:c827bb7b5806 |
---|---|
1431 | 1431 |
1432 env = os.environ.copy() | 1432 env = os.environ.copy() |
1433 env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase') or '' | 1433 env['PYTHONUSERBASE'] = sysconfig.get_config_var('userbase') or '' |
1434 env['HGEMITWARNINGS'] = '1' | 1434 env['HGEMITWARNINGS'] = '1' |
1435 env['TESTTMP'] = _bytes2sys(self._testtmp) | 1435 env['TESTTMP'] = _bytes2sys(self._testtmp) |
1436 # the FORWARD_SLASH version is useful when running `sh` on non unix | |
1437 # system (e.g. Windows) | |
1438 env['TESTTMP_FORWARD_SLASH'] = env['TESTTMP'].replace(os.sep, '/') | |
1436 uid_file = os.path.join(_bytes2sys(self._testtmp), 'UID') | 1439 uid_file = os.path.join(_bytes2sys(self._testtmp), 'UID') |
1437 env['HGTEST_UUIDFILE'] = uid_file | 1440 env['HGTEST_UUIDFILE'] = uid_file |
1438 env['TESTNAME'] = self.name | 1441 env['TESTNAME'] = self.name |
1439 env['HOME'] = _bytes2sys(self._testtmp) | 1442 env['HOME'] = _bytes2sys(self._testtmp) |
1440 if WINDOWS: | 1443 if WINDOWS: |
3111 if testdescs: | 3114 if testdescs: |
3112 pathname = os.path.dirname(testdescs[0]['path']) | 3115 pathname = os.path.dirname(testdescs[0]['path']) |
3113 if pathname: | 3116 if pathname: |
3114 testdir = os.path.join(testdir, pathname) | 3117 testdir = os.path.join(testdir, pathname) |
3115 self._testdir = osenvironb[b'TESTDIR'] = testdir | 3118 self._testdir = osenvironb[b'TESTDIR'] = testdir |
3119 osenvironb[b'TESTDIR_FORWARD_SLASH'] = osenvironb[b'TESTDIR'].replace( | |
3120 os.sep.encode('ascii'), b'/' | |
3121 ) | |
3122 | |
3116 if self.options.outputdir: | 3123 if self.options.outputdir: |
3117 self._outputdir = canonpath(_sys2bytes(self.options.outputdir)) | 3124 self._outputdir = canonpath(_sys2bytes(self.options.outputdir)) |
3118 else: | 3125 else: |
3119 self._outputdir = getcwdb() | 3126 self._outputdir = getcwdb() |
3120 if testdescs and pathname: | 3127 if testdescs and pathname: |
3255 osenvironb[b"PYTHON"] = PYTHON | 3262 osenvironb[b"PYTHON"] = PYTHON |
3256 | 3263 |
3257 fileb = _sys2bytes(__file__) | 3264 fileb = _sys2bytes(__file__) |
3258 runtestdir = os.path.abspath(os.path.dirname(fileb)) | 3265 runtestdir = os.path.abspath(os.path.dirname(fileb)) |
3259 osenvironb[b'RUNTESTDIR'] = runtestdir | 3266 osenvironb[b'RUNTESTDIR'] = runtestdir |
3267 osenvironb[b'RUNTESTDIR_FORWARD_SLASH'] = runtestdir.replace( | |
3268 os.sep.encode('ascii'), b'/' | |
3269 ) | |
3260 if PYTHON3: | 3270 if PYTHON3: |
3261 sepb = _sys2bytes(os.pathsep) | 3271 sepb = _sys2bytes(os.pathsep) |
3262 else: | 3272 else: |
3263 sepb = os.pathsep | 3273 sepb = os.pathsep |
3264 path = [self._bindir, runtestdir] + osenvironb[b"PATH"].split(sepb) | 3274 path = [self._bindir, runtestdir] + osenvironb[b"PATH"].split(sepb) |