1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#!/bin/sh
if test x"$srcdir" != x""; then
builddir="." # running from make check, but it does not define that
else
srcdir=`echo "$0" | sed s,[^/]*$,,`
test "$srcdir" = "$0" && srcdir=.
test -z "$srcdir" && srcdir=.
builddir="$srcdir" # running manually, have to assume
fi
srcdir=`cd $srcdir;pwd`
builddir=`cd $builddir;pwd`
testfile="$srcdir/tests"
if [ $# -ge 1 ]; then testfile="$1"; fi
dirs=`awk -F '#' '{print $1}' $testfile`
basedir=`head -n 1 $testfile | awk '{print $2}'`
cd $srcdir; if [ ! -d $basedir ]; then
cd ..; if [ ! -d $basedir ]; then exit 77; fi # for make distcheck
fi
basedir=`cd $basedir;pwd`
cd $builddir
error=0
dtsdec="../src/dtsdec"; if [ ! -x $dtsdec ]; then
if [ -x ../vc++/Release/dtsdec.exe ]; then
dtsdec="../vc++/Release/dtsdec.exe"
basedir=`echo "$basedir" | sed "s,/cygdrive/\(.\)/,\1:/,"`
elif [ -x ../vc++/Debug/dtsdec.exe ]; then
dtsdec="../vc++/Debug/dtsdec.exe"
basedir=`echo "$basedir" | sed "s,/cygdrive/\(.\)/,\1:/,"`
else
echo "Can not find dtsdec executable"; exit 1
fi
fi
for dir in $dirs; do
echo $dir
$dtsdec -co float $basedir/$dir/stream >/dev/null 2>&1 >output.float
./compare output.float $basedir/$dir/output.float || error=1
rm -f output.float
done
exit $error
|