t0303: immediately bail out w/o GIT_TEST_CREDENTIAL_HELPER
t0300-credential-helpers.sh requires GIT_TEST_CREDENTIAL_HELPER to be configured to do something sensible. If it is not set, prove will say: ./t0303-credential-external.sh .. skipped: (no reason given) which isn't very nice. Use skip_all="..." && test_done to bail out immediately and provide a nicer message. In case GIT_TEST_CREDENTIAL_HELPER is set, but the timeout tests are skipped, mention GIT_TEST_CREDENTIAL_HELPER_TIMEOUT. Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Zbigniew Jędrzejewski-Szmek committed
Mar 15, 2012 at 12:08 UTC
16e44810c9602bd7ed494f24c27eec193ff6a674
1 file changed
+16
-23
t/t0303-credential-external.sh
+16
-23
@@ -4,36 +4,29 @@ test_description='external credential helper tests'
4
. ./test-lib.sh
5
. "$TEST_DIRECTORY"/lib-credential.sh
6
7
-pre_test() {
8
- test -z "$GIT_TEST_CREDENTIAL_HELPER_SETUP" ||
9
- eval "$GIT_TEST_CREDENTIAL_HELPER_SETUP"
7
+if test -z "$GIT_TEST_CREDENTIAL_HELPER"; then
8
+ skip_all="used to test external credential helpers"
9
+ test_done
10
+fi
11
11
- # clean before the test in case there is cruft left
12
- # over from a previous run that would impact results
13
- helper_test_clean "$GIT_TEST_CREDENTIAL_HELPER"
14
-}
12
+test -z "$GIT_TEST_CREDENTIAL_HELPER_SETUP" ||
13
+ eval "$GIT_TEST_CREDENTIAL_HELPER_SETUP"
14
16
-post_test() {
17
- # clean afterwards so that we are good citizens
18
- # and don't leave cruft in the helper's storage, which
19
- # might be long-term system storage
20
- helper_test_clean "$GIT_TEST_CREDENTIAL_HELPER"
21
-}
15
+# clean before the test in case there is cruft left
16
+# over from a previous run that would impact results
17
+helper_test_clean "$GIT_TEST_CREDENTIAL_HELPER"
18
23
-if test -z "$GIT_TEST_CREDENTIAL_HELPER"; then
24
- say "# skipping external helper tests (set GIT_TEST_CREDENTIAL_HELPER)"
25
-else
26
- pre_test
27
- helper_test "$GIT_TEST_CREDENTIAL_HELPER"
28
- post_test
29
-fi
19
+helper_test "$GIT_TEST_CREDENTIAL_HELPER"
20
21
if test -z "$GIT_TEST_CREDENTIAL_HELPER_TIMEOUT"; then
32
- say "# skipping external helper timeout tests"
22
+ say "# skipping timeout tests (GIT_TEST_CREDENTIAL_HELPER_TIMEOUT not set)"
23
else
34
- pre_test
24
helper_test_timeout "$GIT_TEST_CREDENTIAL_HELPER_TIMEOUT"
36
- post_test
25
fi
26
27
+# clean afterwards so that we are good citizens
28
+# and don't leave cruft in the helper's storage, which
29
+# might be long-term system storage
30
+helper_test_clean "$GIT_TEST_CREDENTIAL_HELPER"
31
+
32
test_done