Skip to content

Commit 0455303

Browse files
pks-tgitster
authored andcommitted
t: fix cases where output breaks TAP format
The TAP format does not allow arbitrary output outside of a specific test case. If a test suite wants to print any such diagnostic output, then this output has to be prefixed with "#" to mark it accordingly. A bunch of our tests generate output outside of `test_expect_*` testcases anyway without such a mark, which breaks strict TAP parsers. Upon further inspection, all of the output generated by such tests is rather uninteresting. Refactor them so that we don't break the TAP format. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8613c2b commit 0455303

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

t/t1007-hash-object.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ setup_repo() {
3030

3131
test_repo=test
3232
push_repo() {
33-
test_create_repo $test_repo
33+
test_create_repo $test_repo >/dev/null
3434
cd $test_repo
3535

3636
setup_repo

t/t4041-diff-submodule-option.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ commit_file () {
4848
git commit "$@" -m "Commit $*" >/dev/null
4949
}
5050

51-
test_create_repo sm1 &&
51+
test_create_repo sm1 >/dev/null &&
5252
add_file . foo >/dev/null
5353

5454
head1=$(add_file sm1 foo1 foo2)
@@ -236,7 +236,7 @@ test_expect_success 'typechanged submodule(submodule->blob)' '
236236
'
237237

238238
rm -f sm1 &&
239-
test_create_repo sm1 &&
239+
test_create_repo sm1 >/dev/null &&
240240
head6=$(add_file sm1 foo6 foo7)
241241
fullhead6=$(cd sm1; git rev-parse --verify HEAD)
242242
test_expect_success 'nonexistent commit' '

t/t4060-diff-submodule-option-diff-format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ test_expect_success 'typechanged submodule(submodule->blob)' '
364364
'
365365

366366
rm -f sm1 &&
367-
test_create_repo sm1 &&
367+
test_create_repo sm1 >/dev/null &&
368368
head6=$(add_file sm1 foo6 foo7)
369369
test_expect_success 'nonexistent commit' '
370370
git diff-index -p --submodule=diff HEAD >actual &&

t/t7401-submodule-summary.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ commit_file () {
3838
git commit "$@" -m "Commit $*" >/dev/null
3939
}
4040

41-
test_create_repo sm1 &&
41+
test_create_repo sm1 >/dev/null &&
4242
add_file . foo >/dev/null
4343

4444
head1=$(add_file sm1 foo1 foo2)
@@ -215,7 +215,7 @@ test_expect_success 'typechanged submodule(submodule->blob)' "
215215
"
216216

217217
rm -f sm1 &&
218-
test_create_repo sm1 &&
218+
test_create_repo sm1 >/dev/null &&
219219
head6=$(add_file sm1 foo6 foo7)
220220
test_expect_success 'nonexistent commit' "
221221
git submodule summary >actual &&

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -701,13 +701,13 @@ test_expect_success \
701701
# syntax highlighting
702702

703703

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
704+
test_lazy_prereq HIGHLIGHT '
705+
highlight_version=$(highlight --version </dev/null 2>/dev/null) &&
706+
test -n "$highlight_version"
707+
'
708+
709+
if test_have_prereq HIGHLIGHT
710+
then
711711
cat >>gitweb_config.perl <<-\EOF
712712
our $highlight_bin = "highlight";
713713
$feature{'highlight'}{'override'} = 1;

0 commit comments

Comments
 (0)