From owner-svn-src-all@FreeBSD.ORG Tue Aug 12 18:10:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 041CC587 for ; Tue, 12 Aug 2014 18:10:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 127FF3599 for ; Tue, 12 Aug 2014 17:51:27 +0000 (UTC) Received: from ngie (uid 1347) (envelope-from ngie@FreeBSD.org) id 6328 by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 12 Aug 2014 17:51:26 +0000 From: Garrett Cooper Date: Tue, 12 Aug 2014 17:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269884 - in head: tools/build/mk usr.bin/yacc/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53ea541e.6328.217eee9b@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 18:10:31 -0000 Author: ngie Date: Tue Aug 12 17:51:26 2014 New Revision: 269884 URL: http://svnweb.freebsd.org/changeset/base/269884 Log: 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: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/yacc/tests/Makefile head/usr.bin/yacc/tests/yacc_tests.sh Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Aug 12 17:03:13 2014 (r269883) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Aug 12 17:51:26 2014 (r269884) @@ -4575,6 +4575,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: head/usr.bin/yacc/tests/Makefile ============================================================================== --- head/usr.bin/yacc/tests/Makefile Tue Aug 12 17:03:13 2014 (r269883) +++ head/usr.bin/yacc/tests/Makefile Tue Aug 12 17:51:26 2014 (r269884) @@ -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: head/usr.bin/yacc/tests/yacc_tests.sh ============================================================================== --- head/usr.bin/yacc/tests/yacc_tests.sh Tue Aug 12 17:03:13 2014 (r269883) +++ head/usr.bin/yacc/tests/yacc_tests.sh Tue Aug 12 17:51:26 2014 (r269884) @@ -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