summaryrefslogtreecommitdiffstats
path: root/testsuite/check.sh
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/check.sh')
-rwxr-xr-xtestsuite/check.sh85
1 files changed, 78 insertions, 7 deletions
diff --git a/testsuite/check.sh b/testsuite/check.sh
index fe8dbff..cd01c46 100755
--- a/testsuite/check.sh
+++ b/testsuite/check.sh
@@ -16,6 +16,7 @@ ZGREP="${objdir}"/zgrep
ZEGREP="${objdir}"/zegrep
ZFGREP="${objdir}"/zfgrep
ZTEST="${objdir}"/ztest
+ZUPDATE="${objdir}"/zupdate
compressors="bzip2 gzip lzip"
extensions="bz2 gz lz"
compressor_needed() { echo "${compressors} are needed to run tests" ; exit 1 ; }
@@ -45,9 +46,9 @@ cat in.lz > lz_only.lz || framework_failure
cat in in in in in in > in6 || framework_failure
fail=0
-printf "testing zutils-%s..." "$2"
+printf "testing zutils-%s..." "$2"
-printf "\ntesting zcat-%s..." "$2"
+printf "\ntesting zcat-%s..." "$2"
for i in ${extensions}; do
"${ZCAT}" -N in.$i > copy || fail=1
@@ -95,7 +96,7 @@ if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
-printf "\ntesting zcmp-%s..." "$2"
+printf "\ntesting zcmp-%s..." "$2"
for i in ${extensions}; do
"${ZCMP}" -N in.$i || fail=1
@@ -176,7 +177,7 @@ if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
-printf "\ntesting zdiff-%s..." "$2"
+printf "\ntesting zdiff-%s..." "$2"
for i in ${extensions}; do
"${ZDIFF}" -N in.$i > /dev/null || fail=1
@@ -239,7 +240,7 @@ if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
-printf "\ntesting zgrep-%s..." "$2"
+printf "\ntesting zgrep-%s..." "$2"
for i in ${extensions}; do
"${ZGREP}" -N "GNU" in.$i > /dev/null || fail=1
@@ -305,7 +306,7 @@ printf .
printf .
-printf "\ntesting ztest-%s..." "$2"
+printf "\ntesting ztest-%s..." "$2"
for i in ${extensions}; do
"${ZTEST}" -N --format=$i < in.$i || fail=1
@@ -335,10 +336,80 @@ if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
"${ZTEST}" -N --format=lz in.bz2 2> /dev/null
if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
"${ZTEST}" -N --lz='lzip --bad-option' in.lz 2> /dev/null
-if [ $? = 2 ] ; then printf . ; else printf - ; fail=1 ; fi
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
"${ZTEST}" -N --bad-option 2> /dev/null
if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
+
+printf "\ntesting zupdate-%s..." "$2"
+
+cat in.bz2 > x.bz2 || framework_failure
+cat in.gz > x.gz || framework_failure
+"${ZUPDATE}" -N --bz2=bad_command x.bz2 2> /dev/null
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
+"${ZUPDATE}" -N --bz2='bzip2 --bad-option' x.bz2 > /dev/null 2> /dev/null
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
+"${ZUPDATE}" -N --gz=bad_command x.gz 2> /dev/null
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
+"${ZUPDATE}" -N --gz='gzip --bad-option' x.gz 2> /dev/null
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
+"${ZUPDATE}" -N --lz=bad_command x.gz 2> /dev/null
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
+"${ZUPDATE}" -N --lz='lzip --bad-option' x.gz 2> /dev/null
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
+"${ZUPDATE}" -N --bad-option 2> /dev/null
+if [ $? = 1 ] ; then printf . ; else printf - ; fail=1 ; fi
+
+cat in.lz in.lz > x.lz || framework_failure
+"${ZUPDATE}" -N -f x.bz2 x.gz 2> /dev/null
+if [ $? = 1 ] && [ -e x.bz2 ] && [ -e x.gz ] && [ -e x.lz ] ; then printf .
+else printf - ; fail=1
+fi
+rm -f x.lz || framework_failure
+
+"${ZUPDATE}" -N x.bz2 2> /dev/null
+if [ $? = 0 ] && [ ! -e x.bz2 ] && [ -e x.gz ] && [ -e x.lz ] ; then printf .
+else printf - ; fail=1
+fi
+rm -f x.lz || framework_failure
+"${ZUPDATE}" -N x.gz 2> /dev/null
+if [ $? = 0 ] && [ ! -e x.bz2 ] && [ ! -e x.gz ] && [ -e x.lz ] ; then printf .
+else printf - ; fail=1
+fi
+rm -f x.lz || framework_failure
+
+cat in.bz2 > x.bz2 || framework_failure
+cat in.gz > x.gz || framework_failure
+"${ZUPDATE}" -N x.bz2 x.gz 2> /dev/null
+if [ $? = 1 ] && [ ! -e x.bz2 ] && [ -e x.gz ] && [ -e x.lz ] ; then printf .
+else printf - ; fail=1
+fi
+rm -f x.lz || framework_failure
+
+cat in.bz2 > x.bz2 || framework_failure
+cat in.gz > x.gz || framework_failure
+"${ZUPDATE}" -N -f x.bz2 x.gz 2> /dev/null
+if [ $? = 0 ] && [ ! -e x.bz2 ] && [ ! -e x.gz ] && [ -e x.lz ] ; then printf .
+else printf - ; fail=1
+fi
+rm -f x.lz || framework_failure
+
+cat in.bz2 > x.bz2 || framework_failure
+cat in.gz > x.gz || framework_failure
+"${ZUPDATE}" -N -f x.bz2 x.gz 2> /dev/null
+if [ $? = 0 ] && [ ! -e x.bz2 ] && [ ! -e x.gz ] &&
+ [ ! -e x ] && [ -e x.lz ] ; then printf .
+else printf - ; fail=1
+fi
+rm -f x.lz || framework_failure
+
+cat in.bz2 > x.bz2 || framework_failure
+"${ZUPDATE}" -N -6 -q x.bz2
+if [ $? = 0 ] && [ ! -e x.bz2 ] && [ -e x.lz ] ; then printf .
+else printf - ; fail=1
+fi
+rm -f x.lz || framework_failure
+
echo
if [ ${fail} = 0 ] ; then
echo "tests completed successfully."