svn commit: r272973 - in stable/10: tools/build/mk usr.bin/yacc/tests
Craig Rodrigues
rodrigc at FreeBSD.org
Sat Oct 11 23:31:45 UTC 2014
Author: rodrigc
Date: Sat Oct 11 23:31:44 2014
New Revision: 272973
URL: https://svnweb.freebsd.org/changeset/base/272973
Log:
Merge: r269884
Complete the usr.bin/yacc kyua integration work I originally
submitted via r268811
- Install the Kyuafile by adding FILES to FILESGROUPS
- Run the testcases with an unprivileged user
Some of the testcases depend upon behavior that's broken when
run as root on FreeBSD because of how permissions are treated
with access(2) vs eaccess(2), open(2), etc
- Simplify the test driver to just inspect the exit code from
run_test because it now exits with 0 if successful and exits
with !0 if unsuccessful
- Don't do ad hoc temporary directory creation/deletion; let Kyua
handle that
- Add entries for files removed in r268811 to
OptionalObsoleteFiles.inc
PR: 191020
X-MFC with: r268811
Approved by: jmmv (mentor)
Reviewed by: bapt
Sponsored by: EMC / Isilon Storage Division
Modified:
stable/10/tools/build/mk/OptionalObsoleteFiles.inc
stable/10/usr.bin/yacc/tests/Makefile
stable/10/usr.bin/yacc/tests/yacc_tests.sh
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 11 23:24:09 2014 (r272972)
+++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Sat Oct 11 23:31:44 2014 (r272973)
@@ -4511,6 +4511,24 @@ OLD_DIRS+=usr/tests/usr.bin/make/archive
OLD_DIRS+=usr/tests/usr.bin/make/archives/fmt_44bsd
OLD_DIRS+=usr/tests/usr.bin/make/archives
OLD_DIRS+=usr/tests/usr.bin/make
+OLD_FILES+=usr/tests/usr.bin/yacc/legacy_test
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.00.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.01.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.02.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.03.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.04.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.05.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.06.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.07.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.08.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.09.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.10.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.11.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.12.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.13.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.14.out
+OLD_FILES+=usr/tests/usr.bin/yacc/regress.sh
+OLD_FILES+=usr/tests/usr.bin/yacc/undefined.y
.endif
.else
# ATF libraries.
Modified: stable/10/usr.bin/yacc/tests/Makefile
==============================================================================
--- stable/10/usr.bin/yacc/tests/Makefile Sat Oct 11 23:24:09 2014 (r272972)
+++ stable/10/usr.bin/yacc/tests/Makefile Sat Oct 11 23:31:44 2014 (r272973)
@@ -9,11 +9,15 @@ TEST_DIR= ${.CURDIR}/../../../contrib/by
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
Modified: stable/10/usr.bin/yacc/tests/yacc_tests.sh
==============================================================================
--- stable/10/usr.bin/yacc/tests/yacc_tests.sh Sat Oct 11 23:24:09 2014 (r272972)
+++ stable/10/usr.bin/yacc/tests/yacc_tests.sh Sat Oct 11 23:31:44 2014 (r272973)
@@ -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
More information about the svn-src-all
mailing list