Skip to content

Commit 7236a34

Browse files
ramsay-jonesgitster
authored andcommitted
t9010-*.sh: skip all tests if the PIPE prereq is missing
Every test in this file, except one, is marked with the PIPE prereq. However, that lone test ('set up svn repo'), only performs some setup work and checks whether the following test should be executed (by setting an additional SVNREPO prerequisite). Since the following test also requires the PIPE prerequisite, performing the setup test, when the PIPE preequisite is missing, is simply wasted effort. Use the skip-all test facility to skip all tests when the PIPE prerequisite is missing. Signed-off-by: Ramsay Jones <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7b7bea2 commit 7236a34

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

t/t9010-svn-fe.sh

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ test_description='check svn dumpfile importer'
44

55
. ./test-lib.sh
66

7+
if test_have_prereq !PIPE
8+
then
9+
skip_all="svn dumpfile importer testing requires the PIPE prerequisite"
10+
test_done
11+
fi
12+
713
reinit_git () {
8-
if ! test_declared_prereq PIPE
9-
then
10-
echo >&4 "reinit_git: need to declare PIPE prerequisite"
11-
return 127
12-
fi
1314
rm -fr .git &&
1415
rm -f stream backflow &&
1516
git init &&
@@ -54,19 +55,19 @@ text_no_props () {
5455

5556
>empty
5657

57-
test_expect_success PIPE 'empty dump' '
58+
test_expect_success 'empty dump' '
5859
reinit_git &&
5960
echo "SVN-fs-dump-format-version: 2" >input &&
6061
try_dump input
6162
'
6263

63-
test_expect_success PIPE 'v4 dumps not supported' '
64+
test_expect_success 'v4 dumps not supported' '
6465
reinit_git &&
6566
echo "SVN-fs-dump-format-version: 4" >v4.dump &&
6667
try_dump v4.dump must_fail
6768
'
6869

69-
test_expect_failure PIPE 'empty revision' '
70+
test_expect_failure 'empty revision' '
7071
reinit_git &&
7172
printf "rev <nobody, nobody@local>: %s\n" "" "" >expect &&
7273
cat >emptyrev.dump <<-\EOF &&
@@ -86,7 +87,7 @@ test_expect_failure PIPE 'empty revision' '
8687
test_cmp expect actual
8788
'
8889

89-
test_expect_success PIPE 'empty properties' '
90+
test_expect_success 'empty properties' '
9091
reinit_git &&
9192
printf "rev <nobody, nobody@local>: %s\n" "" "" >expect &&
9293
cat >emptyprop.dump <<-\EOF &&
@@ -109,7 +110,7 @@ test_expect_success PIPE 'empty properties' '
109110
test_cmp expect actual
110111
'
111112

112-
test_expect_success PIPE 'author name and commit message' '
113+
test_expect_success 'author name and commit message' '
113114
reinit_git &&
114115
echo "<[email protected], [email protected]@local>" >expect.author &&
115116
cat >message <<-\EOF &&
@@ -143,7 +144,7 @@ test_expect_success PIPE 'author name and commit message' '
143144
test_cmp expect.author actual.author
144145
'
145146

146-
test_expect_success PIPE 'unsupported properties are ignored' '
147+
test_expect_success 'unsupported properties are ignored' '
147148
reinit_git &&
148149
echo author >expect &&
149150
cat >extraprop.dump <<-\EOF &&
@@ -168,7 +169,7 @@ test_expect_success PIPE 'unsupported properties are ignored' '
168169
test_cmp expect actual
169170
'
170171

171-
test_expect_failure PIPE 'timestamp and empty file' '
172+
test_expect_failure 'timestamp and empty file' '
172173
echo [email protected] >expect.author &&
173174
echo 1999-01-01 >expect.date &&
174175
echo file >expect.files &&
@@ -210,7 +211,7 @@ test_expect_failure PIPE 'timestamp and empty file' '
210211
test_cmp empty file
211212
'
212213

213-
test_expect_success PIPE 'directory with files' '
214+
test_expect_success 'directory with files' '
214215
reinit_git &&
215216
printf "%s\n" directory/file1 directory/file2 >expect.files &&
216217
echo hi >hi &&
@@ -263,7 +264,7 @@ test_expect_success PIPE 'directory with files' '
263264
test_cmp hi directory/file2
264265
'
265266

266-
test_expect_success PIPE 'branch name with backslash' '
267+
test_expect_success 'branch name with backslash' '
267268
reinit_git &&
268269
sort <<-\EOF >expect.branch-files &&
269270
trunk/file1
@@ -362,7 +363,7 @@ test_expect_success PIPE 'branch name with backslash' '
362363
test_cmp expect.branch-files actual.branch-files
363364
'
364365

365-
test_expect_success PIPE 'node without action' '
366+
test_expect_success 'node without action' '
366367
reinit_git &&
367368
cat >inaction.dump <<-\EOF &&
368369
SVN-fs-dump-format-version: 3
@@ -383,7 +384,7 @@ test_expect_success PIPE 'node without action' '
383384
try_dump inaction.dump must_fail
384385
'
385386

386-
test_expect_success PIPE 'action: add node without text' '
387+
test_expect_success 'action: add node without text' '
387388
reinit_git &&
388389
cat >textless.dump <<-\EOF &&
389390
SVN-fs-dump-format-version: 3
@@ -405,7 +406,7 @@ test_expect_success PIPE 'action: add node without text' '
405406
try_dump textless.dump must_fail
406407
'
407408

408-
test_expect_failure PIPE 'change file mode but keep old content' '
409+
test_expect_failure 'change file mode but keep old content' '
409410
reinit_git &&
410411
cat >expect <<-\EOF &&
411412
OBJID
@@ -481,7 +482,7 @@ test_expect_failure PIPE 'change file mode but keep old content' '
481482
test_cmp hello actual.target
482483
'
483484

484-
test_expect_success PIPE 'NUL in property value' '
485+
test_expect_success 'NUL in property value' '
485486
reinit_git &&
486487
echo "commit message" >expect.message &&
487488
{
@@ -507,7 +508,7 @@ test_expect_success PIPE 'NUL in property value' '
507508
test_cmp expect.message actual.message
508509
'
509510

510-
test_expect_success PIPE 'NUL in log message, file content, and property name' '
511+
test_expect_success 'NUL in log message, file content, and property name' '
511512
# Caveat: svnadmin 1.6.16 (r1073529) truncates at \0 in the
512513
# svn:specialQnotreally example.
513514
reinit_git &&
@@ -587,7 +588,7 @@ test_expect_success PIPE 'NUL in log message, file content, and property name' '
587588
test_cmp expect.hello2 actual.hello2
588589
'
589590

590-
test_expect_success PIPE 'change file mode and reiterate content' '
591+
test_expect_success 'change file mode and reiterate content' '
591592
reinit_git &&
592593
cat >expect <<-\EOF &&
593594
OBJID
@@ -667,7 +668,7 @@ test_expect_success PIPE 'change file mode and reiterate content' '
667668
test_cmp hello actual.target
668669
'
669670

670-
test_expect_success PIPE 'deltas supported' '
671+
test_expect_success 'deltas supported' '
671672
reinit_git &&
672673
{
673674
# (old) h + (inline) ello + (old) \n
@@ -731,7 +732,7 @@ test_expect_success PIPE 'deltas supported' '
731732
try_dump delta.dump
732733
'
733734

734-
test_expect_success PIPE 'property deltas supported' '
735+
test_expect_success 'property deltas supported' '
735736
reinit_git &&
736737
cat >expect <<-\EOF &&
737738
OBJID
@@ -796,7 +797,7 @@ test_expect_success PIPE 'property deltas supported' '
796797
test_cmp expect actual
797798
'
798799

799-
test_expect_success PIPE 'properties on /' '
800+
test_expect_success 'properties on /' '
800801
reinit_git &&
801802
cat <<-\EOF >expect &&
802803
OBJID
@@ -850,7 +851,7 @@ test_expect_success PIPE 'properties on /' '
850851
test_cmp expect actual
851852
'
852853

853-
test_expect_success PIPE 'deltas for typechange' '
854+
test_expect_success 'deltas for typechange' '
854855
reinit_git &&
855856
cat >expect <<-\EOF &&
856857
OBJID
@@ -935,7 +936,7 @@ test_expect_success PIPE 'deltas for typechange' '
935936
test_cmp expect actual
936937
'
937938

938-
test_expect_success PIPE 'deltas need not consume the whole preimage' '
939+
test_expect_success 'deltas need not consume the whole preimage' '
939940
reinit_git &&
940941
cat >expect <<-\EOF &&
941942
OBJID
@@ -1040,7 +1041,7 @@ test_expect_success PIPE 'deltas need not consume the whole preimage' '
10401041
test_cmp expect.3 actual.3
10411042
'
10421043

1043-
test_expect_success PIPE 'no hang for delta trying to read past end of preimage' '
1044+
test_expect_success 'no hang for delta trying to read past end of preimage' '
10441045
reinit_git &&
10451046
{
10461047
# COPY 1
@@ -1087,7 +1088,7 @@ test_expect_success 'set up svn repo' '
10871088
fi
10881089
'
10891090

1090-
test_expect_success SVNREPO,PIPE 't9135/svn.dump' '
1091+
test_expect_success SVNREPO 't9135/svn.dump' '
10911092
mkdir -p simple-git &&
10921093
(
10931094
cd simple-git &&

0 commit comments

Comments
 (0)