Mercurial > hg
comparison tests/run-tests.py @ 35536:f04d16bef2c7
tests: make #testcase available as env var in test
It can be useful for e.g. helper functions to behave differently
depending on which test case is being executed. This patch helps with
that by making the #testcase case available as a TESTCASE environment
variable.
Differential Revision: https://phab.mercurial-scm.org/D1816
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 05 Jan 2018 11:53:33 -0800 |
parents | 212a6e9aecb0 |
children | 964212780daf |
comparison
equal
deleted
inserted
replaced
35535:ffd7b7cd309b | 35536:f04d16bef2c7 |
---|---|
1332 script.append(b'set -x\n') | 1332 script.append(b'set -x\n') |
1333 if self._hgcommand != b'hg': | 1333 if self._hgcommand != b'hg': |
1334 script.append(b'alias hg="%s"\n' % self._hgcommand) | 1334 script.append(b'alias hg="%s"\n' % self._hgcommand) |
1335 if os.getenv('MSYSTEM'): | 1335 if os.getenv('MSYSTEM'): |
1336 script.append(b'alias pwd="pwd -W"\n') | 1336 script.append(b'alias pwd="pwd -W"\n') |
1337 if self._case: | |
1338 script.append(b'TESTCASE=%s\n' % shellquote(self._case)) | |
1339 script.append(b'export TESTCASE\n') | |
1337 | 1340 |
1338 n = 0 | 1341 n = 0 |
1339 for n, l in enumerate(lines): | 1342 for n, l in enumerate(lines): |
1340 if not l.endswith(b'\n'): | 1343 if not l.endswith(b'\n'): |
1341 l += b'\n' | 1344 l += b'\n' |