2005-09-10 23:55:14 +04:00
|
|
|
|
|
|
|
TESTS=$*
|
|
|
|
|
|
|
|
if test "$TESTS"x = x ; then
|
|
|
|
for i in $SRCDIR/tests/*.img.bz2
|
|
|
|
do
|
|
|
|
TESTS="$TESTS `basename $i .img.bz2`"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2007-10-20 22:08:51 +04:00
|
|
|
mkdir -p tests/tmp
|
2005-09-10 23:55:14 +04:00
|
|
|
|
|
|
|
for i in $TESTS
|
|
|
|
do
|
2006-05-30 17:47:05 +04:00
|
|
|
printf "%s: " $i
|
2005-09-10 23:55:14 +04:00
|
|
|
if test ! -f $SRCDIR/tests/$i.img.bz2 -a \
|
|
|
|
! -f $SRCDIR/tests/$i.results ;
|
|
|
|
then
|
|
|
|
echo "non-existent"
|
|
|
|
continue
|
|
|
|
fi
|
2007-10-20 22:08:51 +04:00
|
|
|
bunzip2 < $SRCDIR/tests/$i.img.bz2 > tests/tmp/test.img.$$
|
2008-05-12 22:26:51 +04:00
|
|
|
# swap is native-endian, so regenerate before testing
|
|
|
|
if [ "$i" == "swap0" ]; then
|
|
|
|
mkswap -v0 tests/tmp/test.img.$$ > /dev/null
|
|
|
|
elif [ "$i" == "swap1" ]; then
|
|
|
|
mkswap -v1 -L SWAP-TEST -U 8ff8e77f-8553-485e-8656-58be67a81666 tests/tmp/test.img.$$ >/dev/null
|
|
|
|
fi
|
2007-10-20 22:08:51 +04:00
|
|
|
./tst_probe tests/tmp/test.img.$$ > tests/$i.out
|
|
|
|
/bin/rm -f tests/tmp/test.img.$$ tests/$i.ok tests/$i.failed
|
2005-09-10 23:55:14 +04:00
|
|
|
cmp -s tests/$i.out $SRCDIR/tests/$i.results
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
echo ok
|
|
|
|
touch tests/$i.ok
|
|
|
|
else
|
|
|
|
echo failed
|
|
|
|
diff -c tests/$i.out $SRCDIR/tests/$i.results > tests/$i.failed
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
num_ok=`ls tests/*.ok 2>/dev/null | wc -l`
|
|
|
|
num_failed=`ls tests/*.failed 2>/dev/null | wc -l`
|
|
|
|
|
|
|
|
echo "$num_ok tests succeeded $num_failed tests failed"
|
|
|
|
|
|
|
|
test "$num_failed" -eq 0 || exit 1
|