2005-07-01 10:22:27 +04:00
|
|
|
#!/bin/sh -e
|
2005-06-15 01:28:42 +04:00
|
|
|
|
2005-06-28 10:22:13 +04:00
|
|
|
export LANG=C
|
|
|
|
export LC_CTYPE="C"
|
|
|
|
export LC_NUMERIC="C"
|
|
|
|
export LC_TIME="C"
|
|
|
|
export LC_COLLATE="C"
|
|
|
|
export LC_MONETARY="C"
|
|
|
|
export LC_MESSAGES="C"
|
|
|
|
export LC_PAPER="C"
|
|
|
|
export LC_NAME="C"
|
|
|
|
export LC_ADDRESS="C"
|
|
|
|
export LC_TELEPHONE="C"
|
|
|
|
export LC_MEASUREMENT="C"
|
|
|
|
export LC_IDENTIFICATION="C"
|
|
|
|
export LC_ALL=""
|
|
|
|
|
2005-06-28 10:23:56 +04:00
|
|
|
umask 022
|
|
|
|
|
2005-06-15 01:28:42 +04:00
|
|
|
tests=0
|
|
|
|
failed=0
|
|
|
|
H=$PWD
|
|
|
|
|
2005-06-26 04:31:43 +04:00
|
|
|
if [ -d /usr/lib64 ]; then
|
|
|
|
lib=lib64
|
|
|
|
else
|
|
|
|
lib=lib
|
|
|
|
fi
|
|
|
|
|
2005-06-22 05:19:12 +04:00
|
|
|
TESTPATH=$PWD/install/bin
|
|
|
|
export PATH=$TESTPATH:$PATH
|
2005-06-26 04:31:43 +04:00
|
|
|
export PYTHONPATH=$PWD/install/$lib/python
|
2005-06-22 05:19:12 +04:00
|
|
|
|
|
|
|
rm -rf install
|
|
|
|
cd ..
|
2005-06-22 05:21:56 +04:00
|
|
|
${PYTHON:-python} setup.py install --home=tests/install > tests/install.err
|
|
|
|
if [ $? != 0 ] ; then
|
|
|
|
cat tests/install.err
|
|
|
|
fi
|
2005-06-22 05:19:12 +04:00
|
|
|
cd $H
|
2005-06-22 05:21:56 +04:00
|
|
|
rm install.err
|
2005-06-22 05:19:12 +04:00
|
|
|
|
2005-06-16 03:50:28 +04:00
|
|
|
function run_one
|
|
|
|
{
|
2005-06-22 05:24:41 +04:00
|
|
|
rm -f $1.err
|
2005-06-16 20:37:15 +04:00
|
|
|
export TZ=GMT
|
2005-06-15 01:28:42 +04:00
|
|
|
D=`mktemp -d`
|
2005-07-01 10:22:27 +04:00
|
|
|
if [ "$D" = "" ] ; then
|
2005-06-15 01:28:42 +04:00
|
|
|
echo mktemp failed!
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $D
|
|
|
|
fail=0
|
2005-07-04 09:51:09 +04:00
|
|
|
export HOME=$D
|
2005-06-16 03:50:28 +04:00
|
|
|
|
2005-06-22 05:24:41 +04:00
|
|
|
if ! $H/$1 > .out 2>&1 ; then
|
|
|
|
echo $1 failed with error code $?
|
2005-06-15 01:28:42 +04:00
|
|
|
fail=1
|
|
|
|
fi
|
2005-06-16 03:50:28 +04:00
|
|
|
|
2005-06-22 05:24:41 +04:00
|
|
|
if [ -s .out -a ! -r $H/$1.out ] ; then
|
|
|
|
echo $1 generated unexpected output:
|
2005-06-15 01:28:42 +04:00
|
|
|
cat .out
|
2005-06-22 05:24:41 +04:00
|
|
|
cp .out $H/$1.err
|
2005-06-15 01:28:42 +04:00
|
|
|
fail=1
|
2005-06-22 05:24:41 +04:00
|
|
|
elif [ -r $H/$1.out ] && ! diff -u $H/$1.out .out > /dev/null ; then
|
|
|
|
echo $1 output changed:
|
|
|
|
diff -u $H/$1.out .out && true
|
|
|
|
cp .out $H/$1.err
|
2005-06-15 12:02:13 +04:00
|
|
|
fail=1
|
2005-06-15 01:28:42 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
cd $H
|
|
|
|
rm -r $D
|
2005-06-16 03:50:28 +04:00
|
|
|
return $fail
|
|
|
|
}
|
2005-06-15 01:28:42 +04:00
|
|
|
|
2005-06-16 03:50:28 +04:00
|
|
|
TESTS=$@
|
2005-07-01 10:22:27 +04:00
|
|
|
if [ "$TESTS" = "" ] ; then
|
2005-06-16 03:50:28 +04:00
|
|
|
TESTS=`ls test-* | grep -Ev "\.|~"`
|
|
|
|
fi
|
|
|
|
|
|
|
|
for f in $TESTS ; do
|
|
|
|
echo -n "."
|
|
|
|
if ! run_one $f ; then
|
|
|
|
failed=$[$failed + 1]
|
|
|
|
fi
|
2005-06-15 01:28:42 +04:00
|
|
|
tests=$[$tests + 1]
|
|
|
|
done
|
|
|
|
|
2005-06-22 05:19:12 +04:00
|
|
|
rm -rf install
|
|
|
|
|
2005-06-15 01:28:42 +04:00
|
|
|
echo
|
|
|
|
echo Ran $tests tests, $failed failed
|
|
|
|
|
|
|
|
if [ $failed -gt 0 ] ; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|