"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "testsuite/check.sh" between
zutils-1.9.tar.lz and zutils-1.10.tar.lz

About: Zutils is a collection of utilities able to deal with any combination of compressed and non-compressed files transparently. The utilities zcat, zcmp, zdiff, zgrep and ztest supports the compressors bzip2, gzip, lzip and xz.

check.sh  (zutils-1.9.tar.lz):check.sh  (zutils-1.10.tar.lz)
#! /bin/sh #! /bin/sh
# check script for Zutils - Utilities dealing with compressed files # check script for Zutils - Utilities dealing with compressed files
# Copyright (C) 2009-2020 Antonio Diaz Diaz. # Copyright (C) 2009-2021 Antonio Diaz Diaz.
# #
# This script is free software: you have unlimited permission # This script is free software: you have unlimited permission
# to copy, distribute, and modify it. # to copy, distribute, and modify it.
LC_ALL=C LC_ALL=C
export LC_ALL export LC_ALL
objdir=`pwd` objdir=`pwd`
testdir=`cd "$1" ; pwd` testdir=`cd "$1" ; pwd`
ZCAT="${objdir}"/zcat ZCAT="${objdir}"/zcat
ZCMP="${objdir}"/zcmp ZCMP="${objdir}"/zcmp
skipping to change at line 59 skipping to change at line 59
cat "${testdir}"/test.txt.tar > in.tar || framework_failure cat "${testdir}"/test.txt.tar > in.tar || framework_failure
printf "01234567890" > pin.tar || framework_failure printf "01234567890" > pin.tar || framework_failure
cat in.tar in.tar in.tar in.tar >> pin.tar || framework_failure cat in.tar in.tar in.tar in.tar >> pin.tar || framework_failure
cat in > -in- || framework_failure cat in > -in- || framework_failure
cat in.lz > -in-.lz || framework_failure cat in.lz > -in-.lz || framework_failure
cat in.lz > lz_only.lz || framework_failure cat in.lz > lz_only.lz || framework_failure
cat in in in in in in > in6 || framework_failure cat in in in in in in > in6 || framework_failure
bad0_lz="${testdir}"/zero_bad_crc.lz bad0_lz="${testdir}"/zero_bad_crc.lz
bad0_gz="${testdir}"/zero_bad_crc.gz bad0_gz="${testdir}"/zero_bad_crc.gz
bad1_lz="${testdir}"/test_bad_crc.lz bad1_lz="${testdir}"/test_bad_crc.lz
touch empty empty.bz2 empty.gz empty.lz
fail=0 fail=0
test_failed() { fail=1 ; printf " $1" ; [ -z "$2" ] || printf "($2)" ; } test_failed() { fail=1 ; printf " $1" ; [ -z "$2" ] || printf "($2)" ; }
printf "testing zcat-%s..." "$2" printf "testing zcat-%s..." "$2"
for i in ${extensions}; do for i in ${extensions}; do
"${ZCAT}" -N in.$i > copy || test_failed $LINENO $i "${ZCAT}" -N in.$i > copy || test_failed $LINENO $i
cmp in copy || test_failed $LINENO $i cmp in copy || test_failed $LINENO $i
"${ZCAT}" -N empty.$i in.$i > copy || test_failed $LINENO $i
cmp in copy || test_failed $LINENO $i
"${ZCAT}" -N --format=un in.$i > copy || test_failed $LINENO $i "${ZCAT}" -N --format=un in.$i > copy || test_failed $LINENO $i
cmp in copy || test_failed $LINENO $i cmp in copy || test_failed $LINENO $i
"${ZCAT}" -N --force-format=$i in.$i > copy || test_failed $LINENO $i "${ZCAT}" -N --force-format=$i in.$i > copy || test_failed $LINENO $i
cmp in copy || test_failed $LINENO $i cmp in copy || test_failed $LINENO $i
"${ZCAT}" -N in.$i | dd bs=1000 count=1 > copy 2> /dev/null || "${ZCAT}" -N in.$i | dd bs=1000 count=1 > copy 2> /dev/null ||
test_failed $LINENO $i test_failed $LINENO $i
dd if=in bs=1000 count=1 2> /dev/null | cmp - copy || dd if=in bs=1000 count=1 2> /dev/null | cmp - copy ||
test_failed $LINENO $i test_failed $LINENO $i
done done
skipping to change at line 147 skipping to change at line 150
printf "\ntesting zcmp-%s..." "$2" printf "\ntesting zcmp-%s..." "$2"
for i in ${extensions}; do for i in ${extensions}; do
"${ZCMP}" -N in.$i || test_failed $LINENO $i "${ZCMP}" -N in.$i || test_failed $LINENO $i
"${ZCMP}" -N in in.$i || test_failed $LINENO $i "${ZCMP}" -N in in.$i || test_failed $LINENO $i
"${ZCMP}" -N in in.$i --force-format=,$i || test_failed $LINENO $i "${ZCMP}" -N in in.$i --force-format=,$i || test_failed $LINENO $i
"${ZCMP}" -N in.$i in || test_failed $LINENO $i "${ZCMP}" -N in.$i in || test_failed $LINENO $i
"${ZCMP}" -N in.$i in --force-format=$i || test_failed $LINENO $i "${ZCMP}" -N in.$i in --force-format=$i || test_failed $LINENO $i
"${ZCMP}" -N -i 1kB:1000 -n 500 in6 in.$i || test_failed $LINENO $i "${ZCMP}" -N -i 1kB:1000 -n 500 in6 in.$i || test_failed $LINENO $i
"${ZCMP}" -N -i 1KiB:1024 -n 50 in.$i in6 || test_failed $LINENO $i "${ZCMP}" -N -i 1KiB:1024 -n 50 in.$i in6 || test_failed $LINENO $i
"${ZCMP}" -N empty empty.$i || test_failed $LINENO $i
done done
"${ZCMP}" -Nq in in6 "${ZCMP}" -Nq in in6
[ $? = 1 ] || test_failed $LINENO [ $? = 1 ] || test_failed $LINENO
"${ZCMP}" -N -n 0 in in6 || test_failed $LINENO "${ZCMP}" -N -n 0 in in6 || test_failed $LINENO
"${ZCMP}" -N -n 100B in in6 || test_failed $LINENO "${ZCMP}" -N -n 100B in in6 || test_failed $LINENO
"${ZCMP}" -N -n 1k in in6 || test_failed $LINENO "${ZCMP}" -N -n 1k in in6 || test_failed $LINENO
"${ZCMP}" -N -n 10kB in in6 || test_failed $LINENO "${ZCMP}" -N -n 10kB in in6 || test_failed $LINENO
"${ZCMP}" -Nq in.tar pin.tar "${ZCMP}" -Nq in.tar pin.tar
[ $? = 1 ] || test_failed $LINENO [ $? = 1 ] || test_failed $LINENO
skipping to change at line 217 skipping to change at line 221
printf "\ntesting zdiff-%s..." "$2" printf "\ntesting zdiff-%s..." "$2"
for i in ${extensions}; do for i in ${extensions}; do
"${ZDIFF}" -N in.$i > /dev/null || test_failed $LINENO $i "${ZDIFF}" -N in.$i > /dev/null || test_failed $LINENO $i
"${ZDIFF}" -N in in.$i > /dev/null || test_failed $LINENO $i "${ZDIFF}" -N in in.$i > /dev/null || test_failed $LINENO $i
"${ZDIFF}" -N in in.$i --force-format=,$i > /dev/null || "${ZDIFF}" -N in in.$i --force-format=,$i > /dev/null ||
test_failed $LINENO $i test_failed $LINENO $i
"${ZDIFF}" -N in.$i in > /dev/null || test_failed $LINENO $i "${ZDIFF}" -N in.$i in > /dev/null || test_failed $LINENO $i
"${ZDIFF}" -N in.$i in --force-format=$i, > /dev/null || "${ZDIFF}" -N in.$i in --force-format=$i, > /dev/null ||
test_failed $LINENO $i test_failed $LINENO $i
"${ZDIFF}" -N empty empty.$i > /dev/null || test_failed $LINENO $i
done done
"${ZDIFF}" -N in in6 > /dev/null "${ZDIFF}" -N in in6 > /dev/null
[ $? = 1 ] || test_failed $LINENO [ $? = 1 ] || test_failed $LINENO
# GNU diff 3.0 returns 2 when binary files differ # GNU diff 3.0 returns 2 when binary files differ
"${ZDIFF}" -N in.tar pin.tar > /dev/null && test_failed $LINENO "${ZDIFF}" -N in.tar pin.tar > /dev/null && test_failed $LINENO
"${ZDIFF}" -N - - || test_failed $LINENO "${ZDIFF}" -N - - || test_failed $LINENO
"${ZDIFF}" -N - 2> /dev/null "${ZDIFF}" -N - 2> /dev/null
[ $? = 2 ] || test_failed $LINENO [ $? = 2 ] || test_failed $LINENO
"${ZDIFF}" -N in in || test_failed $LINENO "${ZDIFF}" -N in in || test_failed $LINENO
skipping to change at line 293 skipping to change at line 298
"${ZGREP}" -N --force-format=$i "GNU" in.$i > /dev/null || "${ZGREP}" -N --force-format=$i "GNU" in.$i > /dev/null ||
test_failed $LINENO $i test_failed $LINENO $i
"${ZGREP}" -N -v "nx_pattern" in.$i > /dev/null || "${ZGREP}" -N -v "nx_pattern" in.$i > /dev/null ||
test_failed $LINENO $i test_failed $LINENO $i
"${ZGREP}" -N "nx_pattern" in.$i && test_failed $LINENO $i "${ZGREP}" -N "nx_pattern" in.$i && test_failed $LINENO $i
"${ZGREP}" -N -l "nx_pattern" in.$i && test_failed $LINENO $i "${ZGREP}" -N -l "nx_pattern" in.$i && test_failed $LINENO $i
"${ZGREP}" -N -L "nx_pattern" in.$i > /dev/null && "${ZGREP}" -N -L "nx_pattern" in.$i > /dev/null &&
test_failed $LINENO $i test_failed $LINENO $i
"${ZGREP}" -N --force-format=$i "GNU" in 2> /dev/null "${ZGREP}" -N --force-format=$i "GNU" in 2> /dev/null
[ $? = 2 ] || test_failed $LINENO $i [ $? = 2 ] || test_failed $LINENO $i
"${ZGREP}" -N "nx_pattern" empty.$i && test_failed $LINENO $i
done done
"${ZGREP}" -N pin.tar -e "GNU" > /dev/null || test_failed $LINENO "${ZGREP}" -N pin.tar -e "GNU" > /dev/null || test_failed $LINENO
"${ZGREP}" -N "GNU" < pin.tar > /dev/null || test_failed $LINENO "${ZGREP}" -N "GNU" < pin.tar > /dev/null || test_failed $LINENO
"${ZGREP}" -N -r "GNU" . > /dev/null || test_failed $LINENO "${ZGREP}" -N -r "GNU" . > /dev/null || test_failed $LINENO
"${ZGREP}" -N -r "GNU" > /dev/null || test_failed $LINENO "${ZGREP}" -N -r "GNU" > /dev/null || test_failed $LINENO
"${ZGREP}" -N -R "GNU" . > /dev/null || test_failed $LINENO "${ZGREP}" -N -R "GNU" . > /dev/null || test_failed $LINENO
"${ZGREP}" -N -R "GNU" > /dev/null || test_failed $LINENO "${ZGREP}" -N -R "GNU" > /dev/null || test_failed $LINENO
"${ZGREP}" -N "nx_pattern" -r . in > /dev/null && test_failed $LINENO "${ZGREP}" -N "nx_pattern" -r . in > /dev/null && test_failed $LINENO
"${ZGREP}" -N -e "GNU" in > /dev/null || test_failed $LINENO "${ZGREP}" -N -e "GNU" in > /dev/null || test_failed $LINENO
skipping to change at line 357 skipping to change at line 363
"${ZTEST}" -N < in.gz || test_failed $LINENO "${ZTEST}" -N < in.gz || test_failed $LINENO
"${ZTEST}" -N < in.bz2 || test_failed $LINENO "${ZTEST}" -N < in.bz2 || test_failed $LINENO
"${ZTEST}" -N < in.lz || test_failed $LINENO "${ZTEST}" -N < in.lz || test_failed $LINENO
"${ZTEST}" -N - < in.lz || test_failed $LINENO "${ZTEST}" -N - < in.lz || test_failed $LINENO
"${ZTEST}" -N - in.gz - < in.lz || test_failed $LINENO "${ZTEST}" -N - in.gz - < in.lz || test_failed $LINENO
"${ZTEST}" -N --lz='lzip -q' < in.lz || test_failed $LINENO "${ZTEST}" -N --lz='lzip -q' < in.lz || test_failed $LINENO
"${ZTEST}" -N -r . || test_failed $LINENO "${ZTEST}" -N -r . || test_failed $LINENO
"${ZTEST}" -N -r || test_failed $LINENO "${ZTEST}" -N -r || test_failed $LINENO
"${ZTEST}" -N -R . || test_failed $LINENO "${ZTEST}" -N -R . || test_failed $LINENO
"${ZTEST}" -N -R || test_failed $LINENO "${ZTEST}" -N -R || test_failed $LINENO
"${ZTEST}" -N empty empty.bz2 empty.gz empty.lz || test_failed $LINENO
"${ZTEST}" -Nq in.gz "${bad0_lz}" in.bz2 "${bad1_lz}" in.lz "${ZTEST}" -Nq in.gz "${bad0_lz}" in.bz2 "${bad1_lz}" in.lz
[ $? = 2 ] || test_failed $LINENO [ $? = 2 ] || test_failed $LINENO
lines=`"${ZTEST}" -N in.gz "${bad0_lz}" in.bz2 "${bad1_lz}" in.lz 2>&1 | wc -l` lines=`"${ZTEST}" -N in.gz "${bad0_lz}" in.bz2 "${bad1_lz}" in.lz 2>&1 | wc -l`
[ "${lines}" -eq 2 ] || test_failed $LINENO "${lines}" [ "${lines}" -eq 2 ] || test_failed $LINENO "${lines}"
lines=`"${ZTEST}" -Nv in.gz "${bad0_lz}" in.bz2 "${bad1_lz}" in.lz 2>&1 | wc -l` lines=`"${ZTEST}" -Nv in.gz "${bad0_lz}" in.bz2 "${bad1_lz}" in.lz 2>&1 | wc -l`
[ "${lines}" -eq 6 ] || test_failed $LINENO "${lines}" [ "${lines}" -eq 6 ] || test_failed $LINENO "${lines}"
"${ZTEST}" -Nq < in "${ZTEST}" -Nq < in
[ $? = 2 ] || test_failed $LINENO [ $? = 2 ] || test_failed $LINENO
"${ZTEST}" -Nq "" < in.lz "${ZTEST}" -Nq "" < in.lz
skipping to change at line 530 skipping to change at line 537
[ -e tmp3/a.gz ] || test_failed $LINENO [ -e tmp3/a.gz ] || test_failed $LINENO
[ -e tmp3/a.lz ] || test_failed $LINENO [ -e tmp3/a.lz ] || test_failed $LINENO
rm -f tmp3/a.lz || framework_failure rm -f tmp3/a.lz || framework_failure
"${ZUPDATE}" -N -r -f . || test_failed $LINENO "${ZUPDATE}" -N -r -f . || test_failed $LINENO
[ ! -e tmp3/a.bz2 ] || test_failed $LINENO [ ! -e tmp3/a.bz2 ] || test_failed $LINENO
[ ! -e tmp3/a.gz ] || test_failed $LINENO [ ! -e tmp3/a.gz ] || test_failed $LINENO
[ -e tmp3/a.lz ] || test_failed $LINENO [ -e tmp3/a.lz ] || test_failed $LINENO
cd .. || framework_failure cd .. || framework_failure
rm -r tmp2 || framework_failure rm -r tmp2 || framework_failure
rm -f empty empty.bz2 empty.gz empty.lz || framework_failure
if ln -s '.' slink 2> /dev/null ; then if ln -s '.' slink 2> /dev/null ; then
"${ZCAT}" -N -r slink > /dev/null || test_failed $LINENO "${ZCAT}" -N -r slink > /dev/null || test_failed $LINENO
"${ZGREP}" -N -r "GNU" slink > /dev/null || test_failed $LINENO "${ZGREP}" -N -r "GNU" slink > /dev/null || test_failed $LINENO
"${ZTEST}" -N -r slink || test_failed $LINENO "${ZTEST}" -N -r slink || test_failed $LINENO
"${ZUPDATE}" -N -r -f slink || test_failed $LINENO "${ZUPDATE}" -N -r -f slink || test_failed $LINENO
else else
printf "\nwarning: skipping link test: 'ln' does not work on your system. " printf "\nwarning: skipping link test: 'ln' does not work on your system. "
fi fi
rm -f slink || framework_failure rm -f slink || framework_failure
 End of changes. 8 change blocks. 
1 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)