Submitter | phabricator |
---|---|
Date | Jan. 5, 2018, 8:03 p.m. |
Message ID | <differential-rev-PHID-DREV-xtuq5mbahrwk7qqryts3-req@phab.mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/26574/ |
State | Superseded |
Headers | show |
Comments
quark added inline comments. INLINE COMMENTS > run-tests.py:1338 > + if self._case: > + script.append(b'TESTCASE=%s\n' % self._case) > Maybe `util.shellquote` the name. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1816 To: martinvonz, #hg-reviewers, quark Cc: mercurial-devel
martinvonz marked an inline comment as not done. martinvonz added inline comments. INLINE COMMENTS > quark wrote in run-tests.py:1338 > Maybe `util.shellquote` the name. Done (but it seems to be just `shellquote` in the test runner). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1816 To: martinvonz, #hg-reviewers, quark Cc: mercurial-devel
yuja requested changes to this revision. yuja added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > run-tests.py:1338 > + if self._case: > + script.append(b'TESTCASE=%s\n' % shellquote(self._case)) > Needs `export TESTCASE` to export shell variables to environment. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1816 To: martinvonz, #hg-reviewers, quark, yuja Cc: yuja, mercurial-devel
martinvonz marked an inline comment as not done. martinvonz added inline comments. INLINE COMMENTS > yuja wrote in run-tests.py:1338 > Needs `export TESTCASE` to export shell variables to environment. > Needs `export TESTCASE` to export shell variables to environment. Sure, will do. I wasn't sure if I should or shouldn't. Are you thinking that it may be useful if the function in my test case is instead a stand-alone script/binary? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1816 To: martinvonz, #hg-reviewers, quark, yuja Cc: yuja, mercurial-devel
yuja accepted this revision.
yuja added a comment.
This revision is now accepted and ready to land.
> Are you thinking that it may be useful if the function in my test case is instead a stand-alone script/binary?
No idea if it'll be useful, but there seemed no reason to narrow the scope
of `$TESTCASE` variable.
Queued, thanks.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D1816
To: martinvonz, #hg-reviewers, quark, yuja
Cc: yuja, mercurial-devel
Patch
diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t --- a/tests/test-run-tests.t +++ b/tests/test-run-tests.t @@ -1533,6 +1533,26 @@ python hash seed: * (glob) [1] +Test TESTCASE variable + + $ cat > test-cases-ab.t <<'EOF' + > $ dostuff() { + > > echo "In case $TESTCASE" + > > } + > #testcases A B + > #if A + > $ dostuff + > In case A + > #endif + > #if B + > $ dostuff + > In case B + > #endif + > EOF + $ rt test-cases-ab.t + .. + # Ran 2 tests, 0 skipped, 0 failed. + Test automatic pattern replacement $ cat << EOF >> common-pattern.py diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1334,6 +1334,8 @@ script.append(b'alias hg="%s"\n' % self._hgcommand) if os.getenv('MSYSTEM'): script.append(b'alias pwd="pwd -W"\n') + if self._case: + script.append(b'TESTCASE=%s\n' % self._case) n = 0 for n, l in enumerate(lines):