tests: Skip tests in a way that makes sense under TAP
SKIP messages are now part of the TAP plan. A TAP harness now knows why a particular test was skipped and can report that information. The non-TAP harness built into Git's test-lib did nothing special with these messages, and is unaffected by these changes. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Jun 24, 2010 at 17:44 UTC
fadb5156e485e9d25c89d4b4f96c2d4fe6db6187
40 files changed
+56
-54
t/lib-git-svn.sh
+2
-2
@@ -5,11 +5,11 @@ git_svn_id=git""-svn-id
5
6
if test -n "$NO_SVN_TESTS"
7
then
8
- say 'skipping git svn tests, NO_SVN_TESTS defined'
8
+ skip_all='skipping git svn tests, NO_SVN_TESTS defined'
9
test_done
10
fi
11
if ! test_have_prereq PERL; then
12
- say 'skipping git svn tests, perl not available'
12
+ skip_all='skipping git svn tests, perl not available'
13
test_done
14
fi
15
t/lib-httpd.sh
+1
-2
@@ -5,8 +5,7 @@
5
6
if test -z "$GIT_TEST_HTTPD"
7
then
8
- say "skipping test, network testing disabled by default"
9
- say "(define GIT_TEST_HTTPD to enable)"
8
+ skip_all="Network testing disabled (define GIT_TEST_HTTPD to enable)"
9
test_done
10
fi
11
t/t1304-default-acl.sh
+6
-3
@@ -15,9 +15,12 @@ umask 077
15
# is a good candidate: exists on all unices, and it has permission
16
# anyway, so we don't create a security hole running the testsuite.
17
18
-if ! setfacl -m u:root:rwx .; then
19
- say "Skipping ACL tests: unable to use setfacl"
20
- test_done
18
+setfacl_out="$(setfacl -m u:root:rwx . 2>&1)"
19
+setfacl_ret=$?
20
+
21
+if [ $setfacl_ret != 0 ]; then
22
+ skip_all="Skipping ACL tests: unable to use setfacl (output: '$setfacl_out'; return code: '$setfacl_ret')"
23
+ test_done
24
fi
25
26
check_perms_and_acl () {
t/t1509-root-worktree.sh
+3
-3
@@ -99,17 +99,17 @@ test_foobar_foobar() {
99
}
100
101
if ! test_have_prereq POSIXPERM || ! [ -w / ]; then
102
- say "Dangerous test skipped. Read this test if you want to execute it"
102
+ skip_all="Dangerous test skipped. Read this test if you want to execute it"
103
test_done
104
fi
105
106
if [ "$IKNOWWHATIAMDOING" != "YES" ]; then
107
- say "You must set env var IKNOWWHATIAMDOING=YES in order to run this test"
107
+ skip_all="You must set env var IKNOWWHATIAMDOING=YES in order to run this test"
108
test_done
109
fi
110
111
if [ "$UID" = 0 ]; then
112
- say "No you can't run this with root"
112
+ skip_all="No you can't run this with root"
113
test_done
114
fi
115
t/t2007-checkout-symlink.sh
+1
-1
@@ -8,7 +8,7 @@ test_description='git checkout to switch between branches with symlink<->dir'
8
9
if ! test_have_prereq SYMLINKS
10
then
11
- say "symbolic links not supported - skipping tests"
11
+ skip_all="symbolic links not supported - skipping tests"
12
test_done
13
fi
14
t/t3300-funny-names.sh
+1
-1
@@ -26,7 +26,7 @@ echo 'Foo Bar Baz' >"$p2"
26
27
test -f "$p1" && cmp "$p0" "$p1" || {
28
# since FAT/NTFS does not allow tabs in filenames, skip this test
29
- say 'Your filesystem does not allow tabs in filenames, test skipped.'
29
+ skip_all='Your filesystem does not allow tabs in filenames, test skipped.'
30
test_done
31
}
32
t/t3302-notes-index-expensive.sh
+1
-1
@@ -8,7 +8,7 @@ test_description='Test commit notes index (expensive!)'
8
. ./test-lib.sh
9
10
test -z "$GIT_NOTES_TIMING_TESTS" && {
11
- say Skipping timing tests
11
+ skip_all="Skipping timing tests"
12
test_done
13
exit
14
}
t/t3600-rm.sh
+1
-1
@@ -39,7 +39,7 @@ if test -f test-file
39
then
40
test_set_prereq RO_DIR
41
else
42
- say 'skipping removal failure test (perhaps running as root?)'
42
+ skip_all='skipping removal failure test (perhaps running as root?)'
43
fi
44
chmod 775 .
45
rm -f test-file
t/t3701-add-interactive.sh
+2
-2
@@ -4,7 +4,7 @@ test_description='add -i basic tests'
4
. ./test-lib.sh
5
6
if ! test_have_prereq PERL; then
7
- say 'skipping git add -i tests, perl not available'
7
+ skip_all='skipping git add -i tests, perl not available'
8
test_done
9
fi
10
@@ -154,7 +154,7 @@ rm -f .gitignore
154
155
if test "$(git config --bool core.filemode)" = false
156
then
157
- say 'skipping filemode tests (filesystem does not properly support modes)'
157
+ say '# skipping filemode tests (filesystem does not properly support modes)'
158
else
159
test_set_prereq FILEMODE
160
fi
t/t3902-quoted.sh
+1
-1
@@ -17,7 +17,7 @@ DQ='"'
17
echo foo 2>/dev/null > "Name and an${HT}HT"
18
test -f "Name and an${HT}HT" || {
19
# since FAT/NTFS does not allow tabs in filenames, skip this test
20
- say 'Your filesystem does not allow tabs in filenames, test skipped.'
20
+ skip_all='Your filesystem does not allow tabs in filenames, test skipped.'
21
test_done
22
}
23
t/t4004-diff-rename-symlink.sh
+1
-1
@@ -14,7 +14,7 @@ by an edit for them.
14
15
if ! test_have_prereq SYMLINKS
16
then
17
- say 'Symbolic links not supported, skipping tests.'
17
+ skip_all='Symbolic links not supported, skipping tests.'
18
test_done
19
fi
20
t/t4011-diff-symlink.sh
+1
-1
@@ -11,7 +11,7 @@ test_description='Test diff of symlinks.
11
12
if ! test_have_prereq SYMLINKS
13
then
14
- say 'Symbolic links not supported, skipping tests.'
14
+ skip_all='Symbolic links not supported, skipping tests.'
15
test_done
16
fi
17
t/t4016-diff-quote.sh
+1
-1
@@ -14,7 +14,7 @@ P2='pathname with SP'
14
P3='pathname
15
with LF'
16
: 2>/dev/null >"$P1" && test -f "$P1" && rm -f "$P1" || {
17
- say 'Your filesystem does not allow tabs in filenames, test skipped.'
17
+ skip_all='Your filesystem does not allow tabs in filenames, test skipped.'
18
test_done
19
}
20
t/t4023-diff-rename-typechange.sh
+1
-1
@@ -6,7 +6,7 @@ test_description='typechange rename detection'
6
7
if ! test_have_prereq SYMLINKS
8
then
9
- say 'Symbolic links not supported, skipping tests.'
9
+ skip_all='Symbolic links not supported, skipping tests.'
10
test_done
11
fi
12
t/t4114-apply-typechange.sh
+1
-1
@@ -11,7 +11,7 @@ test_description='git apply should not get confused with type changes.
11
12
if ! test_have_prereq SYMLINKS
13
then
14
- say 'Symbolic links not supported, skipping tests.'
14
+ skip_all='Symbolic links not supported, skipping tests.'
15
test_done
16
fi
17
t/t4115-apply-symlink.sh
+1
-1
@@ -11,7 +11,7 @@ test_description='git apply symlinks and partial files
11
12
if ! test_have_prereq SYMLINKS
13
then
14
- say 'Symbolic links not supported, skipping tests.'
14
+ skip_all='Symbolic links not supported, skipping tests.'
15
test_done
16
fi
17
t/t4122-apply-symlink-inside.sh
+1
-1
@@ -5,7 +5,7 @@ test_description='apply to deeper directory without getting fooled with symlink'
5
6
if ! test_have_prereq SYMLINKS
7
then
8
- say 'Symbolic links not supported, skipping tests.'
8
+ skip_all='Symbolic links not supported, skipping tests.'
9
test_done
10
fi
11
t/t5302-pack-index.sh
+1
-1
@@ -74,7 +74,7 @@ if msg=$(git verify-pack -v "test-3-${pack3}.pack" 2>&1) ||
74
then
75
test_set_prereq OFF64_T
76
else
77
- say "skipping tests concerning 64-bit offsets"
77
+ say "# skipping tests concerning 64-bit offsets"
78
fi
79
80
test_expect_success OFF64_T \
t/t5503-tagfollow.sh
+1
-1
@@ -6,7 +6,7 @@ test_description='test automatic tag following'
6
7
case $(uname -s) in
8
*MINGW*)
9
- say "GIT_DEBUG_SEND_PACK not supported - skipping tests"
9
+ skip_all="GIT_DEBUG_SEND_PACK not supported - skipping tests"
10
test_done
11
esac
12
t/t5522-pull-symlink.sh
+1
-1
@@ -6,7 +6,7 @@ test_description='pulling from symlinked subdir'
6
7
if ! test_have_prereq SYMLINKS
8
then
9
- say 'Symbolic links not supported, skipping tests.'
9
+ skip_all='Symbolic links not supported, skipping tests.'
10
test_done
11
fi
12
t/t5540-http-push.sh
+1
-1
@@ -11,7 +11,7 @@ This test runs various sanity checks on http-push.'
11
12
if git http-push > /dev/null 2>&1 || [ $? -eq 128 ]
13
then
14
- say "skipping test, USE_CURL_MULTI is not defined"
14
+ skip_all="skipping test, USE_CURL_MULTI is not defined"
15
test_done
16
fi
17
t/t5541-http-push.sh
+1
-1
@@ -7,7 +7,7 @@ test_description='test smart pushing over http via http-backend'
7
. ./test-lib.sh
8
9
if test -n "$NO_CURL"; then
10
- say 'skipping test, git built without http support'
10
+ skip_all='skipping test, git built without http support'
11
test_done
12
fi
13
t/t5550-http-fetch.sh
+1
-1
@@ -4,7 +4,7 @@ test_description='test dumb fetching over http via static file'
4
. ./test-lib.sh
5
6
if test -n "$NO_CURL"; then
7
- say 'skipping test, git built without http support'
7
+ skip_all='skipping test, git built without http support'
8
test_done
9
fi
10
t/t5551-http-fetch.sh
+1
-1
@@ -4,7 +4,7 @@ test_description='test smart fetching over http via http-backend'
4
. ./test-lib.sh
5
6
if test -n "$NO_CURL"; then
7
- say 'skipping test, git built without http support'
7
+ skip_all='skipping test, git built without http support'
8
test_done
9
fi
10
t/t5561-http-backend.sh
+1
-1
@@ -4,7 +4,7 @@ test_description='test git-http-backend'
4
. ./test-lib.sh
5
6
if test -n "$NO_CURL"; then
7
- say 'skipping test, git built without http support'
7
+ skip_all='skipping test, git built without http support'
8
test_done
9
fi
10
t/t5705-clone-2gb.sh
+1
-1
@@ -4,7 +4,7 @@ test_description='Test cloning a repository larger than 2 gigabyte'
4
. ./test-lib.sh
5
6
test -z "$GIT_TEST_CLONE_2GB" &&
7
-say "Skipping expensive 2GB clone test; enable it with GIT_TEST_CLONE_2GB=t" &&
7
+skip_all="Skipping expensive 2GB clone test; enable it with GIT_TEST_CLONE_2GB=t" &&
8
test_done &&
9
exit
10
t/t6035-merge-dir-to-symlink.sh
+1
-1
@@ -5,7 +5,7 @@ test_description='merging when a directory was replaced with a symlink'
5
6
if ! test_have_prereq SYMLINKS
7
then
8
- say 'Symbolic links not supported, skipping tests.'
8
+ skip_all='Symbolic links not supported, skipping tests.'
9
test_done
10
fi
11
t/t7004-tag.sh
+1
-1
@@ -583,7 +583,7 @@ test_expect_success \
583
# subsequent tests require gpg; check if it is available
584
gpg --version >/dev/null 2>/dev/null
585
if [ $? -eq 127 ]; then
586
- say "gpg not found - skipping tag signing and verification tests"
586
+ say "# gpg not found - skipping tag signing and verification tests"
587
else
588
# As said here: http://www.gnupg.org/documentation/faqs.html#q6.19
589
# the gpg version 1.0.6 didn't parse trust packets correctly, so for
t/t7006-pager.sh
+1
-1
@@ -36,7 +36,7 @@ then
36
}
37
test_set_prereq TTY
38
else
39
- say no usable terminal, so skipping some tests
39
+ say "# no usable terminal, so skipping some tests"
40
fi
41
42
test_expect_success 'setup' '
t/t7800-difftool.sh
+1
-1
@@ -11,7 +11,7 @@ Testing basic diff tool invocation
11
. ./test-lib.sh
12
13
if ! test_have_prereq PERL; then
14
- say 'skipping difftool tests, perl not available'
14
+ skip_all='skipping difftool tests, perl not available'
15
test_done
16
fi
17
t/t9001-send-email.sh
+2
-2
@@ -4,7 +4,7 @@ test_description='git send-email'
4
. ./test-lib.sh
5
6
if ! test_have_prereq PERL; then
7
- say 'skipping git send-email tests, perl not available'
7
+ skip_all='skipping git send-email tests, perl not available'
8
test_done
9
fi
10
@@ -58,7 +58,7 @@ test_no_confirm () {
58
# Exit immediately to prevent hang if a no-confirm test fails
59
check_no_confirm () {
60
test -f no_confirm_okay || {
61
- say 'No confirm test failed; skipping remaining tests to prevent hanging'
61
+ skip_all='confirm test failed; skipping remaining tests to prevent hanging'
62
test_done
63
}
64
}
t/t9100-git-svn-basic.sh
+1
-1
@@ -15,7 +15,7 @@ case "$GIT_SVN_LC_ALL" in
15
test_set_prereq UTF8
16
;;
17
*)
18
- say "UTF-8 locale not set, some tests skipped ($GIT_SVN_LC_ALL)"
18
+ say "# UTF-8 locale not set, some tests skipped ($GIT_SVN_LC_ALL)"
19
;;
20
esac
21
t/t9119-git-svn-info.sh
+1
-1
@@ -13,7 +13,7 @@ case $v in
13
1.[456].*)
14
;;
15
*)
16
- say "skipping svn-info test (SVN version: $v not supported)"
16
+ skip_all="skipping svn-info test (SVN version: $v not supported)"
17
test_done
18
;;
19
esac
t/t9129-git-svn-i18n-commitencoding.sh
+1
-1
@@ -23,7 +23,7 @@ if test -n "$a_utf8_locale"
23
then
24
test_set_prereq UTF8
25
else
26
- say "UTF-8 locale not available, some tests are skipped"
26
+ say "# UTF-8 locale not available, some tests are skipped"
27
fi
28
29
compare_svn_head_with () {
t/t9143-git-svn-gc.sh
+1
-1
@@ -43,7 +43,7 @@ then
43
gunzip .git/svn/refs/remotes/git-svn/unhandled.log.gz
44
'
45
else
46
- say "Perl Compress::Zlib unavailable, skipping gunzip test"
46
+ say "# Perl Compress::Zlib unavailable, skipping gunzip test"
47
fi
48
49
test_expect_success 'git svn gc does not change unhandled.log files' '
t/t9200-git-cvsexportcommit.sh
+2
-2
@@ -7,14 +7,14 @@ test_description='Test export of commits to CVS'
7
. ./test-lib.sh
8
9
if ! test_have_prereq PERL; then
10
- say 'skipping git cvsexportcommit tests, perl not available'
10
+ skip_all='skipping git cvsexportcommit tests, perl not available'
11
test_done
12
fi
13
14
cvs >/dev/null 2>&1
15
if test $? -ne 1
16
then
17
- say 'skipping git cvsexportcommit tests, cvs not found'
17
+ skip_all='skipping git cvsexportcommit tests, cvs not found'
18
test_done
19
fi
20
t/t9400-git-cvsserver-server.sh
+3
-3
@@ -11,17 +11,17 @@ cvs CLI client via git-cvsserver server'
11
. ./test-lib.sh
12
13
if ! test_have_prereq PERL; then
14
- say 'skipping git cvsserver tests, perl not available'
14
+ skip_all='skipping git cvsserver tests, perl not available'
15
test_done
16
fi
17
cvs >/dev/null 2>&1
18
if test $? -ne 1
19
then
20
- say 'skipping git-cvsserver tests, cvs not found'
20
+ skip_all='skipping git-cvsserver tests, cvs not found'
21
test_done
22
fi
23
"$PERL_PATH" -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
24
- say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'
24
+ skip_all='skipping git-cvsserver tests, Perl SQLite interface unavailable'
25
test_done
26
}
27
t/t9401-git-cvsserver-crlf.sh
+3
-3
@@ -41,16 +41,16 @@ not_present() {
41
cvs >/dev/null 2>&1
42
if test $? -ne 1
43
then
44
- say 'skipping git-cvsserver tests, cvs not found'
44
+ skip_all='skipping git-cvsserver tests, cvs not found'
45
test_done
46
fi
47
if ! test_have_prereq PERL
48
then
49
- say 'skipping git-cvsserver tests, perl not available'
49
+ skip_all='skipping git-cvsserver tests, perl not available'
50
test_done
51
fi
52
"$PERL_PATH" -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
53
- say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'
53
+ skip_all='skipping git-cvsserver tests, Perl SQLite interface unavailable'
54
test_done
55
}
56
t/t9600-cvsimport.sh
+1
-1
@@ -4,7 +4,7 @@ test_description='git cvsimport basic tests'
4
. ./lib-cvs.sh
5
6
if ! test_have_prereq PERL; then
7
- say 'skipping git cvsimport tests, perl not available'
7
+ skip_all='skipping git cvsimport tests, perl not available'
8
test_done
9
fi
10
t/t9700-perl-git.sh
+2
-2
@@ -7,12 +7,12 @@ test_description='perl interface (Git.pm)'
7
. ./test-lib.sh
8
9
if ! test_have_prereq PERL; then
10
- say 'skipping perl interface tests, perl not available'
10
+ skip_all='skipping perl interface tests, perl not available'
11
test_done
12
fi
13
14
"$PERL_PATH" -MTest::More -e 0 2>/dev/null || {
15
- say "Perl Test::More unavailable, skipping test"
15
+ skip_all="Perl Test::More unavailable, skipping test"
16
test_done
17
}
18