comparison tests/run-tests.py @ 35823:4be991331a46

tests: get run-tests to reliably hand shellquote a string and not a bytes Differential Revision: https://phab.mercurial-scm.org/D1883
author Augie Fackler <augie@google.com>
date Wed, 17 Jan 2018 19:11:51 -0500
parents 6d65cef5b038
children 8a7140ec4c89
comparison
equal deleted inserted replaced
35822:4269971b0d26 35823:4be991331a46
1339 if self._hgcommand != b'hg': 1339 if self._hgcommand != b'hg':
1340 script.append(b'alias hg="%s"\n' % self._hgcommand) 1340 script.append(b'alias hg="%s"\n' % self._hgcommand)
1341 if os.getenv('MSYSTEM'): 1341 if os.getenv('MSYSTEM'):
1342 script.append(b'alias pwd="pwd -W"\n') 1342 script.append(b'alias pwd="pwd -W"\n')
1343 if self._case: 1343 if self._case:
1344 script.append(b'TESTCASE=%s\n' % shellquote(self._case)) 1344 if isinstance(self._case, str):
1345 quoted = shellquote(self._case)
1346 else:
1347 quoted = shellquote(self._case.decode('utf8')).encode('utf8')
1348 script.append(b'TESTCASE=%s\n' % quoted)
1345 script.append(b'export TESTCASE\n') 1349 script.append(b'export TESTCASE\n')
1346 1350
1347 n = 0 1351 n = 0
1348 for n, l in enumerate(lines): 1352 for n, l in enumerate(lines):
1349 if not l.endswith(b'\n'): 1353 if not l.endswith(b'\n'):