]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/test-lib-functions.sh
tests: add a special setup where prerequisites fail
[thirdparty/git.git] / t / test-lib-functions.sh
index 8270de74beafb931f09f296557406c0d158d48de..0367cec5fde0514274fbd322bce0a58e1438b3e8 100644 (file)
@@ -309,6 +309,26 @@ test_unset_prereq () {
 }
 
 test_set_prereq () {
+       if test -n "$GIT_TEST_FAIL_PREREQS"
+       then
+               case "$1" in
+               # The "!" case is handled below with
+               # test_unset_prereq()
+               !*)
+                       ;;
+               # (Temporary?) whitelist of things we can't easily
+               # pretend not to support
+               SYMLINKS)
+                       ;;
+               # Inspecting whether GIT_TEST_FAIL_PREREQS is on
+               # should be unaffected.
+               FAIL_PREREQS)
+                       ;;
+               *)
+                       return
+               esac
+       fi
+
        case "$1" in
        !*)
                test_unset_prereq "${1#!}"