]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib.sh
test: skip all subtests if external dependencies are missing during init
[notmuch] / test / test-lib.sh
index 0996a7426442cca7ab4c1913fa7612a88e6ce767..99b9e8b8096386484f27fea028e75292a93e1007 100644 (file)
@@ -657,7 +657,8 @@ test_check_missing_external_prereqs_ () {
 
 test_report_skip_ () {
        test_reset_state_
-       say_color skip >&3 "skipping test: $@"
+       say_color skip >&3 "skipping test:"
+       echo " $@" >&3
        say_color skip "%-6s" "SKIP"
        echo " $1"
 }
@@ -901,10 +902,20 @@ test_emacs () {
 }
 
 test_reset_state_ () {
+       test -z "$test_init_done_" && test_init_
+
        test_subtest_known_broken_=
        test_subtest_missing_external_prereqs_=
 }
 
+# called once before the first subtest
+test_init_ () {
+       test_init_done_=t
+
+       # skip all tests if there were external prerequisites missing during init
+       test_check_missing_external_prereqs_ "all tests in $this_test" && test_done
+}
+
 
 find_notmuch_path ()
 {