diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-05-20 02:55:00 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-20 02:55:00 +0300 |
commit | cb227d5cd65952d11354e008c97e97f4b3e59ca4 (patch) | |
tree | 11fc35748f8bd9c9b45c3b04410550a9c46f186d /t/test-lib.sh | |
parent | 02112fcb705c334311290e7699a6c0dca7585b8d (diff) | |
parent | 2d86a962203fe0faf6ae441cbe21b92a4bb03c20 (diff) |
Merge branch 'jk/test-chainlint-softer'
The "chainlint" feature in the test framework is a handy way to
catch common mistakes in writing new tests, but tends to get
expensive. An knob to selectively disable it has been introduced
to help running tests that the developer has not modified.
* jk/test-chainlint-softer:
t: avoid sed-based chain-linting in some expensive cases
Diffstat (limited to 't/test-lib.sh')
-rw-r--r-- | t/test-lib.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh index adaa2db601..adaf03543e 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -947,8 +947,11 @@ test_run_ () { trace= # 117 is magic because it is unlikely to match the exit # code of other programs - if $(printf '%s\n' "$1" | sed -f "$GIT_BUILD_DIR/t/chainlint.sed" | grep -q '?![A-Z][A-Z]*?!') || - test "OK-117" != "$(test_eval_ "(exit 117) && $1${LF}${LF}echo OK-\$?" 3>&1)" + if test "OK-117" != "$(test_eval_ "(exit 117) && $1${LF}${LF}echo OK-\$?" 3>&1)" || + { + test "${GIT_TEST_CHAIN_LINT_HARDER:-${GIT_TEST_CHAIN_LINT_HARDER_DEFAULT:-1}}" != 0 && + $(printf '%s\n' "$1" | sed -f "$GIT_BUILD_DIR/t/chainlint.sed" | grep -q '?![A-Z][A-Z]*?!') + } then BUG "broken &&-chain or run-away HERE-DOC: $1" fi |