summaryrefslogtreecommitdiffstats
path: root/testsuite/check.sh
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/check.sh')
-rwxr-xr-xtestsuite/check.sh195
1 files changed, 126 insertions, 69 deletions
diff --git a/testsuite/check.sh b/testsuite/check.sh
index 94e9c71..073843e 100755
--- a/testsuite/check.sh
+++ b/testsuite/check.sh
@@ -1,6 +1,6 @@
#! /bin/sh
# check script for Zutils - Utilities dealing with compressed files
-# Copyright (C) 2009 Antonio Diaz Diaz.
+# Copyright (C) 2009, 2010 Antonio Diaz Diaz.
#
# This script is free software: you have unlimited permission
# to copy, distribute and modify it.
@@ -16,11 +16,10 @@ ZGREP="${objdir}"/zgrep
ZEGREP="${objdir}"/zegrep
ZFGREP="${objdir}"/zfgrep
ZTEST="${objdir}"/ztest
-ZUTILS="${objdir}"/zutils
compressors="bzip2 gzip lzip"
extensions="bz2 gz lz"
-framework_failure() { echo 'failure in testing framework'; exit 1; }
-compressor_needed() { echo "${compressors} are needed to run tests"; exit 1; }
+framework_failure() { echo "failure in testing framework" ; exit 1 ; }
+compressor_needed() { echo "${compressors} are needed to run tests" ; exit 1 ; }
if [ ! -x "${ZCAT}" ] ; then
echo "${ZCAT}: cannot execute"
@@ -32,123 +31,181 @@ mkdir tmp
cd "${objdir}"/tmp
for i in ${compressors}; do
- cat "${testdir}"/../COPYING > in || framework_failure
+ cat "${testdir}"/test.txt > in || framework_failure
$i in || compressor_needed
done
-echo -n "testing zutils..."
-cat "${testdir}"/../COPYING > in || framework_failure
+printf "testing zutils-%s..." "$2"
+cat "${testdir}"/test.txt > in || framework_failure
cat in > -in- || framework_failure
cat in.lz > -in-.lz || framework_failure
-cat in in in in in > in5 || framework_failure
+cat in.lz > lz_only.lz || framework_failure
+cat in in in in in in > in6 || framework_failure
fail=0
+printf "\ntesting zcat-%s..." "$2"
for i in ${extensions}; do
"${ZCAT}" in.$i > copy || fail=1
cmp in copy || fail=1
- echo -n .
+ printf .
done
"${ZCAT}" < in > copy || fail=1
cmp in copy || fail=1
-echo -n .
+printf .
"${ZCAT}" < in.gz > copy || fail=1
cmp in copy || fail=1
-echo -n .
+printf .
"${ZCAT}" < in.bz2 > copy || fail=1
cmp in copy || fail=1
-echo -n .
+printf .
"${ZCAT}" < in.lz > copy || fail=1
cmp in copy || fail=1
-echo -n .
+printf .
"${ZCAT}" in > copy || fail=1
cmp in copy || fail=1
-echo -n .
-"${ZCAT}" in in.gz in.bz2 in.lz -- -in- > copy5 || fail=1
-cmp in5 copy5 || fail=1
-echo -n .
+printf .
+"${ZCAT}" lz_only > copy || fail=1
+cmp in copy || fail=1
+printf .
+"${ZCAT}" in in.gz in.bz2 in.lz -- -in- -in-.lz > copy6 || fail=1
+cmp in6 copy6 || fail=1
+printf .
+printf "\ntesting zcmp-%s..." "$2"
for i in ${extensions}; do
"${ZCMP}" in.$i || fail=1
- echo -n .
+ printf .
"${ZCMP}" in in.$i || fail=1
- echo -n .
+ printf .
"${ZCMP}" in.$i in || fail=1
- echo -n .
+ printf .
done
-
+"${ZCMP}" - || fail=1
+printf .
+"${ZCMP}" in in || fail=1
+printf .
+"${ZCMP}" in || fail=1
+printf .
+"${ZCMP}" in.lz in.gz || fail=1
+printf .
+"${ZCMP}" in.gz -- -in-.lz || fail=1
+printf .
+"${ZCMP}" -- -in-.lz in.gz || fail=1
+printf .
+"${ZCMP}" in -- -in-.lz || fail=1
+printf .
+"${ZCMP}" -- -in- in.lz || fail=1
+printf .
+"${ZCMP}" in.lz -- -in- || fail=1
+printf .
+"${ZCMP}" -- -in-.lz in || fail=1
+printf .
+"${ZCMP}" -- -in- in || fail=1
+printf .
+"${ZCMP}" in -- -in- || fail=1
+printf .
+"${ZCMP}" lz_only.lz < in || fail=1
+printf .
+"${ZCMP}" in.lz - < in || fail=1
+printf .
+"${ZCMP}" - in.lz < in || fail=1
+printf .
+"${ZCMP}" in - < in.lz || fail=1
+printf .
+"${ZCMP}" - in < in.lz || fail=1
+printf .
+
+
+printf "\ntesting zdiff-%s..." "$2"
for i in ${extensions}; do
"${ZDIFF}" in.$i || fail=1
- echo -n .
+ printf .
"${ZDIFF}" in in.$i || fail=1
- echo -n .
+ printf .
"${ZDIFF}" in.$i in || fail=1
- echo -n .
+ printf .
done
+"${ZDIFF}" - || fail=1
+printf .
+"${ZDIFF}" in in || fail=1
+printf .
"${ZDIFF}" in || fail=1
-echo -n .
+printf .
"${ZDIFF}" in.lz in.gz || fail=1
-echo -n .
+printf .
"${ZDIFF}" in.gz -- -in-.lz || fail=1
-echo -n .
+printf .
"${ZDIFF}" -- -in-.lz in.gz || fail=1
-echo -n .
+printf .
"${ZDIFF}" in -- -in-.lz || fail=1
-echo -n .
+printf .
"${ZDIFF}" -- -in- in.lz || fail=1
-echo -n .
+printf .
"${ZDIFF}" in.lz -- -in- || fail=1
-echo -n .
+printf .
"${ZDIFF}" -- -in-.lz in || fail=1
-echo -n .
+printf .
"${ZDIFF}" -- -in- in || fail=1
-echo -n .
+printf .
"${ZDIFF}" in -- -in- || fail=1
-echo -n .
-
-
+printf .
+"${ZDIFF}" lz_only.lz < in || fail=1
+printf .
+"${ZDIFF}" in.lz - < in || fail=1
+printf .
+"${ZDIFF}" - in.lz < in || fail=1
+printf .
+"${ZDIFF}" in - < in.lz || fail=1
+printf .
+"${ZDIFF}" - in < in.lz || fail=1
+printf .
+
+
+printf "\ntesting zgrep-%s..." "$2"
for i in ${extensions}; do
- "${ZGREP}" License in.$i 2>&1 > /dev/null || fail=1
- echo -n .
+ "${ZGREP}" License in.$i > /dev/null || fail=1
+ "${ZGREP}" nx_pattern in.$i > /dev/null && fail=1
+ printf .
done
-"${ZGREP}" License < in 2>&1 > /dev/null || fail=1
-echo -n .
-"${ZGREP}" License < in.gz 2>&1 > /dev/null || fail=1
-echo -n .
-"${ZGREP}" License < in.bz2 2>&1 > /dev/null || fail=1
-echo -n .
-"${ZGREP}" License < in.lz 2>&1 > /dev/null || fail=1
-echo -n .
-"${ZGREP}" License in 2>&1 > /dev/null || fail=1
-echo -n .
-"${ZGREP}" License -- -in- 2>&1 > /dev/null || fail=1
-echo -n .
-"${ZGREP}" License -- -in-.lz 2>&1 > /dev/null || fail=1
-echo -n .
-"${ZGREP}" License in in.gz in.bz2 in.lz -- -in- 2>&1 > /dev/null || fail=1
-echo -n .
-"${ZEGREP}" License in 2>&1 > /dev/null || fail=1
-echo -n .
-"${ZFGREP}" License in 2>&1 > /dev/null || fail=1
-echo -n .
-
+"${ZGREP}" -r License . > /dev/null || fail=1
+printf .
+"${ZGREP}" nx_pattern -r . in > /dev/null && fail=1
+printf .
+"${ZGREP}" License < in > /dev/null || fail=1
+printf .
+"${ZGREP}" License < in.gz > /dev/null || fail=1
+printf .
+"${ZGREP}" License < in.bz2 > /dev/null || fail=1
+printf .
+"${ZGREP}" License < in.lz > /dev/null || fail=1
+printf .
+"${ZGREP}" License in > /dev/null || fail=1
+printf .
+"${ZGREP}" License -- -in- > /dev/null || fail=1
+printf .
+"${ZGREP}" License -- -in-.lz > /dev/null || fail=1
+printf .
+"${ZGREP}" License in in.gz in.bz2 in.lz -- -in- > /dev/null || fail=1
+printf .
+"${ZEGREP}" License in > /dev/null || fail=1
+printf .
+"${ZFGREP}" License in > /dev/null || fail=1
+printf .
+
+
+printf "\ntesting ztest-%s..." "$2"
"${ZTEST}" in in.gz in.bz2 in.lz -- -in- || fail=1
-echo -n .
+printf .
"${ZTEST}" -r . || fail=1
-echo -n .
-
-if [ "bzip2" != `"${ZUTILS}" -t in.bz2` ] ; then fail=1 ; fi
-echo -n .
-if [ "gzip" != `"${ZUTILS}" -t in.gz` ] ; then fail=1 ; fi
-echo -n .
-if [ "lzip" != `"${ZUTILS}" -t in.lz` ] ; then fail=1 ; fi
-echo -n .
-
+printf .
+printf "LZIPvs0000000000000000000000" | "${ZTEST}" 2>/dev/null && fail=1
+printf .
echo
if [ ${fail} = 0 ] ; then