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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
#!/bin/sh
# Main tests directory
testdir=../../src/test
# Overall status
status=true
# Functions for running tests
run_a_test ()
{
script=$1
shift
if ./run-one-test.sh $script $@ ; then
echo "... passed"
else
echo "... FAILED"
status=false
fi
}
compare_results ()
{
if diff -q -r $1 $2; then
echo "... matched"
else
echo "... match FAILED"
status=false
fi
}
# Initial informational message
echo ""
$testdir/is-fast-math message
# Get the list of tests
scripts=`echo $testdir/*.osm | sed -e s/.osm/.sh/g`
# Run the scripts
for script in $scripts; do
echo ""
echo "Testing: $script ... "
run_a_test $script
done
# Check results
if $status; then
echo "Success: all tests passed"
else
echo "Warning: Some tests FAILED"
exit 1
fi
# Finish
exit 0
|