summaryrefslogtreecommitdiffstats
path: root/testsuite/check.sh
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:29:58 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-08 04:29:58 +0000
commit4646c2987eba0ba70050daf3c9fb450510a30237 (patch)
treeb1312f8c64fd61a3097b553507d00cac44b3c4bd /testsuite/check.sh
parentAdding debian version 1.1-1. (diff)
downloadzutils-4646c2987eba0ba70050daf3c9fb450510a30237.tar.xz
zutils-4646c2987eba0ba70050daf3c9fb450510a30237.zip
Merging upstream version 1.2~pre2.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
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."