Pushing this patch as pre-approved -- see here: <http://lists.gnu.org/archive/html/automake-patches/2011-01/msg00062.html>
Applied to temporary branch yacc-work, and merged into master. I've tested it on GNU/Linux with YACC=no, YACC=heirloom-yacc, and YACC=''. The modified testcases behaved as expected. Regards, Stefano
From 8b419dd7b084dc4481ea7c581c7cd173cd1b7a0f Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Tue, 11 Jan 2011 20:03:05 +0100 Subject: [PATCH] tests: do not force yacc-requiring tests to use bison * tests/defs.in: New required entry 'yacc'. Remove old required entry 'bison'. * tests/cond35.test ($required): Require yacc, not bison. * tests/cond36.test: Likewise. * tests/pr204.test: Likewise. * tests/silent-many-gcc.test: Likewise. * tests/silent-many-generic.test: Likewise. * tests/silent-yacc-gcc.test: Likewise. * tests/silent-yacc-generic.test: Likewise. * tests/subpkg.test: Likewise. * tests/suffix10.test: Likewise. * tests/yacc-basic.test: Likewise. * tests/yacc-clean.test: Likewise. * tests/yacc-d-basic.test: Likewise. * tests/yacc-d-vpath.test: Likewise. * tests/yacc-dist-nobuild.test: Likewise. * tests/yacc-nodist.test: Likewise. * tests/yacc4.test: Likewise. * tests/yacc6.test: Likewise. * tests/yacc7.test: Likewise. * tests/yacc8.test: Likewise. * tests/yaccdry.test: Likewise. * tests/yaccvpath.test: Likewise. --- ChangeLog | 27 +++++++++++++++++++++++++++ tests/cond35.test | 4 ++-- tests/cond36.test | 4 ++-- tests/defs.in | 23 ++++++++++++++++------- tests/pr204.test | 4 ++-- tests/silent-many-gcc.test | 4 ++-- tests/silent-many-generic.test | 4 ++-- tests/silent-yacc-gcc.test | 4 ++-- tests/silent-yacc-generic.test | 4 ++-- tests/subpkg.test | 5 +++-- tests/suffix10.test | 4 ++-- tests/yacc-basic.test | 2 +- tests/yacc-clean.test | 2 +- tests/yacc-d-basic.test | 2 +- tests/yacc-d-vpath.test | 2 +- tests/yacc-dist-nobuild.test | 2 +- tests/yacc-nodist.test | 2 +- tests/yacc4.test | 4 ++-- tests/yacc6.test | 6 +++--- tests/yacc7.test | 6 +++--- tests/yacc8.test | 6 +++--- tests/yaccdry.test | 4 ++-- tests/yaccvpath.test | 2 +- 23 files changed, 82 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index 90eb69e..430f6ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2011-01-11 Stefano Lattarini <stefano.lattar...@gmail.com> + + tests: do not force yacc-requiring tests to use bison + * tests/defs.in: New required entry 'yacc'. Remove old + required entry 'bison'. + * tests/cond35.test ($required): Require yacc, not bison. + * tests/cond36.test: Likewise. + * tests/pr204.test: Likewise. + * tests/silent-many-gcc.test: Likewise. + * tests/silent-many-generic.test: Likewise. + * tests/silent-yacc-gcc.test: Likewise. + * tests/silent-yacc-generic.test: Likewise. + * tests/subpkg.test: Likewise. + * tests/suffix10.test: Likewise. + * tests/yacc-basic.test: Likewise. + * tests/yacc-clean.test: Likewise. + * tests/yacc-d-basic.test: Likewise. + * tests/yacc-d-vpath.test: Likewise. + * tests/yacc-dist-nobuild.test: Likewise. + * tests/yacc-nodist.test: Likewise. + * tests/yacc4.test: Likewise. + * tests/yacc6.test: Likewise. + * tests/yacc7.test: Likewise. + * tests/yacc8.test: Likewise. + * tests/yaccdry.test: Likewise. + * tests/yaccvpath.test: Likewise. + 2011-01-10 Stefano Lattarini <stefano.lattar...@gmail.com> yacc: warn about conditional content in *YFLAGS variables diff --git a/tests/cond35.test b/tests/cond35.test index 0f3b8cf..34a7e7f 100755 --- a/tests/cond35.test +++ b/tests/cond35.test @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ # Check rules output for parser defined conditionally. # Report from Roman Fietze. -required='flex bison gcc' +required='flex yacc gcc' . ./defs || Exit 1 set -e diff --git a/tests/cond36.test b/tests/cond36.test index f6c97db..d06ed87 100755 --- a/tests/cond36.test +++ b/tests/cond36.test @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2004, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # Check rules output for parser defined conditionally. -required='flex bison gcc' +required='flex yacc gcc' . ./defs || Exit 1 set -e diff --git a/tests/defs.in b/tests/defs.in index ee19dbe..dfb5f2e 100644 --- a/tests/defs.in +++ b/tests/defs.in @@ -93,13 +93,6 @@ do # Check that each required tool is present. case $tool in :) ;; - bison) - # Since bison is required, we pick YACC for ./configure. - YACC='bison -y' - export YACC - echo "$me: running bison --version" - ( bison --version ) || exit 77 - ;; bzip2) # Do not use --version, bzip2 still tries to compress stdin. echo "$me: running bzip2 --help" @@ -216,6 +209,22 @@ do echo "$me: running texi2dvi -o /dev/null --version" ( texi2dvi -o /dev/null --version ) || exit 77 ;; + yacc) + if test x"$YACC" = x"no"; then + # The user has explicitly told he doesn't want a yacc program + # to be used. + echo "$me: \$YACC is \"no\", skipping test" >&2 + exit 77 + elif test -z "$YACC"; then + # The user hasn't explicitly specified any yacc program in the + # environment, so we try to use bison, skipping the test if it's + # not found. + YACC='bison -y' + export YACC + echo "$me: running bison --version" + bison --version || exit 77 + fi + ;; # Generic case: the tool must support --version. *) echo "$me: running $tool --version" diff --git a/tests/pr204.test b/tests/pr204.test index 22a1e54..c87f895 100755 --- a/tests/pr204.test +++ b/tests/pr204.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002, 2004, 2010 Free Software Foundation, Inc. +# Copyright (C) 2002, 2004, 2010, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ # For PR 204. # Sources derived from nodist_ sources should not be distributed. -required='bison gcc' +required='yacc gcc' . ./defs || Exit 1 set -e diff --git a/tests/silent-many-gcc.test b/tests/silent-many-gcc.test index d770a46..5e6d191 100755 --- a/tests/silent-many-gcc.test +++ b/tests/silent-many-gcc.test @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2009, 2010 Free Software Foundation, Inc. +# Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ # This test requires the GNU compilers; keep it in sync with sister test # `silent-many-generic.test', which should work with generic compilers. -required='gcc g++ gfortran flex bison' +required='gcc g++ gfortran flex yacc' . ./defs || Exit 1 set -e diff --git a/tests/silent-many-generic.test b/tests/silent-many-generic.test index 223a97c..ed27448 100755 --- a/tests/silent-many-generic.test +++ b/tests/silent-many-generic.test @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2009, 2010 Free Software Foundation, Inc. +# Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,7 +23,7 @@ # and forces the use of gcc depmode. # FIXME: generic C++/Fortran compilers should suffice here -required='g++ gfortran flex bison' +required='g++ gfortran flex yacc' . ./defs || Exit 1 set -e diff --git a/tests/silent-yacc-gcc.test b/tests/silent-yacc-gcc.test index 33ae8ae..83e6ebe 100755 --- a/tests/silent-yacc-gcc.test +++ b/tests/silent-yacc-gcc.test @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2010 Free Software Foundation, Inc. +# Copyright (C) 2010, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ # Check silent-rules mode for Yacc, forcing gcc depmode. # Keep this in sync with sister test `silent-yacc-generic.test'. -required='gcc bison' +required='gcc yacc' . ./defs || Exit 1 set -e diff --git a/tests/silent-yacc-generic.test b/tests/silent-yacc-generic.test index b7489da..553e78b 100755 --- a/tests/silent-yacc-generic.test +++ b/tests/silent-yacc-generic.test @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2010 Free Software Foundation, Inc. +# Copyright (C) 2010, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ # Check silent-rules mode for Yacc. # Keep this in sync with sister test `silent-yacc-gcc.test'. -required='bison' +required=yacc . ./defs || Exit 1 set -e diff --git a/tests/subpkg.test b/tests/subpkg.test index 3662937..0eea79d 100755 --- a/tests/subpkg.test +++ b/tests/subpkg.test @@ -1,5 +1,6 @@ #! /bin/sh -# Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. +# Copyright (C) 2002, 2003, 2004, 2006, 2011 Free Software Foundation, +# Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +17,7 @@ # Check subpackage handling. -required='gcc bison' +required='gcc yacc' . ./defs || Exit 1 set -e diff --git a/tests/suffix10.test b/tests/suffix10.test index 131359c..e244455 100755 --- a/tests/suffix10.test +++ b/tests/suffix10.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2002, 2010 Free Software Foundation, Inc. +# Copyright (C) 2002, 2010, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ # Make sure that derivations work with .lo too. # (related to PR/37) -required='libtoolize bison' +required='libtoolize yacc' . ./defs || Exit 1 set -e diff --git a/tests/yacc-basic.test b/tests/yacc-basic.test index e8bf27d..4faea95 100755 --- a/tests/yacc-basic.test +++ b/tests/yacc-basic.test @@ -16,7 +16,7 @@ # Basic semantic checks on Yacc support. -required=bison +required=yacc . ./defs || Exit 1 set -e diff --git a/tests/yacc-clean.test b/tests/yacc-clean.test index d6a3fca..c8e8863 100755 --- a/tests/yacc-clean.test +++ b/tests/yacc-clean.test @@ -18,7 +18,7 @@ # are cleaned by "make clean", while .c and .h files derived from # distributed .y sources are cleaned by "make maintainer-clean". -required=bison +required=yacc . ./defs || Exit 1 set -e diff --git a/tests/yacc-d-basic.test b/tests/yacc-d-basic.test index f5f88d8..11e5ba3 100755 --- a/tests/yacc-d-basic.test +++ b/tests/yacc-d-basic.test @@ -17,7 +17,7 @@ # Tests on basic Yacc support for when we have -d in YFLAGS, AM_YFLAGS # or maude_YFLAGS. -required=bison +required=yacc . ./defs || Exit 1 set -e diff --git a/tests/yacc-d-vpath.test b/tests/yacc-d-vpath.test index 0edaaa8..bb09990 100755 --- a/tests/yacc-d-vpath.test +++ b/tests/yacc-d-vpath.test @@ -22,7 +22,7 @@ # Please keep this in sync with sister test `yaccvpath.test'. -required=bison +required=yacc . ./defs || Exit 1 set -e diff --git a/tests/yacc-dist-nobuild.test b/tests/yacc-dist-nobuild.test index a6444de..9061f57 100755 --- a/tests/yacc-dist-nobuild.test +++ b/tests/yacc-dist-nobuild.test @@ -17,7 +17,7 @@ # Check that distributed Yacc-generated parsers are not uselessly # remade from an unpacked distributed tarball. -required=bison +required=yacc . ./defs || Exit 1 set -e diff --git a/tests/yacc-nodist.test b/tests/yacc-nodist.test index 2b4ce09..46b4167 100755 --- a/tests/yacc-nodist.test +++ b/tests/yacc-nodist.test @@ -16,7 +16,7 @@ # Checks for .c and .h files derived from non-distributed .y sources. -required=bison +required=yacc . ./defs || Exit 1 set -e diff --git a/tests/yacc4.test b/tests/yacc4.test index bb25290..1d508ed 100755 --- a/tests/yacc4.test +++ b/tests/yacc4.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2001, 2002, 2010 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2010, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # Some simple tests of ylwrap functionality. -required='bison gcc' +required='yacc gcc' . ./defs || Exit 1 set -e diff --git a/tests/yacc6.test b/tests/yacc6.test index b9b259b..bbb587e 100755 --- a/tests/yacc6.test +++ b/tests/yacc6.test @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (C) 2001, 2002, 2003, 2004, 2006, 2007, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2004, 2006, 2007, 2010, 2011 Free +# Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ # Also make sure depcomp does not needlessly update headers. # Report from Paolo Bonzini. -required='gcc bison GNUmake' +required='gcc yacc GNUmake' . ./defs || Exit 1 set -e diff --git a/tests/yacc7.test b/tests/yacc7.test index 2b866bc..6d4815d 100755 --- a/tests/yacc7.test +++ b/tests/yacc7.test @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (C) 2001, 2002, 2003, 2004, 2010 Free Software Foundation, -# Inc. +# Copyright (C) 2001, 2002, 2003, 2004, 2010, 2011 Free Software +# Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ # Also check that the sources of the generated parser are distributed. # PR/47. -required=bison +required=yacc . ./defs || Exit 1 set -e diff --git a/tests/yacc8.test b/tests/yacc8.test index 797f4e7..a683c8d 100755 --- a/tests/yacc8.test +++ b/tests/yacc8.test @@ -1,6 +1,6 @@ #! /bin/sh -# Copyright (C) 2002, 2003, 2004, 2006, 2010 Free Software Foundation, -# Inc. +# Copyright (C) 2002, 2003, 2004, 2006, 2010, 2011 Free Software +# Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ # Test for subdir parsers. -required="gcc bison" +required="gcc yacc" . ./defs || Exit 1 diff --git a/tests/yaccdry.test b/tests/yaccdry.test index d2e7632..d30fb80 100755 --- a/tests/yaccdry.test +++ b/tests/yaccdry.test @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2010 Free Software Foundation, Inc. +# Copyright (C) 2010, 2011 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ # Removal recovery rules for headers should not remove files with `make -n'. -required=bison +required=yacc . ./defs || Exit 1 set -e diff --git a/tests/yaccvpath.test b/tests/yaccvpath.test index c4dc400..52092fa 100755 --- a/tests/yaccvpath.test +++ b/tests/yaccvpath.test @@ -23,7 +23,7 @@ # Please keep this in sync with sister test `yacc-d-vpath.test'. -required=bison +required=yacc . ./defs || Exit 1 set -e -- 1.7.2.3