@matheusbsbs / matheus-bagliano / commits / 552a26c8c0
Fork 0

Use prerequisites to skip tests that need unzip

Signed-off-by: Johannes Sixt <j6t@kdbg.org>

Johannes Sixt committed Mar 16, 2009 at 14:44 UTC 552a26c8c069c582d2572399eb4ac176634a03cb
2 files changed +11 -11
t/t0024-crlf-archive.sh
+3 -3
@@ -29,11 +29,11 @@ test_expect_success 'tar archive' '
29 "$UNZIP" -v >/dev/null 2>&1
30 if [ $? -eq 127 ]; then
31 say "Skipping ZIP test, because unzip was not found"
32 - test_done
33 - exit
32 +else
33 + test_set_prereq UNZIP
34 fi
35
36 -test_expect_success 'zip archive' '
36 +test_expect_success UNZIP 'zip archive' '
37
38 git archive --format=zip HEAD >test.zip &&
39
t/t5000-tar-tree.sh
+8 -8
@@ -187,20 +187,20 @@ test_expect_success 'git archive --format=zip with --output' \
187 $UNZIP -v >/dev/null 2>&1
188 if [ $? -eq 127 ]; then
189 say "Skipping ZIP tests, because unzip was not found"
190 - test_done
191 - exit
190 +else
191 + test_set_prereq UNZIP
192 fi
193
194 -test_expect_success \
194 +test_expect_success UNZIP \
195 'extract ZIP archive' \
196 '(mkdir d && cd d && $UNZIP ../d.zip)'
197
198 -test_expect_success \
198 +test_expect_success UNZIP \
199 'validate filenames' \
200 '(cd d/a && find .) | sort >d.lst &&
201 test_cmp a.lst d.lst'
202
203 -test_expect_success \
203 +test_expect_success UNZIP \
204 'validate file contents' \
205 'diff -r a d/a'
206
@@ -208,16 +208,16 @@ test_expect_success \
208 'git archive --format=zip with prefix' \
209 'git archive --format=zip --prefix=prefix/ HEAD >e.zip'
210
211 -test_expect_success \
211 +test_expect_success UNZIP \
212 'extract ZIP archive with prefix' \
213 '(mkdir e && cd e && $UNZIP ../e.zip)'
214
215 -test_expect_success \
215 +test_expect_success UNZIP \
216 'validate filenames with prefix' \
217 '(cd e/prefix/a && find .) | sort >e.lst &&
218 test_cmp a.lst e.lst'
219
220 -test_expect_success \
220 +test_expect_success UNZIP \
221 'validate file contents with prefix' \
222 'diff -r a e/prefix/a'
223