2002-10-16 16:54:06 +04:00
|
|
|
#!/bin/sh
|
2002-10-16 08:12:15 +04:00
|
|
|
|
2002-10-16 16:54:06 +04:00
|
|
|
top_builddir="."
|
|
|
|
top_srcdir="@srcdir@"
|
|
|
|
top_srcdir=`cd $top_srcdir; pwd` # make top_srcdir an absolute path
|
|
|
|
srcdir="@srcdir@"
|
2002-10-16 08:12:15 +04:00
|
|
|
subdirs=`grep 'SUBDIRS *=' Makefile|sed 's/.*=//'`
|
|
|
|
topdir=`pwd`
|
|
|
|
retval_success=77
|
|
|
|
|
|
|
|
for dir in $subdirs; do
|
|
|
|
echo Testing in $dir
|
|
|
|
test_status=1
|
|
|
|
if test ! -x "$dir/uselib"; then
|
|
|
|
test_status='binary not found'
|
|
|
|
fi
|
|
|
|
if test "$test_status" = 1; then
|
|
|
|
cd $dir
|
|
|
|
rm -f uselib.out
|
|
|
|
./uselib > uselib.out
|
|
|
|
retval=$?
|
|
|
|
if test "$retval" != $retval_success; then
|
|
|
|
test_status="failed with exit code $retval"
|
|
|
|
else
|
2002-10-16 16:54:06 +04:00
|
|
|
reference=$top_srcdir/$dir/uselib.out.expected
|
|
|
|
#echo NOTE: the reference file is $reference
|
|
|
|
if test -f $reference; then
|
2002-10-16 08:12:15 +04:00
|
|
|
cat uselib.out |
|
2002-10-16 16:54:06 +04:00
|
|
|
$top_srcdir/filter-test-output |
|
2002-10-16 17:05:44 +04:00
|
|
|
diff $reference - > uselib.out.diffs 2>/dev/null
|
2002-10-16 08:12:15 +04:00
|
|
|
if test $? != 0; then
|
|
|
|
test_status="output mismatch, see $dir/uselib.out.diffs"
|
|
|
|
else
|
|
|
|
rm -f uselib.out.diffs
|
|
|
|
fi
|
2002-10-16 16:54:06 +04:00
|
|
|
else
|
|
|
|
test_status="reference file not found: $reference"
|
2002-10-16 08:12:15 +04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
cd $topdir
|
|
|
|
if test "$test_status" = 1; then
|
|
|
|
echo ...ok
|
|
|
|
else
|
|
|
|
echo ...FAIL: $test_status
|
|
|
|
fi
|
|
|
|
done
|