aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/yacc
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-11-19 01:07:58 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-11-19 01:07:58 +0000
commit9268022b74279434ed6300244e3f977e56a8ceb5 (patch)
tree377ac0ac449528621eb192cd245adadb5fd53668 /usr.bin/yacc
parent29c34e9d2781cf25403647fb5af7d7ddb23be7e1 (diff)
parent8c3d6a4ab2a4a95d864d9a32d0157d7de90498a4 (diff)
downloadsrc-9268022b74279434ed6300244e3f977e56a8ceb5.tar.gz
src-9268022b74279434ed6300244e3f977e56a8ceb5.zip
Merge from head@274682
Notes
Notes: svn path=/projects/bmake/; revision=274683
Diffstat (limited to 'usr.bin/yacc')
-rw-r--r--usr.bin/yacc/Makefile7
-rw-r--r--usr.bin/yacc/tests/Makefile48
-rwxr-xr-xusr.bin/yacc/tests/yacc_tests.sh29
3 files changed, 38 insertions, 46 deletions
diff --git a/usr.bin/yacc/Makefile b/usr.bin/yacc/Makefile
index 45e7929db00b..c110f3f59024 100644
--- a/usr.bin/yacc/Makefile
+++ b/usr.bin/yacc/Makefile
@@ -10,9 +10,10 @@ PROG= yacc
SRCS= closure.c error.c graph.c lalr.c lr0.c main.c mkpar.c mstring.c output.c \
reader.c yaccpar.c symtab.c verbose.c warshall.c
-CFLAGS+= -DMIXEDCASE_FILENAMES=1 \
- -DHAVE_FCNTL_H=1 \
- -DHAVE_MKSTEMP=1
+CFLAGS+= -DHAVE_FCNTL_H=1 \
+ -DHAVE_MKSTEMP=1 \
+ -DMAXTABLE=INT_MAX \
+ -DMIXEDCASE_FILENAMES=1
YYPATCH!= cat ${BYACC_SRC}/VERSION
CFLAGS+= -DYYPATCH=${YYPATCH}
diff --git a/usr.bin/yacc/tests/Makefile b/usr.bin/yacc/tests/Makefile
index 2dadf4e89bcf..c8125a6f39c3 100644
--- a/usr.bin/yacc/tests/Makefile
+++ b/usr.bin/yacc/tests/Makefile
@@ -9,11 +9,15 @@ TEST_DIR= ${.CURDIR}/../../../contrib/byacc/test
TESTSDIR= ${TESTSBASE}/usr.bin/yacc
PLAIN_TESTS_SH= yacc_tests
+# NOTE: due to caveats with how permissions are handled on FreeBSD
+# with root, this must be run as a non-privileged user; otherwise
+# the testcases will fail unexpectedly.
+TEST_METADATA.yacc_tests+= required_user="unprivileged"
SCRIPTS= run_test
SCRIPTSDIR= ${TESTSDIR}
-FILESGROUPS= FILEStest FILEStest_yacc
+FILESGROUPS= FILES FILEStest FILEStest_yacc
FILEStestDIR= ${TESTSDIR}
@@ -245,36 +249,30 @@ FILEStest_yacc+= help.error
FILEStest_yacc+= help.output
FILEStest_yacc+= no_b_opt.error
FILEStest_yacc+= no_b_opt.output
-# XXX: expected: `f - cannot open "nosuchfile.c"; gets
-# `e - line 0 of "nosuchfile.y", unexpected end-of-file`.
-#FILEStest_yacc+= no_b_opt1.error
-#FILEStest_yacc+= no_b_opt1.output
-#FILEStest_yacc+= no_code_c.error
-#FILEStest_yacc+= no_code_c.output
-#FILEStest_yacc+= no_defines.error
-#FILEStest_yacc+= no_defines.output
-#FILEStest_yacc+= no_graph.error
-#FILEStest_yacc+= no_graph.output
-#FILEStest_yacc+= no_include.error
-#FILEStest_yacc+= no_include.output
+FILEStest_yacc+= no_b_opt1.error
+FILEStest_yacc+= no_b_opt1.output
+FILEStest_yacc+= no_code_c.error
+FILEStest_yacc+= no_code_c.output
+FILEStest_yacc+= no_defines.error
+FILEStest_yacc+= no_defines.output
+FILEStest_yacc+= no_graph.error
+FILEStest_yacc+= no_graph.output
+FILEStest_yacc+= no_include.error
+FILEStest_yacc+= no_include.output
FILEStest_yacc+= no_opts.error
FILEStest_yacc+= no_opts.output
-# XXX: expected: `f - cannot open "nosuchfile.c"; gets
-# `e - line 0 of "nosuchfile.y", unexpected end-of-file`.
-#FILEStest_yacc+= no_output.error
-#FILEStest_yacc+= no_output.output
-#FILEStest_yacc+= no_output1.error
-#FILEStest_yacc+= no_output1.output
+FILEStest_yacc+= no_output.error
+FILEStest_yacc+= no_output.output
+FILEStest_yacc+= no_output1.error
+FILEStest_yacc+= no_output1.output
FILEStest_yacc+= no_output2.error
FILEStest_yacc+= no_output2.output
FILEStest_yacc+= no_p_opt.error
FILEStest_yacc+= no_p_opt.output
-# XXX: expected: `f - cannot open "nosuchfile.c"; gets
-# `e - line 0 of "nosuchfile.y", unexpected end-of-file`.
-#FILEStest_yacc+= no_p_opt1.error
-#FILEStest_yacc+= no_p_opt1.output
-#FILEStest_yacc+= no_verbose.error
-#FILEStest_yacc+= no_verbose.output
+FILEStest_yacc+= no_p_opt1.error
+FILEStest_yacc+= no_p_opt1.output
+FILEStest_yacc+= no_verbose.error
+FILEStest_yacc+= no_verbose.output
FILEStest_yacc+= nostdin.error
FILEStest_yacc+= nostdin.output
FILEStest_yacc+= ok_syntax1.error
diff --git a/usr.bin/yacc/tests/yacc_tests.sh b/usr.bin/yacc/tests/yacc_tests.sh
index 9a2973a91c4d..6ad69161f876 100755
--- a/usr.bin/yacc/tests/yacc_tests.sh
+++ b/usr.bin/yacc/tests/yacc_tests.sh
@@ -3,22 +3,15 @@
set -e
-cd $(dirname $0)
+# Setup the environment for run_test
+# - run_test looks for `#define YYBTYACC` in ../config.h
+# - run_test assumes a yacc binary exists in ../yacc instead of running "yacc"
+# - run_test spams the test dir with files (polluting subsequent test runs),
+# so it's better to copy all the files to a temporary directory created by
+# kyua
+echo > "./config.h"
+mkdir "test"
+cp -Rf "$(dirname "$0")"/* "test"
+cp -p /usr/bin/yacc ./yacc
-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
+cd "test" && ./run_test