@matheusbsbs / matheus-bagliano / commits / 80828488cc
Fork 0

t9119: conditionally re-enable test depending on svn(1) version

I've tested this with svn 1.4.4 This also adds quoting to make it work odd characters in the trash path. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Wong committed Aug 5, 2008 at 00:35 UTC 80828488cc5b1fd8395a27e272fa5f855c1ae472
1 file changed +40 -29
t/t9119-git-svn-info.sh
+40 -29
@@ -5,8 +5,19 @@
5 test_description='git-svn info'
6
7 . ./lib-git-svn.sh
8 -say 'skipping svn-info test (has a race undiagnosed yet)'
9 -test_done
8 +
9 +set -e
10 +
11 +# Tested with: svn, version 1.4.4 (r25188)
12 +v=`svn --version | sed -n -e 's/^svn, version \(1\.4\.[0-9]\).*$/\1/p'`
13 +case $v in
14 +1.4.*)
15 + ;;
16 +*)
17 + say "skipping svn-info test (SVN version: $v not supported)"
18 + test_done
19 + ;;
20 +esac
21
22 ptouch() {
23 perl -w -e '
@@ -25,7 +36,7 @@ ptouch() {
36 ' "`svn info $2 | grep '^Text Last Updated:'`" "$1"
37 }
38
28 -test_expect_success 'setup repository and import' "
39 +test_expect_success 'setup repository and import' '
40 mkdir info &&
41 cd info &&
42 echo FIRST > A &&
@@ -34,19 +45,19 @@ test_expect_success 'setup repository and import' "
45 mkdir directory &&
46 touch directory/.placeholder &&
47 ln -s directory symlink-directory &&
37 - svn import -m 'initial' . $svnrepo &&
48 + svn import -m "initial" . "$svnrepo" &&
49 cd .. &&
50 mkdir gitwc &&
51 cd gitwc &&
41 - git-svn init $svnrepo &&
52 + git-svn init "$svnrepo" &&
53 git-svn fetch &&
54 cd .. &&
44 - svn co $svnrepo svnwc &&
55 + svn co "$svnrepo" svnwc &&
56 ptouch svnwc/file gitwc/file &&
57 ptouch svnwc/directory gitwc/directory &&
58 ptouch svnwc/symlink-file gitwc/symlink-file &&
59 ptouch svnwc/symlink-directory gitwc/symlink-directory
49 - "
60 + '
61
62 test_expect_success 'info' "
63 (cd svnwc; svn info) > expected.info &&
@@ -55,7 +66,7 @@ test_expect_success 'info' "
66 "
67
68 test_expect_success 'info --url' '
58 - test $(cd gitwc; git-svn info --url) = $svnrepo
69 + test "$(cd gitwc; git-svn info --url)" = "$svnrepo"
70 '
71
72 test_expect_success 'info .' "
@@ -65,7 +76,7 @@ test_expect_success 'info .' "
76 "
77
78 test_expect_success 'info --url .' '
68 - test $(cd gitwc; git-svn info --url .) = $svnrepo
79 + test "$(cd gitwc; git-svn info --url .)" = "$svnrepo"
80 '
81
82 test_expect_success 'info file' "
@@ -75,7 +86,7 @@ test_expect_success 'info file' "
86 "
87
88 test_expect_success 'info --url file' '
78 - test $(cd gitwc; git-svn info --url file) = "$svnrepo/file"
89 + test "$(cd gitwc; git-svn info --url file)" = "$svnrepo/file"
90 '
91
92 test_expect_success 'info directory' "
@@ -85,7 +96,7 @@ test_expect_success 'info directory' "
96 "
97
98 test_expect_success 'info --url directory' '
88 - test $(cd gitwc; git-svn info --url directory) = "$svnrepo/directory"
99 + test "$(cd gitwc; git-svn info --url directory)" = "$svnrepo/directory"
100 '
101
102 test_expect_success 'info symlink-file' "
@@ -95,7 +106,7 @@ test_expect_success 'info symlink-file' "
106 "
107
108 test_expect_success 'info --url symlink-file' '
98 - test $(cd gitwc; git-svn info --url symlink-file) \
109 + test "$(cd gitwc; git-svn info --url symlink-file)" \
110 = "$svnrepo/symlink-file"
111 '
112
@@ -108,7 +119,7 @@ test_expect_success 'info symlink-directory' "
119 "
120
121 test_expect_success 'info --url symlink-directory' '
111 - test $(cd gitwc; git-svn info --url symlink-directory) \
122 + test "$(cd gitwc; git-svn info --url symlink-directory)" \
123 = "$svnrepo/symlink-directory"
124 '
125
@@ -128,7 +139,7 @@ test_expect_success 'info added-file' "
139 "
140
141 test_expect_success 'info --url added-file' '
131 - test $(cd gitwc; git-svn info --url added-file) \
142 + test "$(cd gitwc; git-svn info --url added-file)" \
143 = "$svnrepo/added-file"
144 '
145
@@ -150,7 +161,7 @@ test_expect_success 'info added-directory' "
161 "
162
163 test_expect_success 'info --url added-directory' '
153 - test $(cd gitwc; git-svn info --url added-directory) \
164 + test "$(cd gitwc; git-svn info --url added-directory)" \
165 = "$svnrepo/added-directory"
166 '
167
@@ -173,7 +184,7 @@ test_expect_success 'info added-symlink-file' "
184 "
185
186 test_expect_success 'info --url added-symlink-file' '
176 - test $(cd gitwc; git-svn info --url added-symlink-file) \
187 + test "$(cd gitwc; git-svn info --url added-symlink-file)" \
188 = "$svnrepo/added-symlink-file"
189 '
190
@@ -196,7 +207,7 @@ test_expect_success 'info added-symlink-directory' "
207 "
208
209 test_expect_success 'info --url added-symlink-directory' '
199 - test $(cd gitwc; git-svn info --url added-symlink-directory) \
210 + test "$(cd gitwc; git-svn info --url added-symlink-directory)" \
211 = "$svnrepo/added-symlink-directory"
212 '
213
@@ -222,7 +233,7 @@ test_expect_success 'info deleted-file' "
233 "
234
235 test_expect_success 'info --url file (deleted)' '
225 - test $(cd gitwc; git-svn info --url file) \
236 + test "$(cd gitwc; git-svn info --url file)" \
237 = "$svnrepo/file"
238 '
239
@@ -243,7 +254,7 @@ test_expect_success 'info deleted-directory' "
254 "
255
256 test_expect_success 'info --url directory (deleted)' '
246 - test $(cd gitwc; git-svn info --url directory) \
257 + test "$(cd gitwc; git-svn info --url directory)" \
258 = "$svnrepo/directory"
259 '
260
@@ -265,7 +276,7 @@ test_expect_success 'info deleted-symlink-file' "
276 "
277
278 test_expect_success 'info --url symlink-file (deleted)' '
268 - test $(cd gitwc; git-svn info --url symlink-file) \
279 + test "$(cd gitwc; git-svn info --url symlink-file)" \
280 = "$svnrepo/symlink-file"
281 '
282
@@ -287,7 +298,7 @@ test_expect_success 'info deleted-symlink-directory' "
298 "
299
300 test_expect_success 'info --url symlink-directory (deleted)' '
290 - test $(cd gitwc; git-svn info --url symlink-directory) \
301 + test "$(cd gitwc; git-svn info --url symlink-directory)" \
302 = "$svnrepo/symlink-directory"
303 '
304
@@ -304,8 +315,8 @@ test_expect_success 'info unknown-file' "
315 "
316
317 test_expect_success 'info --url unknown-file' '
307 - test -z $(cd gitwc; git-svn info --url unknown-file \
308 - 2> ../actual.info--url-unknown-file) &&
318 + test -z "$(cd gitwc; git-svn info --url unknown-file \
319 + 2> ../actual.info--url-unknown-file)" &&
320 git-diff expected.info-unknown-file actual.info--url-unknown-file
321 '
322
@@ -321,8 +332,8 @@ test_expect_success 'info unknown-directory' "
332 "
333
334 test_expect_success 'info --url unknown-directory' '
324 - test -z $(cd gitwc; git-svn info --url unknown-directory \
325 - 2> ../actual.info--url-unknown-directory) &&
335 + test -z "$(cd gitwc; git-svn info --url unknown-directory \
336 + 2> ../actual.info--url-unknown-directory)" &&
337 git-diff expected.info-unknown-directory \
338 actual.info--url-unknown-directory
339 '
@@ -344,8 +355,8 @@ test_expect_success 'info unknown-symlink-file' "
355 "
356
357 test_expect_success 'info --url unknown-symlink-file' '
347 - test -z $(cd gitwc; git-svn info --url unknown-symlink-file \
348 - 2> ../actual.info--url-unknown-symlink-file) &&
358 + test -z "$(cd gitwc; git-svn info --url unknown-symlink-file \
359 + 2> ../actual.info--url-unknown-symlink-file)" &&
360 git-diff expected.info-unknown-symlink-file \
361 actual.info--url-unknown-symlink-file
362 '
@@ -368,8 +379,8 @@ test_expect_success 'info unknown-symlink-directory' "
379 "
380
381 test_expect_success 'info --url unknown-symlink-directory' '
371 - test -z $(cd gitwc; git-svn info --url unknown-symlink-directory \
372 - 2> ../actual.info--url-unknown-symlink-directory) &&
382 + test -z "$(cd gitwc; git-svn info --url unknown-symlink-directory \
383 + 2> ../actual.info--url-unknown-symlink-directory)" &&
384 git-diff expected.info-unknown-symlink-directory \
385 actual.info--url-unknown-symlink-directory
386 '