Use prerequisites to skip tests that need unzip

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
maint
Johannes Sixt 2009-03-16 14:44:56 +01:00
parent 6fd1106aa4
commit 552a26c8c0
2 changed files with 11 additions and 11 deletions

View File

@ -29,11 +29,11 @@ test_expect_success 'tar archive' '
"$UNZIP" -v >/dev/null 2>&1 "$UNZIP" -v >/dev/null 2>&1
if [ $? -eq 127 ]; then if [ $? -eq 127 ]; then
say "Skipping ZIP test, because unzip was not found" say "Skipping ZIP test, because unzip was not found"
test_done else
exit test_set_prereq UNZIP
fi fi


test_expect_success 'zip archive' ' test_expect_success UNZIP 'zip archive' '


git archive --format=zip HEAD >test.zip && git archive --format=zip HEAD >test.zip &&



View File

@ -187,20 +187,20 @@ test_expect_success 'git archive --format=zip with --output' \
$UNZIP -v >/dev/null 2>&1 $UNZIP -v >/dev/null 2>&1
if [ $? -eq 127 ]; then if [ $? -eq 127 ]; then
say "Skipping ZIP tests, because unzip was not found" say "Skipping ZIP tests, because unzip was not found"
test_done else
exit test_set_prereq UNZIP
fi fi


test_expect_success \ test_expect_success UNZIP \
'extract ZIP archive' \ 'extract ZIP archive' \
'(mkdir d && cd d && $UNZIP ../d.zip)' '(mkdir d && cd d && $UNZIP ../d.zip)'


test_expect_success \ test_expect_success UNZIP \
'validate filenames' \ 'validate filenames' \
'(cd d/a && find .) | sort >d.lst && '(cd d/a && find .) | sort >d.lst &&
test_cmp a.lst d.lst' test_cmp a.lst d.lst'


test_expect_success \ test_expect_success UNZIP \
'validate file contents' \ 'validate file contents' \
'diff -r a d/a' 'diff -r a d/a'


@ -208,16 +208,16 @@ test_expect_success \
'git archive --format=zip with prefix' \ 'git archive --format=zip with prefix' \
'git archive --format=zip --prefix=prefix/ HEAD >e.zip' 'git archive --format=zip --prefix=prefix/ HEAD >e.zip'


test_expect_success \ test_expect_success UNZIP \
'extract ZIP archive with prefix' \ 'extract ZIP archive with prefix' \
'(mkdir e && cd e && $UNZIP ../e.zip)' '(mkdir e && cd e && $UNZIP ../e.zip)'


test_expect_success \ test_expect_success UNZIP \
'validate filenames with prefix' \ 'validate filenames with prefix' \
'(cd e/prefix/a && find .) | sort >e.lst && '(cd e/prefix/a && find .) | sort >e.lst &&
test_cmp a.lst e.lst' test_cmp a.lst e.lst'


test_expect_success \ test_expect_success UNZIP \
'validate file contents with prefix' \ 'validate file contents with prefix' \
'diff -r a e/prefix/a' 'diff -r a e/prefix/a'