summaryrefslogtreecommitdiff
path: root/t/test-lib-functions.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-23 05:38:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-23 05:38:17 (GMT)
commit5002702e487dc501702b29e768b78d5c22114425 (patch)
treee4774c365eb7b74b64f33329aea5cb013200dd76 /t/test-lib-functions.sh
parente3ab3e8a3994c916bdab540ce5d49e1755223fcf (diff)
parent7d0ee47c11ffe3c63800625fcf757b05cf4b28c1 (diff)
downloadgit-5002702e487dc501702b29e768b78d5c22114425.zip
git-5002702e487dc501702b29e768b78d5c22114425.tar.gz
git-5002702e487dc501702b29e768b78d5c22114425.tar.bz2
Merge branch 'js/test-unset-prereq'
Test debugging aid. * js/test-unset-prereq: tests: introduce test_unset_prereq, for debugging
Diffstat (limited to 't/test-lib-functions.sh')
-rw-r--r--t/test-lib-functions.sh14
1 files changed, 13 insertions, 1 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index c55ef09..2b2181d 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -294,8 +294,20 @@ write_script () {
# The single parameter is the prerequisite tag (a simple word, in all
# capital letters by convention).
+test_unset_prereq () {
+ ! test_have_prereq "$1" ||
+ satisfied_prereq="${satisfied_prereq% $1 *} ${satisfied_prereq#* $1 }"
+}
+
test_set_prereq () {
- satisfied_prereq="$satisfied_prereq$1 "
+ case "$1" in
+ !*)
+ test_unset_prereq "${1#!}"
+ ;;
+ *)
+ satisfied_prereq="$satisfied_prereq$1 "
+ ;;
+ esac
}
satisfied_prereq=" "
lazily_testable_prereq= lazily_tested_prereq=