##// END OF EJS Templates
tests: Add `rhg` and `no-rhg` for #require and #if in .t files...
Simon Sapin -
r47458:78e6700a default
parent child Browse files
Show More
@@ -188,6 +188,11 b' def has_chg():'
188 188 return 'CHGHG' in os.environ
189 189
190 190
191 @check("rhg", "running with rhg as 'hg'")
192 def has_rhg():
193 return 'RHG_INSTALLED_AS_HG' in os.environ
194
195
191 196 @check("cvs", "cvs client/server")
192 197 def has_cvs():
193 198 re = br'Concurrent Versions System.*?server'
@@ -3134,6 +3134,8 b' class TestRunner(object):'
3134 3134 # configure fallback and replace "hg" command by "rhg"
3135 3135 rhgbindir = self._bindir
3136 3136 if self.options.rhg or self.options.with_rhg:
3137 # Affects hghave.py
3138 osenvironb[b'RHG_INSTALLED_AS_HG'] = b'1'
3137 3139 # Affects configuration. Alternatives would be setting configuration through
3138 3140 # `$HGRCPATH` but some tests override that, or changing `_hgcommand` to include
3139 3141 # `--config` but that disrupts tests that print command lines and check expected
@@ -1,15 +1,4 b''
1 #require rust
2
3 Define an rhg function that will only run if rhg exists
4 $ RHG="$RUNTESTDIR/../rust/target/release/rhg"
5 $ rhg() {
6 > if [ -f "$RHG" ]; then
7 > "$RHG" "$@"
8 > else
9 > echo "skipped: Cannot find rhg. Try to run cargo build in rust/rhg."
10 > exit 80
11 > fi
12 > }
1 #require rhg
13 2
14 3 $ NO_FALLBACK="env RHG_ON_UNSUPPORTED=abort"
15 4
@@ -169,8 +158,8 b' Fallback to Python'
169 158 unsupported feature: `rhg cat` without `--rev` / `-r`
170 159 [252]
171 160
172 $ rhg cat original --config rhg.fallback-executable="$RHG"
173 Blocking recursive fallback. The 'rhg.fallback-executable = */rust/target/release/rhg' config points to `rhg` itself. (glob)
161 $ rhg cat original --config rhg.fallback-executable=rhg
162 Blocking recursive fallback. The 'rhg.fallback-executable = rhg' config points to `rhg` itself.
174 163 unsupported feature: `rhg cat` without `--rev` / `-r`
175 164 [252]
176 165
General Comments 0
You need to be logged in to leave comments. Login now