2008-01-07 12:49:19 +01:00
|
|
|
#/bin/sh
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
#
|
2009-04-13 10:27:40 +02:00
|
|
|
# Author: Lasse Collin
|
2008-01-07 12:49:19 +01:00
|
|
|
#
|
2009-04-13 10:27:40 +02:00
|
|
|
# This file has been put into the public domain.
|
|
|
|
# You can do whatever you want with this file.
|
2008-01-07 12:49:19 +01:00
|
|
|
#
|
|
|
|
###############################################################################
|
|
|
|
|
2010-10-08 14:32:29 +02:00
|
|
|
# If both xz and xzdec were not build, skip this test.
|
|
|
|
XZ=../src/xz/xz
|
|
|
|
XZDEC=../src/xzdec/xzdec
|
|
|
|
test -x "$XZ" || XZ=
|
|
|
|
test -x "$XZDEC" || XZDEC=
|
|
|
|
if test -z "$XZ$XZDEC"; then
|
|
|
|
(exit 77)
|
|
|
|
exit 77
|
|
|
|
fi
|
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
for I in "$srcdir"/files/good-*.xz
|
2008-01-07 12:49:19 +01:00
|
|
|
do
|
2010-10-08 14:32:29 +02:00
|
|
|
if test -z "$XZ" || "$XZ" -dc "$I" > /dev/null 2>&1; then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
echo "Good file failed: $I"
|
|
|
|
(exit 1)
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -z "$XZDEC" || "$XZDEC" "$I" > /dev/null 2>&1; then
|
2008-01-08 11:29:58 +01:00
|
|
|
:
|
|
|
|
else
|
2008-01-07 12:49:19 +01:00
|
|
|
echo "Good file failed: $I"
|
|
|
|
(exit 1)
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2008-09-30 16:43:55 +02:00
|
|
|
for I in "$srcdir"/files/bad-*.xz
|
2008-01-07 12:49:19 +01:00
|
|
|
do
|
2010-10-08 14:32:29 +02:00
|
|
|
if test -n "$XZ" && "$XZ" -dc "$I" > /dev/null 2>&1; then
|
|
|
|
echo "Bad file succeeded: $I"
|
|
|
|
(exit 1)
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -n "$XZDEC" && "$XZDEC" "$I" > /dev/null 2>&1; then
|
2008-01-07 12:49:19 +01:00
|
|
|
echo "Bad file succeeded: $I"
|
|
|
|
(exit 1)
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
(exit 0)
|
|
|
|
exit 0
|