[Commented On] D11034: test-run-test: use explicit variable to clarify path
baymax (Baymax, Your Personal Patch-care Companion)
phabricator at mercurial-scm.org
Sat Jul 10 01:24:01 UTC 2021
baymax added a comment.
baymax updated this revision to Diff 29074.
✅ refresh by Heptapod after a successful CI run (🐙 💚)
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D11034?vs=29040&id=29074
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11034/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11034
AFFECTED FILES
tests/test-run-tests.t
CHANGE DETAILS
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
@@ -1381,8 +1381,28 @@
Test reusability for third party tools
======================================
- $ mkdir "$TESTTMP"/anothertests
- $ cd "$TESTTMP"/anothertests
+ $ THISTESTDIR="$TESTDIR"
+ $ export THISTESTDIR
+ $ THISTESTTMP="$TESTTMP"
+ $ export THISTESTTMP
+
+#if windows
+
+ $ NEWTESTDIR="$THISTESTTMP"\\anothertests
+
+#else
+
+ $ NEWTESTDIR="$THISTESTTMP"/anothertests
+
+#endif
+
+ $ export NEWTESTDIR
+
+ $ echo creating some new test in: $NEWTESTDIR
+ creating some new test in: $TESTTMP\anothertests (windows !)
+ creating some new test in: $TESTTMP/anothertests (no-windows !)
+ $ mkdir "$NEWTESTDIR"
+ $ cd "$NEWTESTDIR"
test that `run-tests.py` can execute hghave, even if it runs not in
Mercurial source tree.
@@ -1400,22 +1420,20 @@
test that RUNTESTDIR refers the directory, in which `run-tests.py` now
running is placed.
+
$ cat > test-runtestdir.t <<EOF
- > - $TESTDIR, in which test-run-tests.t is placed
- > - \$TESTDIR, in which test-runtestdir.t is placed (expanded at runtime)
- > - \$RUNTESTDIR, in which run-tests.py is placed (expanded at runtime)
+ > # \$THISTESTDIR, in which test-run-tests.t (this test file) is placed
+ > # \$THISTESTTMP, in which test-run-tests.t (this test file) is placed
+ > # \$TESTDIR, in which test-runtestdir.t is placed (expanded at runtime)
+ > # \$RUNTESTDIR, in which run-tests.py is placed (expanded at runtime)
>
- > #if windows
- > $ test "\$TESTDIR" = "$TESTTMP\\anothertests"
- > #else
- > $ test "\$TESTDIR" = "$TESTTMP"/anothertests
- > #endif
+ > $ test "\$TESTDIR" = "\$NEWTESTDIR"
> If this prints a path, that means RUNTESTDIR didn't equal
- > TESTDIR as it should have.
- > $ test "\$RUNTESTDIR" = "$TESTDIR" || echo "\$RUNTESTDIR"
+ > THISTESTDIR as it should have.
+ > $ test "\$RUNTESTDIR" = "\$THISTESTDIR" || echo "\$RUNTESTDIR"
> This should print the start of check-code. If this passes but the
> previous check failed, that means we found a copy of check-code at whatever
- > RUNTESTSDIR ended up containing, even though it doesn't match TESTDIR.
+ > RUNTESTSDIR ended up containing, even though it doesn't match THISTESTDIR.
> $ head -n 3 "\$RUNTESTDIR"/../contrib/check-code.py | sed 's at .!.*python3@#!USRBINENVPY@'
> #!USRBINENVPY
> #
To: marmoute, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210710/85e5c169/attachment-0002.html>
More information about the Mercurial-patches
mailing list