[Request] [+ ] D8681: rhg: use a function in test-rhg.t instead of global alias
acezar (Antoine Cezar)
phabricator at mercurial-scm.org
Mon Jul 6 09:18:48 UTC 2020
acezar created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D8681
AFFECTED FILES
tests/run-tests.py
tests/test-rhg.t
CHANGE DETAILS
diff --git a/tests/test-rhg.t b/tests/test-rhg.t
--- a/tests/test-rhg.t
+++ b/tests/test-rhg.t
@@ -1,3 +1,13 @@
+#require rust
+
+ $ rhg() {
+ > if [ -f "$RUNTESTDIR/../rust/target/debug/rhg" ]; then
+ > "$RUNTESTDIR/../rust/target/debug/rhg" "$@"
+ > else
+ > echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg."
+ > exit 80
+ > fi
+ > }
$ rhg unimplemented-command
[252]
$ rhg root
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -927,7 +927,6 @@
extraconfigopts=None,
shell=None,
hgcommand=None,
- rhgcommand=None,
slowtimeout=None,
usechg=False,
chgdebug=False,
@@ -985,9 +984,6 @@
self._extraconfigopts = extraconfigopts or []
self._shell = _sys2bytes(shell)
self._hgcommand = hgcommand or b'hg'
- self._rhgcommand = rhgcommand or _sys2bytes(
- os.path.abspath('./rust/target/release/rhg')
- )
self._usechg = usechg
self._chgdebug = chgdebug
self._useipv6 = useipv6
@@ -1758,8 +1754,6 @@
script.append(b'set -x\n')
if self._hgcommand != b'hg':
script.append(b'alias hg="%s"\n' % self._hgcommand)
- if self._rhgcommand != b'rhg':
- script.append(b'alias rhg="%s"\n' % self._rhgcommand)
if os.getenv('MSYSTEM'):
script.append(b'alias pwd="pwd -W"\n')
@@ -2956,7 +2950,6 @@
self._coveragefile = None
self._createdfiles = []
self._hgcommand = None
- self._rhgcommand = None
self._hgpath = None
self._portoffset = 0
self._ports = {}
To: acezar, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20200706/ddd83115/attachment-0001.html>
More information about the Mercurial-patches
mailing list