diff --git a/mpeg2dec/Makefile.am b/mpeg2dec/Makefile.am index 0ef0c6f699166bd2376226eccd9b193e58ab468d..2902eeeec34880c954eea44183cfba07c4278b52 100644 --- a/mpeg2dec/Makefile.am +++ b/mpeg2dec/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS = autotools include test doc libmpeg2 libvo src +SUBDIRS = autotools include doc libmpeg2 libvo src test EXTRA_DIST = bootstrap diff --git a/mpeg2dec/test/Makefile.am b/mpeg2dec/test/Makefile.am index 46c31b68991b2b48a0a8cd03649469a9db2d66a9..ed39ce3c99bb43e58b1eacc5ee438011d1d2e52c 100644 --- a/mpeg2dec/test/Makefile.am +++ b/mpeg2dec/test/Makefile.am @@ -1 +1,2 @@ EXTRA_DIST = regression tests tek-525 tek-625 +TESTS = regression diff --git a/mpeg2dec/test/regression b/mpeg2dec/test/regression index 075b5bf168c2841aa7a44a43c38ff8c722c9d68c..c569910ca7f0e70f47857b7b9997e8182b275b03 100755 --- a/mpeg2dec/test/regression +++ b/mpeg2dec/test/regression @@ -1,17 +1,36 @@ #!/bin/sh -testfile=tests -if [ $# -ge 1 ]; then testfile=$1; fi +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` -dirs=`awk -F '#' '{print $1}' $testfile` # choose between c_md5 and mmx_md5 (based on the idct you use) md5=c.md5 accel="-c" if [ $# -ge 2 -a x"$2" != x"c" ]; then md5="$2.md5"; accel=""; fi +cd $builddir +error=0 + rm -fr data mkdir data cd data @@ -19,9 +38,11 @@ cd data for dir in $dirs; do echo $dir ../../src/mpeg2dec $accel -o md5 $basedir/$dir/stream >/dev/null 2>&1 >md5 - diff -u md5 $basedir/$dir/$md5 + diff -u md5 $basedir/$dir/$md5 || error=1 rm -f md5 core done cd .. rmdir data + +exit $error