summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-05-23 14:38:17 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-05-23 14:38:17 +0900
commit5002702e487dc501702b29e768b78d5c22114425 (patch)
treee4774c365eb7b74b64f33329aea5cb013200dd76 /t
parentMerge branch 'ab/perl-python-attrs' (diff)
parenttests: introduce test_unset_prereq, for debugging (diff)
downloadtgif-5002702e487dc501702b29e768b78d5c22114425.tar.xz
Merge branch 'js/test-unset-prereq'
Test debugging aid. * js/test-unset-prereq: tests: introduce test_unset_prereq, for debugging
Diffstat (limited to 't')
-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 c55ef099c3..2b2181dca0 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=