[PATCH 2/3] t0107: Skip ZIP tests if unzip(1) isn't available

Lukas Fleischer cgit at cryptocrack.de
Mon Apr 8 20:18:19 CEST 2013


Skip tests using unzip(1) if the binary isn't available instead of
erroring out.

Signed-off-by: Lukas Fleischer <cgit at cryptocrack.de>
---
 tests/t0107-snapshot.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/t0107-snapshot.sh b/tests/t0107-snapshot.sh
index 132d2e9..14ea62d 100755
--- a/tests/t0107-snapshot.sh
+++ b/tests/t0107-snapshot.sh
@@ -55,6 +55,13 @@ run_test 'strip off the header lines (zip)' '
 	tail -n +6 trash/tmp >trash/master.zip
 '
 
+unzip=`which unzip`
+test -n "$unzip" || {
+	echo "Skipping tests: unzip not found"
+	tests_done
+	exit
+}
+
 run_test 'verify zip format' '
 	unzip -t trash/master.zip
 '
-- 
1.8.2.675.gda3bb24.dirty





More information about the CGit mailing list