t/t7800-difftool.sh: Skip with prereq on no PERL
Change t/t7800-difftool.sh to to skip with the the three-arg prereq form of test_expect_success instead of bailing out. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Jul 28, 2010 at 10:34 UTC
2c4f302607070c44b1bb1beca26ab4653a604baf
1 file changed
+22
-27
t/t7800-difftool.sh
+22
-27
@@ -10,11 +10,6 @@ Testing basic diff tool invocation
10
11
. ./test-lib.sh
12
13
-if ! test_have_prereq PERL; then
14
- skip_all='skipping difftool tests, perl not available'
15
- test_done
16
-fi
17
-
13
LF='
14
'
15
@@ -50,7 +45,7 @@ prompt_given()
45
}
46
47
# Create a file on master and change it on branch
53
-test_expect_success 'setup' '
48
+test_expect_success PERL 'setup' '
49
echo master >file &&
50
git add file &&
51
git commit -m "added file" &&
@@ -62,7 +57,7 @@ test_expect_success 'setup' '
57
'
58
59
# Configure a custom difftool.<tool>.cmd and use it
65
-test_expect_success 'custom commands' '
60
+test_expect_success PERL 'custom commands' '
61
restore_test_defaults &&
62
git config difftool.test-tool.cmd "cat \$REMOTE" &&
63
@@ -75,13 +70,13 @@ test_expect_success 'custom commands' '
70
'
71
72
# Ensures that git-difftool ignores bogus --tool values
78
-test_expect_success 'difftool ignores bad --tool values' '
73
+test_expect_success PERL 'difftool ignores bad --tool values' '
74
diff=$(git difftool --no-prompt --tool=bad-tool branch)
75
test "$?" = 1 &&
76
test "$diff" = ""
77
'
78
84
-test_expect_success 'difftool honors --gui' '
79
+test_expect_success PERL 'difftool honors --gui' '
80
git config merge.tool bogus-tool &&
81
git config diff.tool bogus-tool &&
82
git config diff.guitool test-tool &&
@@ -92,7 +87,7 @@ test_expect_success 'difftool honors --gui' '
87
restore_test_defaults
88
'
89
95
-test_expect_success 'difftool --gui works without configured diff.guitool' '
90
+test_expect_success PERL 'difftool --gui works without configured diff.guitool' '
91
git config diff.tool test-tool &&
92
93
diff=$(git difftool --no-prompt --gui branch) &&
@@ -102,7 +97,7 @@ test_expect_success 'difftool --gui works without configured diff.guitool' '
97
'
98
99
# Specify the diff tool using $GIT_DIFF_TOOL
105
-test_expect_success 'GIT_DIFF_TOOL variable' '
100
+test_expect_success PERL 'GIT_DIFF_TOOL variable' '
101
git config --unset diff.tool
102
GIT_DIFF_TOOL=test-tool &&
103
export GIT_DIFF_TOOL &&
@@ -115,7 +110,7 @@ test_expect_success 'GIT_DIFF_TOOL variable' '
110
111
# Test the $GIT_*_TOOL variables and ensure
112
# that $GIT_DIFF_TOOL always wins unless --tool is specified
118
-test_expect_success 'GIT_DIFF_TOOL overrides' '
113
+test_expect_success PERL 'GIT_DIFF_TOOL overrides' '
114
git config diff.tool bogus-tool &&
115
git config merge.tool bogus-tool &&
116
@@ -136,7 +131,7 @@ test_expect_success 'GIT_DIFF_TOOL overrides' '
131
132
# Test that we don't have to pass --no-prompt to difftool
133
# when $GIT_DIFFTOOL_NO_PROMPT is true
139
-test_expect_success 'GIT_DIFFTOOL_NO_PROMPT variable' '
134
+test_expect_success PERL 'GIT_DIFFTOOL_NO_PROMPT variable' '
135
GIT_DIFFTOOL_NO_PROMPT=true &&
136
export GIT_DIFFTOOL_NO_PROMPT &&
137
@@ -148,7 +143,7 @@ test_expect_success 'GIT_DIFFTOOL_NO_PROMPT variable' '
143
144
# git-difftool supports the difftool.prompt variable.
145
# Test that GIT_DIFFTOOL_PROMPT can override difftool.prompt = false
151
-test_expect_success 'GIT_DIFFTOOL_PROMPT variable' '
146
+test_expect_success PERL 'GIT_DIFFTOOL_PROMPT variable' '
147
git config difftool.prompt false &&
148
GIT_DIFFTOOL_PROMPT=true &&
149
export GIT_DIFFTOOL_PROMPT &&
@@ -160,7 +155,7 @@ test_expect_success 'GIT_DIFFTOOL_PROMPT variable' '
155
'
156
157
# Test that we don't have to pass --no-prompt when difftool.prompt is false
163
-test_expect_success 'difftool.prompt config variable is false' '
158
+test_expect_success PERL 'difftool.prompt config variable is false' '
159
git config difftool.prompt false &&
160
161
diff=$(git difftool branch) &&
@@ -170,7 +165,7 @@ test_expect_success 'difftool.prompt config variable is false' '
165
'
166
167
# Test that we don't have to pass --no-prompt when mergetool.prompt is false
173
-test_expect_success 'difftool merge.prompt = false' '
168
+test_expect_success PERL 'difftool merge.prompt = false' '
169
git config --unset difftool.prompt
170
git config mergetool.prompt false &&
171
@@ -181,7 +176,7 @@ test_expect_success 'difftool merge.prompt = false' '
176
'
177
178
# Test that the -y flag can override difftool.prompt = true
184
-test_expect_success 'difftool.prompt can overridden with -y' '
179
+test_expect_success PERL 'difftool.prompt can overridden with -y' '
180
git config difftool.prompt true &&
181
182
diff=$(git difftool -y branch) &&
@@ -191,7 +186,7 @@ test_expect_success 'difftool.prompt can overridden with -y' '
186
'
187
188
# Test that the --prompt flag can override difftool.prompt = false
194
-test_expect_success 'difftool.prompt can overridden with --prompt' '
189
+test_expect_success PERL 'difftool.prompt can overridden with --prompt' '
190
git config difftool.prompt false &&
191
192
prompt=$(echo | git difftool --prompt branch | tail -1) &&
@@ -201,7 +196,7 @@ test_expect_success 'difftool.prompt can overridden with --prompt' '
196
'
197
198
# Test that the last flag passed on the command-line wins
204
-test_expect_success 'difftool last flag wins' '
199
+test_expect_success PERL 'difftool last flag wins' '
200
diff=$(git difftool --prompt --no-prompt branch) &&
201
test "$diff" = "branch" &&
202
@@ -215,7 +210,7 @@ test_expect_success 'difftool last flag wins' '
210
211
# git-difftool falls back to git-mergetool config variables
212
# so test that behavior here
218
-test_expect_success 'difftool + mergetool config variables' '
213
+test_expect_success PERL 'difftool + mergetool config variables' '
214
remove_config_vars
215
git config merge.tool test-tool &&
216
git config mergetool.test-tool.cmd "cat \$LOCAL" &&
@@ -233,7 +228,7 @@ test_expect_success 'difftool + mergetool config variables' '
228
restore_test_defaults
229
'
230
236
-test_expect_success 'difftool.<tool>.path' '
231
+test_expect_success PERL 'difftool.<tool>.path' '
232
git config difftool.tkdiff.path echo &&
233
diff=$(git difftool --tool=tkdiff --no-prompt branch) &&
234
git config --unset difftool.tkdiff.path &&
@@ -243,32 +238,32 @@ test_expect_success 'difftool.<tool>.path' '
238
restore_test_defaults
239
'
240
246
-test_expect_success 'difftool --extcmd=cat' '
241
+test_expect_success PERL 'difftool --extcmd=cat' '
242
diff=$(git difftool --no-prompt --extcmd=cat branch) &&
243
test "$diff" = branch"$LF"master
244
'
245
251
-test_expect_success 'difftool --extcmd cat' '
246
+test_expect_success PERL 'difftool --extcmd cat' '
247
diff=$(git difftool --no-prompt --extcmd cat branch) &&
248
test "$diff" = branch"$LF"master
249
'
250
256
-test_expect_success 'difftool -x cat' '
251
+test_expect_success PERL 'difftool -x cat' '
252
diff=$(git difftool --no-prompt -x cat branch) &&
253
test "$diff" = branch"$LF"master
254
'
255
261
-test_expect_success 'difftool --extcmd echo arg1' '
256
+test_expect_success PERL 'difftool --extcmd echo arg1' '
257
diff=$(git difftool --no-prompt --extcmd sh\ -c\ \"echo\ \$1\" branch)
258
test "$diff" = file
259
'
260
266
-test_expect_success 'difftool --extcmd cat arg1' '
261
+test_expect_success PERL 'difftool --extcmd cat arg1' '
262
diff=$(git difftool --no-prompt --extcmd sh\ -c\ \"cat\ \$1\" branch)
263
test "$diff" = master
264
'
265
271
-test_expect_success 'difftool --extcmd cat arg2' '
266
+test_expect_success PERL 'difftool --extcmd cat arg2' '
267
diff=$(git difftool --no-prompt --extcmd sh\ -c\ \"cat\ \$2\" branch)
268
test "$diff" = branch
269
'