diff options
Diffstat (limited to 'usr.bin/yacc/tests/yacc_tests.sh')
-rwxr-xr-x | usr.bin/yacc/tests/yacc_tests.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/usr.bin/yacc/tests/yacc_tests.sh b/usr.bin/yacc/tests/yacc_tests.sh new file mode 100755 index 0000000..9a2973a --- /dev/null +++ b/usr.bin/yacc/tests/yacc_tests.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# $FreeBSD$ + +set -e + +cd $(dirname $0) + +TMPDIR=$(mktemp -d /tmp/tmp.XXXXXXXX) +TEST_DIR="$TMPDIR/test" +trap "cd /; rm -Rf $TMPDIR" EXIT INT TERM + +# Setup the environment for run_test.sh +mkdir -p "$TEST_DIR" +cp -Rf * "$TEST_DIR/." +echo > "$TMPDIR/config.h" +ln /usr/bin/yacc $TMPDIR/yacc + +log=$TMPDIR/run_test.log +(cd $TEST_DIR && ./run_test 2>&1 && : > run_test.ok) | tee $log +if [ -f run_test.ok ] && ! egrep "^...(diff|not found)[^\*]+$" $log; then + exit 0 +else + exit 1 +fi |