Mercurial > hg
comparison tests/helpers-testrepo.sh @ 37342:4e6a6d0dccee
tests: conditionalize tests based on presence of custom extensions
The test harness supports injecting extensions via --extra-config-opt.
However, if you do this, various tests that print state about loaded
extensions fail.
This commit teaches the test harness to recognize when custom
extensions are loaded so that tests can use feature sniffing to
conditionalize tests based on that.
Differential Revision: https://phab.mercurial-scm.org/D3039
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 04 Apr 2018 13:21:34 -0700 |
parents | 45d6e2767a93 |
children | 152f1b47e0ad |
comparison
equal
deleted
inserted
replaced
37341:d62d2e346acf | 37342:4e6a6d0dccee |
---|---|
7 # repository. | 7 # repository. |
8 # | 8 # |
9 # The mercurial source repository was typically orignally cloned with the | 9 # The mercurial source repository was typically orignally cloned with the |
10 # system mercurial installation, and may require extensions or settings from | 10 # system mercurial installation, and may require extensions or settings from |
11 # the system installation. | 11 # the system installation. |
12 | |
13 if [ -n $HGTESTEXTRAEXTENSIONS ]; then | |
14 for extension in $HGTESTEXTRAEXTENSIONS; do | |
15 extraoptions="$extraoptions --config extensions.$extension=!" | |
16 done | |
17 fi | |
18 | |
12 syshg () { | 19 syshg () { |
13 ( | 20 ( |
14 syshgenv | 21 syshgenv |
15 exec hg "$@" | 22 exec hg "$@" |
16 ) | 23 ) |
46 # no warning nor error. | 53 # no warning nor error. |
47 if [ -n "`hg id -R "$TESTDIR/.." 2>&1 >/dev/null`" ]; then | 54 if [ -n "`hg id -R "$TESTDIR/.." 2>&1 >/dev/null`" ]; then |
48 alias testrepohg=syshg | 55 alias testrepohg=syshg |
49 alias testrepohgenv=syshgenv | 56 alias testrepohgenv=syshgenv |
50 else | 57 else |
51 alias testrepohg=hg | 58 alias testrepohg="hg $extraoptions" |
52 alias testrepohgenv=: | 59 alias testrepohgenv=: |
53 fi | 60 fi |