Skip to content

Commit faac9d4

Browse files
pks-tgitster
authored andcommitted
t: stop announcing prereqs
We have a couple of cases where our tests end up announcing that a certain prerequisite is or isn't fulfilled. While this is supposed to help the developer it has the downside that it breaks the TAP format. We could convert these cases to just have a "#" prefix, but it feels rather unlikely that these are generally useful in the first place. We already do announce why a specific test is being skipped, so we should try to use this mechanism to the best extent possible. Stop announcing these prereqs to fix the TAP format. Where possible, convert the tests to rely on the prerequisites themselves to announce why a test ran or didn't ran. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8613c2b commit faac9d4

File tree

5 files changed

+14
-43
lines changed

5 files changed

+14
-43
lines changed

t/t0050-filesystem.sh

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,35 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
1010
auml=$(printf '\303\244')
1111
aumlcdiar=$(printf '\141\314\210')
1212

13-
if test_have_prereq CASE_INSENSITIVE_FS
14-
then
15-
say "will test on a case insensitive filesystem"
16-
test_case=test_expect_failure
17-
else
18-
test_case=test_expect_success
19-
fi
20-
2113
if test_have_prereq UTF8_NFD_TO_NFC
2214
then
23-
say "will test on a unicode corrupting filesystem"
2415
test_unicode=test_expect_failure
2516
else
2617
test_unicode=test_expect_success
2718
fi
2819

29-
test_have_prereq SYMLINKS ||
30-
say "will test on a filesystem lacking symbolic links"
31-
32-
if test_have_prereq CASE_INSENSITIVE_FS
33-
then
34-
test_expect_success "detection of case insensitive filesystem during repo init" '
20+
test_expect_success CASE_INSENSITIVE_FS "detection of case insensitive filesystem during repo init" '
3521
test $(git config --bool core.ignorecase) = true
3622
'
37-
else
38-
test_expect_success "detection of case insensitive filesystem during repo init" '
23+
24+
test_expect_success !CASE_INSENSITIVE_FS "detection of case insensitive filesystem during repo init" '
3925
{
4026
test_must_fail git config --bool core.ignorecase >/dev/null ||
4127
test $(git config --bool core.ignorecase) = false
4228
}
4329
'
44-
fi
4530

46-
if test_have_prereq SYMLINKS
47-
then
48-
test_expect_success "detection of filesystem w/o symlink support during repo init" '
31+
test_expect_success SYMLINKS "detection of filesystem w/o symlink support during repo init" '
4932
{
5033
test_must_fail git config --bool core.symlinks ||
5134
test "$(git config --bool core.symlinks)" = true
5235
}
5336
'
54-
else
55-
test_expect_success "detection of filesystem w/o symlink support during repo init" '
37+
38+
test_expect_success !SYMLINKS "detection of filesystem w/o symlink support during repo init" '
5639
v=$(git config --bool core.symlinks) &&
5740
test "$v" = false
5841
'
59-
fi
6042

6143
test_expect_success "setup case tests" '
6244
git config core.ignorecase true &&

t/t3600-rm.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ test_expect_success 'Initialize test directory' '
1717
git commit -m "add normal files"
1818
'
1919

20-
if test_have_prereq !FUNNYNAMES
21-
then
22-
say 'Your filesystem does not allow tabs in filenames.'
23-
fi
24-
2520
test_expect_success FUNNYNAMES 'add files with funny names' '
2621
touch -- "tab embedded" "newline${LF}embedded" &&
2722
git add -- "tab embedded" "newline${LF}embedded" &&

t/t4000-diff-format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ test_expect_success 'git diff-files -p after editing work tree.' '
3636
# that's as far as it comes
3737
if [ "$(git config --get core.filemode)" = false ]
3838
then
39-
say 'filemode disabled on the filesystem'
39+
skip_all='filemode disabled on the filesystem'
4040
test_done
4141
fi
4242

t/t9500-gitweb-standalone-no-errors.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -700,19 +700,17 @@ test_expect_success \
700700
# ----------------------------------------------------------------------
701701
# syntax highlighting
702702

703+
test_lazy_prereq HIGHLIGHT '
704+
highlight_version=$(highlight --version </dev/null 2>/dev/null) &&
705+
test -n "$highlight_version"
706+
'
703707

704-
highlight_version=$(highlight --version </dev/null 2>/dev/null)
705-
if [ $? -eq 127 ]; then
706-
say "Skipping syntax highlighting tests: 'highlight' not found"
707-
elif test -z "$highlight_version"; then
708-
say "Skipping syntax highlighting tests: incorrect 'highlight' found"
709-
else
710-
test_set_prereq HIGHLIGHT
708+
test_expect_success HIGHLIGHT '
711709
cat >>gitweb_config.perl <<-\EOF
712710
our $highlight_bin = "highlight";
713-
$feature{'highlight'}{'override'} = 1;
711+
$feature{"highlight"}{"override"} = 1;
714712
EOF
715-
fi
713+
'
716714

717715
test_expect_success HIGHLIGHT \
718716
'syntax highlighting (no highlight, unknown syntax)' \

t/t9903-bash-prompt.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ test_expect_success 'prompt - unborn branch' '
6666
test_cmp expected "$actual"
6767
'
6868

69-
if test_have_prereq !FUNNYNAMES; then
70-
say 'Your filesystem does not allow newlines in filenames.'
71-
fi
72-
7369
test_expect_success FUNNYNAMES 'prompt - with newline in path' '
7470
repo_with_newline="repo
7571
with

0 commit comments

Comments
 (0)