Mercurial > public > mercurial-scm > hg
diff 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 |
line wrap: on
line diff
--- a/tests/helpers-testrepo.sh Wed Apr 04 12:16:50 2018 -0700 +++ b/tests/helpers-testrepo.sh Wed Apr 04 13:21:34 2018 -0700 @@ -9,6 +9,13 @@ # The mercurial source repository was typically orignally cloned with the # system mercurial installation, and may require extensions or settings from # the system installation. + +if [ -n $HGTESTEXTRAEXTENSIONS ]; then + for extension in $HGTESTEXTRAEXTENSIONS; do + extraoptions="$extraoptions --config extensions.$extension=!" + done +fi + syshg () { ( syshgenv @@ -48,6 +55,6 @@ alias testrepohg=syshg alias testrepohgenv=syshgenv else - alias testrepohg=hg + alias testrepohg="hg $extraoptions" alias testrepohgenv=: fi