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 <ramsay@ramsayjones.plus.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramsay Jones committed
Sep 17, 2017 at 23:58 UTC
7236a34c984de7027efbc8a03403598f01f173a2
1 file changed
+28
-27
t/t9010-svn-fe.sh
+28
-27
@@ -4,12 +4,13 @@ test_description='check svn dumpfile importer'
4
5
. ./test-lib.sh
6
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
+
13
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
14
rm -fr .git &&
15
rm -f stream backflow &&
16
git init &&
@@ -54,19 +55,19 @@ text_no_props () {
55
56
>empty
57
57
-test_expect_success PIPE 'empty dump' '
58
+test_expect_success 'empty dump' '
59
reinit_git &&
60
echo "SVN-fs-dump-format-version: 2" >input &&
61
try_dump input
62
'
63
63
-test_expect_success PIPE 'v4 dumps not supported' '
64
+test_expect_success 'v4 dumps not supported' '
65
reinit_git &&
66
echo "SVN-fs-dump-format-version: 4" >v4.dump &&
67
try_dump v4.dump must_fail
68
'
69
69
-test_expect_failure PIPE 'empty revision' '
70
+test_expect_failure 'empty revision' '
71
reinit_git &&
72
printf "rev <nobody, nobody@local>: %s\n" "" "" >expect &&
73
cat >emptyrev.dump <<-\EOF &&
@@ -86,7 +87,7 @@ test_expect_failure PIPE 'empty revision' '
87
test_cmp expect actual
88
'
89
89
-test_expect_success PIPE 'empty properties' '
90
+test_expect_success 'empty properties' '
91
reinit_git &&
92
printf "rev <nobody, nobody@local>: %s\n" "" "" >expect &&
93
cat >emptyprop.dump <<-\EOF &&
@@ -109,7 +110,7 @@ test_expect_success PIPE 'empty properties' '
110
test_cmp expect actual
111
'
112
112
-test_expect_success PIPE 'author name and commit message' '
113
+test_expect_success 'author name and commit message' '
114
reinit_git &&
115
echo "<author@example.com, author@example.com@local>" >expect.author &&
116
cat >message <<-\EOF &&
@@ -143,7 +144,7 @@ test_expect_success PIPE 'author name and commit message' '
144
test_cmp expect.author actual.author
145
'
146
146
-test_expect_success PIPE 'unsupported properties are ignored' '
147
+test_expect_success 'unsupported properties are ignored' '
148
reinit_git &&
149
echo author >expect &&
150
cat >extraprop.dump <<-\EOF &&
@@ -168,7 +169,7 @@ test_expect_success PIPE 'unsupported properties are ignored' '
169
test_cmp expect actual
170
'
171
171
-test_expect_failure PIPE 'timestamp and empty file' '
172
+test_expect_failure 'timestamp and empty file' '
173
echo author@example.com >expect.author &&
174
echo 1999-01-01 >expect.date &&
175
echo file >expect.files &&
@@ -210,7 +211,7 @@ test_expect_failure PIPE 'timestamp and empty file' '
211
test_cmp empty file
212
'
213
213
-test_expect_success PIPE 'directory with files' '
214
+test_expect_success 'directory with files' '
215
reinit_git &&
216
printf "%s\n" directory/file1 directory/file2 >expect.files &&
217
echo hi >hi &&
@@ -263,7 +264,7 @@ test_expect_success PIPE 'directory with files' '
264
test_cmp hi directory/file2
265
'
266
266
-test_expect_success PIPE 'branch name with backslash' '
267
+test_expect_success 'branch name with backslash' '
268
reinit_git &&
269
sort <<-\EOF >expect.branch-files &&
270
trunk/file1
@@ -362,7 +363,7 @@ test_expect_success PIPE 'branch name with backslash' '
363
test_cmp expect.branch-files actual.branch-files
364
'
365
365
-test_expect_success PIPE 'node without action' '
366
+test_expect_success 'node without action' '
367
reinit_git &&
368
cat >inaction.dump <<-\EOF &&
369
SVN-fs-dump-format-version: 3
@@ -383,7 +384,7 @@ test_expect_success PIPE 'node without action' '
384
try_dump inaction.dump must_fail
385
'
386
386
-test_expect_success PIPE 'action: add node without text' '
387
+test_expect_success 'action: add node without text' '
388
reinit_git &&
389
cat >textless.dump <<-\EOF &&
390
SVN-fs-dump-format-version: 3
@@ -405,7 +406,7 @@ test_expect_success PIPE 'action: add node without text' '
406
try_dump textless.dump must_fail
407
'
408
408
-test_expect_failure PIPE 'change file mode but keep old content' '
409
+test_expect_failure 'change file mode but keep old content' '
410
reinit_git &&
411
cat >expect <<-\EOF &&
412
OBJID
@@ -481,7 +482,7 @@ test_expect_failure PIPE 'change file mode but keep old content' '
482
test_cmp hello actual.target
483
'
484
484
-test_expect_success PIPE 'NUL in property value' '
485
+test_expect_success 'NUL in property value' '
486
reinit_git &&
487
echo "commit message" >expect.message &&
488
{
@@ -507,7 +508,7 @@ test_expect_success PIPE 'NUL in property value' '
508
test_cmp expect.message actual.message
509
'
510
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' '
512
# Caveat: svnadmin 1.6.16 (r1073529) truncates at \0 in the
513
# svn:specialQnotreally example.
514
reinit_git &&
@@ -587,7 +588,7 @@ test_expect_success PIPE 'NUL in log message, file content, and property name' '
588
test_cmp expect.hello2 actual.hello2
589
'
590
590
-test_expect_success PIPE 'change file mode and reiterate content' '
591
+test_expect_success 'change file mode and reiterate content' '
592
reinit_git &&
593
cat >expect <<-\EOF &&
594
OBJID
@@ -667,7 +668,7 @@ test_expect_success PIPE 'change file mode and reiterate content' '
668
test_cmp hello actual.target
669
'
670
670
-test_expect_success PIPE 'deltas supported' '
671
+test_expect_success 'deltas supported' '
672
reinit_git &&
673
{
674
# (old) h + (inline) ello + (old) \n
@@ -731,7 +732,7 @@ test_expect_success PIPE 'deltas supported' '
732
try_dump delta.dump
733
'
734
734
-test_expect_success PIPE 'property deltas supported' '
735
+test_expect_success 'property deltas supported' '
736
reinit_git &&
737
cat >expect <<-\EOF &&
738
OBJID
@@ -796,7 +797,7 @@ test_expect_success PIPE 'property deltas supported' '
797
test_cmp expect actual
798
'
799
799
-test_expect_success PIPE 'properties on /' '
800
+test_expect_success 'properties on /' '
801
reinit_git &&
802
cat <<-\EOF >expect &&
803
OBJID
@@ -850,7 +851,7 @@ test_expect_success PIPE 'properties on /' '
851
test_cmp expect actual
852
'
853
853
-test_expect_success PIPE 'deltas for typechange' '
854
+test_expect_success 'deltas for typechange' '
855
reinit_git &&
856
cat >expect <<-\EOF &&
857
OBJID
@@ -935,7 +936,7 @@ test_expect_success PIPE 'deltas for typechange' '
936
test_cmp expect actual
937
'
938
938
-test_expect_success PIPE 'deltas need not consume the whole preimage' '
939
+test_expect_success 'deltas need not consume the whole preimage' '
940
reinit_git &&
941
cat >expect <<-\EOF &&
942
OBJID
@@ -1040,7 +1041,7 @@ test_expect_success PIPE 'deltas need not consume the whole preimage' '
1041
test_cmp expect.3 actual.3
1042
'
1043
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' '
1045
reinit_git &&
1046
{
1047
# COPY 1
@@ -1087,7 +1088,7 @@ test_expect_success 'set up svn repo' '
1088
fi
1089
'
1090
1090
-test_expect_success SVNREPO,PIPE 't9135/svn.dump' '
1091
+test_expect_success SVNREPO 't9135/svn.dump' '
1092
mkdir -p simple-git &&
1093
(
1094
cd simple-git &&