summaryrefslogtreecommitdiffstats
path: root/testsuite/check.sh
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/check.sh')
-rwxr-xr-xtestsuite/check.sh26
1 files changed, 22 insertions, 4 deletions
diff --git a/testsuite/check.sh b/testsuite/check.sh
index 5b8244c..92dcfdd 100755
--- a/testsuite/check.sh
+++ b/testsuite/check.sh
@@ -1,6 +1,6 @@
#! /bin/sh
# check script for Lziprecover - Data recovery tool for lzipped files
-# Copyright (C) 2009, 2010, 2011 Antonio Diaz Diaz.
+# Copyright (C) 2009, 2010, 2011, 2012 Antonio Diaz Diaz.
#
# This script is free software: you have unlimited permission
# to copy, distribute and modify it.
@@ -9,11 +9,12 @@ LC_ALL=C
export LC_ALL
objdir=`pwd`
testdir=`cd "$1" ; pwd`
+LZIP="${objdir}"/lziprecover
LZIPRECOVER="${objdir}"/lziprecover
framework_failure() { echo "failure in testing framework" ; exit 1 ; }
-if [ ! -x "${LZIPRECOVER}" ] ; then
- echo "${LZIPRECOVER}: cannot execute"
+if [ ! -x "${LZIP}" ] ; then
+ echo "${LZIP}: cannot execute"
exit 1
fi
@@ -40,7 +41,19 @@ fail=0
printf "testing lziprecover-%s..." "$2"
-"${LZIPRECOVER}" -D 921-1921 -o copy ${in_lz} || fail=1
+"${LZIP}" -t "${testdir}"/test_v0.lz || fail=1
+printf .
+"${LZIP}" -cd "${testdir}"/test_v0.lz > copy || fail=1
+cmp ${in} copy || fail=1
+printf .
+
+"${LZIP}" -t "${testdir}"/test_v1.lz || fail=1
+printf .
+"${LZIP}" -cd "${testdir}"/test_v1.lz > copy || fail=1
+cmp ${in} copy || fail=1
+printf .
+
+"${LZIPRECOVER}" -D 921-1921 -fo copy ${in_lz} || fail=1
cmp ${inD} copy || fail=1
printf .
"${LZIPRECOVER}" -D 921,1000 ${in_lz} > copy || fail=1
@@ -102,6 +115,11 @@ for i in 1 2 3 ; do
printf .
done
+cat ${in_lz} > anyothername || framework_failure
+"${LZIP}" -d anyothername || fail=1
+cmp ${in} anyothername.out || fail=1
+printf .
+
echo
if [ ${fail} = 0 ] ; then
echo "tests completed successfully."