diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-10-27 16:15:04 +0200 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-10-27 16:15:04 +0200 |
commit | f897907bee30ec66fdebfe04d3c2d6ad8b8da501 (patch) | |
tree | aa5d7adf385b25b8fbec971d1d282d7ca0656459 /t | |
parent | b0f4556918deaf2efa42a298c27f42195e909815 (diff) | |
parent | 9a2796ad854c70c221c9d19956264246d9783430 (diff) | |
download | automake-f897907bee30ec66fdebfe04d3c2d6ad8b8da501.tar.gz |
Merge branch 'maint'
* maint:
tests: merge, tweak and modernize few test scripts
tests: move coverage about BUILT_SOURCES
tests: more meaningful names for some test cases
tests: merge some grepping tests on Yacc support
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/am-default-source-ext.sh (renamed from t/specflg10.sh) | 0 | ||||
-rwxr-xr-x | t/built-sources-check.sh (renamed from t/check3.sh) | 16 | ||||
-rwxr-xr-x | t/built-sources-cond.sh | 91 | ||||
-rwxr-xr-x | t/built-sources-fork-bomb.sh | 70 | ||||
-rwxr-xr-x | t/built-sources-install.sh | 69 | ||||
-rwxr-xr-x | t/built-sources-subdir.sh (renamed from t/subdirbuiltsources.sh) | 21 | ||||
-rwxr-xr-x | t/built-sources.sh | 68 | ||||
-rwxr-xr-x | t/cxxcpp.sh | 4 | ||||
-rwxr-xr-x | t/cxxo.sh | 34 | ||||
-rwxr-xr-x | t/empty-data-primary.sh (renamed from t/empty.sh) | 0 | ||||
-rwxr-xr-x | t/empty-sources-primary.tap (renamed from t/empty4.sh) | 27 | ||||
-rwxr-xr-x | t/empty2.sh | 35 | ||||
-rwxr-xr-x | t/empty3.sh | 32 | ||||
-rwxr-xr-x | t/fo.sh | 36 | ||||
-rw-r--r-- | t/list-of-tests.mk | 40 | ||||
-rwxr-xr-x | t/no-outdir-option.sh | 29 | ||||
-rwxr-xr-x | t/no-spurious-install-recursive.sh (renamed from t/bsource.sh) | 0 | ||||
-rwxr-xr-x | t/per-target-flags.sh | 100 | ||||
-rwxr-xr-x | t/specflg.sh | 51 | ||||
-rwxr-xr-x | t/specflg2.sh | 59 | ||||
-rwxr-xr-x | t/specflg3.sh | 43 | ||||
-rwxr-xr-x | t/subdir-env-interference.sh (renamed from t/subdir10.sh) | 0 | ||||
-rwxr-xr-x | t/suffix-custom-subobj-and-specflg.sh (renamed from t/suffix13.sh) | 0 | ||||
-rwxr-xr-x | t/suffix-custom-subobj.sh (renamed from t/suffix12.sh) | 0 | ||||
-rwxr-xr-x | t/yacc-grepping.sh (renamed from t/yacc2.sh) | 16 | ||||
-rwxr-xr-x | t/yacc-grepping2.sh (renamed from t/yacc5.sh) | 0 | ||||
-rwxr-xr-x | t/yacc-headers-and-dist-pr47.sh (renamed from t/yacc7.sh) | 0 | ||||
-rwxr-xr-x | t/yacc-subdir.sh (renamed from t/yacc8.sh) | 0 | ||||
-rwxr-xr-x | t/yacc.sh | 37 |
29 files changed, 458 insertions, 420 deletions
diff --git a/t/specflg10.sh b/t/am-default-source-ext.sh index 4e0fed893..4e0fed893 100755 --- a/t/specflg10.sh +++ b/t/am-default-source-ext.sh diff --git a/t/check3.sh b/t/built-sources-check.sh index 3e4ce96f8..d4d3c51e2 100755 --- a/t/check3.sh +++ b/t/built-sources-check.sh @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -# Make sure 'check:' and 'install:' honor $(BUILT_SOURCES). +# Make sure 'check:' honors $(BUILT_SOURCES). # PR/359. # For gen-testsuite-part: ==> try-with-serial-tests <== @@ -63,18 +63,6 @@ cat stdout grep '^PASS: subrun\.sh *$' stdout grep 'PASS.*echo\.sh' stdout && exit 1 -# check should depend directly on $(BUILT_SOURCES) (similar tests -# are in check.sh and check2.sh). -$EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' Makefile.in -$EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' dir/Makefile.in - -$MAKE clean -# Sanity checks -test ! -e command1.inc -test ! -e dir/command2.inc -# Now make sure these two files are rebuilt during make install. -$MAKE install -test -f command1.inc -test -f dir/command2.inc +$MAKE distcheck : diff --git a/t/built-sources-cond.sh b/t/built-sources-cond.sh new file mode 100755 index 000000000..ac78a9756 --- /dev/null +++ b/t/built-sources-cond.sh @@ -0,0 +1,91 @@ +#! /bin/sh +# Copyright (C) 2003-2012 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Interaction of BUILT_SOURCES with conditionals. + +. ./defs || exit 1 + +cat >> configure.ac <<'END' +AM_CONDITIONAL([COND1], [test $cond1 = yes]) +AM_CONDITIONAL([COND2], [test $cond2 = yes]) +AC_OUTPUT +END + +cat > Makefile.am << 'END' +if COND1 +BUILT_SOURCES = a +else +BUILT_SOURCES = b +endif +if COND2 +BUILT_SOURCES += c +endif + +a b c: + echo who cares > $@ +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +cleanup () +{ + # Files in $(BUILT_SOURCES) should be automatically removed + # upon maintainer-clean. + $MAKE maintainer-clean + test ! -f a + test ! -f b + test ! -f c +} + +./configure cond1=yes cond2=yes + +$MAKE +test -f a +test ! -f b +test -f c + +cleanup + +./configure cond1=no cond2=yes + +$MAKE +test ! -f a +test -f b +test -f c + +cleanup + +./configure cond1=yes cond2=no + +$MAKE +test -f a +test ! -f b +test ! -f c + +cleanup + +./configure cond1=no cond2=no + +$MAKE +test ! -f a +test -f b +test ! -f c + +cleanup + +: diff --git a/t/built-sources-fork-bomb.sh b/t/built-sources-fork-bomb.sh new file mode 100755 index 000000000..fac37505f --- /dev/null +++ b/t/built-sources-fork-bomb.sh @@ -0,0 +1,70 @@ +#! /bin/sh +# Copyright (C) 2012 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Due to how the handling of $(BUILT_SOURCES) is implemented in Automake-NG, +# a recursive make call in the recipe of any $(BUILT_SOURCES) (or of any of +# its prerequisites) might cause an infinite recursion (complete with fork +# bomb, yuck) if not handled correctly. Verify that this doesn't happen. +# For more background, see: +# <http://lists.gnu.org/archive/html/help-smalltalk/2012-08/msg00027.html> +# <http://lists.gnu.org/archive/html/automake-patches/2012-08/msg00052.html> +# Backported to improve coverage of mainline Automake. + +required=GNUmake +. ./defs || exit 1 + +echo AC_OUTPUT >> configure.ac + +cat > Makefile.am << 'END' +BUILT_SOURCES = foo +.PHONY: build-foo +build-foo: + echo OK > foo +foo: + $(MAKE) build-foo + +# If the bug is still present, we want this test to fail, not to actually +# go fork bomb and potentially crash the user machine. Take care of that. + +is_too_deep := $(shell test $(MAKELEVEL) -lt 10 && echo no) + +## Extra indentation here required to avoid confusing Automake. + ifeq ($(is_too_deep),no) + # All is ok. + else + $(error ::OOPS:: Recursion too deep, $(MAKELEVEL) levels) + endif +END + +$ACLOCAL +$AUTOMAKE -Wno-portability +$AUTOCONF + +./configure + +$MAKE -n foo >output 2>&1 || { cat output; exit 1; } +cat output +test ! -f foo +# Guard against possible infinite recursion. +$FGREP '::OOPS::' output && exit 1 + +$MAKE foo >output 2>&1 || { cat output; exit 1; } +cat output +$MAKE foo +# Guard against possible infinite recursion. +$FGREP '::OOPS::' output && exit 1 + +: diff --git a/t/built-sources-install.sh b/t/built-sources-install.sh new file mode 100755 index 000000000..2f53bb51e --- /dev/null +++ b/t/built-sources-install.sh @@ -0,0 +1,69 @@ +#! /bin/sh +# Copyright (C) 2002-2012 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Make sure 'install:' honors $(BUILT_SOURCES). +# PR/359. + +. ./defs || exit 1 + +cat >> configure.ac << 'END' +AC_CONFIG_FILES([dir/Makefile]) +AC_OUTPUT +END + +mkdir dir + +cat > Makefile.am << 'END' +BUILT_SOURCES = built1 +SUBDIRS = dir +built1: + echo ok > $@ +CLEANFILES = built1 +install-data-hook: + $(MKDIR_P) $(DESTDIR)$(prefix)/dir2 + cp built1 $(DESTDIR)$(prefix)/built1 + cp dir/built2 $(DESTDIR)$(prefix)/dir2/built3 +uninstall-hook: + rm -f $(DESTDIR)$(prefix)/built1 + rm -f $(DESTDIR)$(prefix)/dir2/built3 + rmdir $(DESTDIR)$(prefix)/dir2 +installcheck-local: + test -f $(prefix)/built1 + test -f $(prefix)/dir2/built3 +END + +cat > dir/Makefile.am << 'END' +BUILT_SOURCES = built2 +built2: +## The next line ensures that command1.inc has been built before +## recurring into the subdir. + cp ../built1 $@ +CLEANFILES = built2 +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE +./configure --prefix "$(pwd)/inst" + +# Now make sure these two files are rebuilt during make install. +$MAKE install +test -f built1 +test -f dir/built2 +$MAKE installcheck +$MAKE distcheck + +: diff --git a/t/subdirbuiltsources.sh b/t/built-sources-subdir.sh index 84f65a680..cc162bb99 100755 --- a/t/subdirbuiltsources.sh +++ b/t/built-sources-subdir.sh @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -# Make sure when using SUBDIR that all BUILT_SOURCES are built. +# Make sure when using SUBDIRS that all BUILT_SOURCES are built. # A bug occurred where subdirs do not have all-recursive or # all-recursive-am which depended on BUILT_SOURCES. @@ -31,14 +31,6 @@ AM_PROG_AR AC_OUTPUT END -# Files required because we are using '--gnu'. -: > INSTALL -: > NEWS -: > README -: > COPYING -: > AUTHORS -: > ChangeLog - cat > Makefile.am << 'END' SUBDIRS = lib END @@ -47,25 +39,24 @@ cat > lib/Makefile.am << 'END' pkgdata_DATA = noinst_LIBRARIES = libfoo.a libfoo_a_SOURCES = foo.c -BUILT_SOURCES=foo.h +BUILT_SOURCES = foo.h foo.h: echo \#define FOO_DEFINE 1 >$@ +CLEANFILES = $(BUILT_SOURCES) END cat > lib/foo.c << 'END' #include <foo.h> -int foo () { return !FOO_DEFINE;} +int foo (void) { return !FOO_DEFINE; } END $ACLOCAL $AUTOCONF -$AUTOMAKE --include-deps --copy --force-missing --add-missing --gnu +$AUTOMAKE --copy --add-missing ./configure - -# Remove the comment to get a successful test. -# $MAKE -C lib foo.h $MAKE +$MAKE distcheck : diff --git a/t/built-sources.sh b/t/built-sources.sh new file mode 100755 index 000000000..517313660 --- /dev/null +++ b/t/built-sources.sh @@ -0,0 +1,68 @@ +#! /bin/sh +# Copyright (C) 2003-2012 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Basic test on BUILT_SOURCES. + +required=cc +. ./defs || exit 1 + +cat >> configure.ac <<'END' +AC_PROG_CC +AC_OUTPUT +END + +cat > Makefile.am << 'END' +BUILT_SOURCES = foo.c +noinst_PROGRAMS = bar baz +foo.c: + rm -f $@ $@-t +## Use printf, not echo, to avoid spurious interpretation of +## the "\n" as a newline (seen on NetBSD 5.1). + printf '%s\n' '#include <stdio.h>' > $@-t + printf '%s\n' 'int main (void)' >> $@-t + printf '%s\n' '{ ' >> $@-t + printf '%s\n' ' printf ("%s\n", FOOMSG);' >> $@-t + printf '%s\n' ' return 0;' >> $@-t + printf '%s\n' '}' >> $@-t + mv -f $@-t $@ +CLEANFILES = foo.c +END + +cat > bar.c <<'END' +#define FOOMSG "Howdy, World" +#include "foo.c" +END + +cat > baz.c <<'END' +#define FOOMSG "Hello, Earth" +#include "foo.c" +END + +$ACLOCAL +$AUTOMAKE +$AUTOCONF + +./configure +$MAKE +if cross_compiling; then :; else + ./bar + ./bar | grep 'Howdy, World' + ./baz + ./baz | grep 'Hello, Earth' +fi +$MAKE distcheck + +: diff --git a/t/cxxcpp.sh b/t/cxxcpp.sh index f2bb75a60..cd5d392a9 100755 --- a/t/cxxcpp.sh +++ b/t/cxxcpp.sh @@ -27,4 +27,6 @@ END $ACLOCAL $AUTOMAKE -grep '^CXXCPP' Makefile.in +grep '^CXXCPP =' Makefile.in + +: diff --git a/t/cxxo.sh b/t/cxxo.sh deleted file mode 100755 index 4a021311d..000000000 --- a/t/cxxo.sh +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/sh -# Copyright (C) 1996-2012 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Make sure C++ files are rewritten to ".o" and not just "o". -. ./defs || exit 1 - -cat >> configure.ac << 'END' -AC_PROG_CXX -END - -cat > Makefile.am << 'END' -sbin_PROGRAMS = anonymous -anonymous_SOURCES = doe.C -END - -: > doe.C - -$ACLOCAL -$AUTOMAKE - -$FGREP 'doe.$(OBJEXT)' Makefile.in diff --git a/t/empty.sh b/t/empty-data-primary.sh index a8e1b1678..a8e1b1678 100755 --- a/t/empty.sh +++ b/t/empty-data-primary.sh diff --git a/t/empty4.sh b/t/empty-sources-primary.tap index 1233f4097..3e5b3f400 100755 --- a/t/empty4.sh +++ b/t/empty-sources-primary.tap @@ -14,25 +14,36 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -# Test to make sure empty _SOURCES works. -# From Paul Berrevoets. +# A test for missing _SOURCES variable. Also test to make sure empty +# _SOURCES suppresses assumption about default name. . ./defs || exit 1 +plan_ 5 + cat >> configure.ac << 'END' AC_PROG_CC -AC_SUBST(ZOO_OBJ) +AC_SUBST([zoo_obj]) END cat > Makefile.am << 'END' +sbin_PROGRAMS = pavel + +bin_PROGRAMS = pavel2 +pavel2_SOURCES = + noinst_PROGRAMS = zoo zoo_SOURCES = EXTRA_zoo_SOURCES = bar.c foo.c -zoo_DEPENDENCIES = $(ZOO_OBJ) +zoo_DEPENDENCIES = $(zoo_obj) zoo_LDADD = $(zoo_DEPENDENCIES) END -$ACLOCAL -$AUTOMAKE -$FGREP zoo. Makefile.in && exit 1 -exit 0 +command_ok_ "aclocal" $ACLOCAL +command_ok_ "automake" $AUTOMAKE + +command_ok_ "default _SOURCES" $FGREP ' pavel.c' Makefile.in +command_ok_ "empty _SOURCES (basic)" not $FGREP 'pavel2.' Makefile.in +command_ok_ "empty _SOURCES (elaborate)" not $FGREP 'zoo.' Makefile.in + +: diff --git a/t/empty2.sh b/t/empty2.sh deleted file mode 100755 index 47a079256..000000000 --- a/t/empty2.sh +++ /dev/null @@ -1,35 +0,0 @@ -#! /bin/sh -# Copyright (C) 1999-2012 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Test to make sure empty _SOURCES suppresses assumption about default -# name. Report from Pavel Roskin. - -. ./defs || exit 1 - -cat >> configure.ac << 'END' -AC_PROG_CC -END - -cat > Makefile.am << 'END' -bin_PROGRAMS = pavel -pavel_SOURCES = -END - -$ACLOCAL -$AUTOMAKE - -grep 'pavel\.[co]' Makefile.in && exit 1 -exit 0 diff --git a/t/empty3.sh b/t/empty3.sh deleted file mode 100755 index f77f4396a..000000000 --- a/t/empty3.sh +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/sh -# Copyright (C) 1999-2012 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# A test for missing _SOURCES variable. - -. ./defs || exit 1 - -cat >> configure.ac << 'END' -AC_PROG_CC -END - -cat > Makefile.am << 'END' -bin_PROGRAMS = pavel -END - -$ACLOCAL -$AUTOMAKE - -grep 'pavel\.[co]' Makefile.in diff --git a/t/fo.sh b/t/fo.sh deleted file mode 100755 index 4ca1a0562..000000000 --- a/t/fo.sh +++ /dev/null @@ -1,36 +0,0 @@ -#! /bin/sh -# Copyright (C) 1998-2012 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Make sure Fortran 77 files are rewritten to ".o" and not just "o". -# Matthew D. Langston <langston@SLAC.Stanford.EDU> - -. ./defs || exit 1 - -cat >> configure.ac << 'END' -AC_PROG_F77 -END - -cat > Makefile.am << 'END' -sbin_PROGRAMS = anonymous -anonymous_SOURCES = doe.f -END - -: > doe.f - -$ACLOCAL -$AUTOMAKE - -$FGREP 'doe.$(OBJEXT)' Makefile.in diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 425e545d8..6d01646fa 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -131,6 +131,7 @@ t/amopt.sh \ t/amopts-location.sh \ t/amopts-variable-expansion.sh \ t/amsubst.sh \ +t/am-default-source-ext.sh \ t/ansi2knr-no-more.sh \ t/ar-lib.sh \ t/ar-lib2.sh \ @@ -186,7 +187,12 @@ t/badline.sh \ t/badopt.sh \ t/badprog.sh \ t/block.sh \ -t/bsource.sh \ +t/built-sources-check.sh \ +t/built-sources-cond.sh \ +t/built-sources-fork-bomb.sh \ +t/built-sources-install.sh \ +t/built-sources-subdir.sh \ +t/built-sources.sh \ t/candist.sh \ t/canon.sh \ t/canon2.sh \ @@ -202,7 +208,6 @@ t/ccnoco2.sh \ t/ccnoco3.sh \ t/check.sh \ t/check2.sh \ -t/check3.sh \ t/check4.sh \ t/check5.sh \ t/check6.sh \ @@ -338,7 +343,6 @@ t/cxx-lt-demo.sh \ t/cxxlibobj.sh \ t/cxxlink.sh \ t/cxxnoc.sh \ -t/cxxo.sh \ t/cygnus-no-more.sh \ t/cygwin32.sh \ t/dash.sh \ @@ -419,10 +423,8 @@ t/dollarvar2.sh \ t/double.sh \ t/dup2.sh \ t/else.sh \ -t/empty.sh \ -t/empty2.sh \ -t/empty3.sh \ -t/empty4.sh \ +t/empty-data-primary.sh \ +t/empty-sources-primary.tap \ t/exdir.sh \ t/exdir2.sh \ t/exdir3.sh \ @@ -458,7 +460,6 @@ t/flibs.sh \ t/fn99.sh \ t/fn99subdir.sh \ t/fnoc.sh \ -t/fo.sh \ t/forcemiss.sh \ t/forcemiss2.sh \ t/fort1.sh \ @@ -690,7 +691,7 @@ t/mkinst3.sh \ t/mmode.sh \ t/mmodely.sh \ t/no-extra-makefile-code.sh \ -t/no-outdir-option.sh \ +t/no-spurious-install-recursive.sh \ t/nobase.sh \ t/nobase-libtool.sh \ t/nobase-python.sh \ @@ -818,6 +819,7 @@ t/test-extensions-cond.sh \ t/parse.sh \ t/percent.sh \ t/percent2.sh \ +t/per-target-flags.sh \ t/phony.sh \ t/pluseq.sh \ t/pluseq2.sh \ @@ -986,14 +988,10 @@ t/silent-yacc-headers.sh \ t/src-acsubst.sh \ t/sourcefile-in-subdir.sh \ t/space.sh \ -t/specflg.sh \ -t/specflg2.sh \ -t/specflg3.sh \ t/specflg6.sh \ t/specflg7.sh \ t/specflg8.sh \ t/specflg9.sh \ -t/specflg10.sh \ t/specflg-dummy.sh \ t/spell.sh \ t/spell2.sh \ @@ -1017,12 +1015,11 @@ t/subdir-add2-pr46.sh \ t/subdir-am-cond.sh \ t/subdir-cond-err.sh \ t/subdir-cond-gettext.sh \ +t/subdir-env-interference.sh \ t/subdir-order.sh \ t/subdir-with-slash.sh \ t/subdir-subsub.sh \ -t/subdir10.sh \ t/subdir-distclean.sh \ -t/subdirbuiltsources.sh \ t/subobj.sh \ t/subobj2.sh \ t/subobj4.sh \ @@ -1064,9 +1061,9 @@ t/suffix8.tap \ t/suffix9.sh \ t/suffix10.tap \ t/suffix11.tap \ -t/suffix12.sh \ -t/suffix13.sh \ t/suffix-chain.tap \ +t/suffix-custom-subobj.sh \ +t/suffix-custom-subobj-and-specflg.sh \ t/symlink.sh \ t/symlink2.sh \ t/syntax.sh \ @@ -1244,12 +1241,7 @@ t/werror3.sh \ t/werror4.sh \ t/whoami.sh \ t/xsource.sh \ -t/yacc.sh \ -t/yacc2.sh \ t/yacc4.sh \ -t/yacc5.sh \ -t/yacc7.sh \ -t/yacc8.sh \ t/yaccdry.sh \ t/yaccpp.sh \ t/yaccvpath.sh \ @@ -1268,10 +1260,14 @@ t/yacc-depend.sh \ t/yacc-depend2.sh \ t/yacc-dist-nobuild-subdir.sh \ t/yacc-dist-nobuild.sh \ +t/yacc-grepping.sh \ +t/yacc-grepping2.sh \ +t/yacc-headers-and-dist-pr47.sh \ t/yacc-line.sh \ t/yacc-mix-c-cxx.sh \ t/yacc-nodist.sh \ t/yacc-pr204.sh \ +t/yacc-subdir.sh \ t/yacc-weirdnames.sh \ t/yflags.sh \ t/yflags2.sh \ diff --git a/t/no-outdir-option.sh b/t/no-outdir-option.sh deleted file mode 100755 index 59987b59d..000000000 --- a/t/no-outdir-option.sh +++ /dev/null @@ -1,29 +0,0 @@ -#! /bin/sh -# Copyright (C) 2010-2012 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Check that the '-o' aka '--output-dir' option is not recognized anymore. - -. ./defs || exit 1 - -: > Makefile.am - -AUTOMAKE_fails -Wno-error --output-dir=foo -grep 'unrecognized option.*--output-dir' stderr - -AUTOMAKE_fails -Wno-error -o foo -grep 'unrecognized option.*-o' stderr - -: diff --git a/t/bsource.sh b/t/no-spurious-install-recursive.sh index d16b58060..d16b58060 100755 --- a/t/bsource.sh +++ b/t/no-spurious-install-recursive.sh diff --git a/t/per-target-flags.sh b/t/per-target-flags.sh new file mode 100755 index 000000000..e5278fb27 --- /dev/null +++ b/t/per-target-flags.sh @@ -0,0 +1,100 @@ +#! /bin/sh +# Copyright (C) 1999-2012 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 +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# Test executable-specific and library-specific flags, both with +# and without dependency tracking. + +. ./defs || Exit 1 + +makefiles='Makefile libMakefile Makefile2 libMakefile2' + +cat > configure.ac << END +AC_INIT([$me], [1.0]) +AM_INIT_AUTOMAKE([-Wno-extra-portability]) +AC_CONFIG_FILES([$makefiles]) +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_CXX +AC_PROG_RANLIB +AC_OUTPUT +END + +$ACLOCAL + +cat > Makefile.am << 'END' +bin_PROGRAMS = foo +foo_SOURCES = foo.c +foo_CFLAGS = -DBAR +END + +cat > libMakefile.am << 'END' +lib_LIBRARIES = libfoo.a +libfoo_a_SOURCES = foo.c bar.cc +libfoo_a_CFLAGS = -DBAR +libfoo_a_CXXFLAGS = -DZOT +END + +cat - Makefile.am > Makefile2.am << 'END' +AUTOMAKE_OPTIONS = no-dependencies +END + +cat - libMakefile.am > libMakefile2.am << 'END' +AUTOMAKE_OPTIONS = no-dependencies +END + +# Make sure 'compile' is required. +for m in $makefiles; do + AUTOMAKE_fails $m + $EGREP " required file.* '(compile|\./compile)'" stderr +done + +makefiles=$(for mkf in $makefiles; do echo $mkf.in; done) + +: > compile +$AUTOMAKE + +# Sanity check. +for mkf in $makefiles; do test -f $mkf || exit 99; done + +# Regression test for missing space. +$FGREP ')-c' $makefiles && exit 1 + +# Regression test for botchedly transformed object names. +$FGREP '.o.o' $makefiles && exit 1 +$FGREP '.obj.obj' $makefiles && exit 1 +$FGREP '.$(OBJEXT).$(OBJEXT)' $makefiles && exit 1 + +# Watch against non-transformed "foo.$(OBJEXT)", "foo.o" and "foo.obj" +# (and similarly for bar). +$EGREP '[^-](foo|bar)\.[o$]' $makefiles && exit 1 + +# All our programs and libraries have per-target flags, so all +# the compilers invocations must use an explicit '-c' option. +grep '\$.COMPILE' $makefiles | grep -v ' -c' && exit 1 + +$FGREP 'foo-foo.$(OBJEXT)' Makefile.in +$FGREP 'foo-foo.$(OBJEXT)' Makefile2.in +$FGREP 'libfoo_a-foo.$(OBJEXT)' libMakefile.in +$FGREP 'libfoo_a-foo.$(OBJEXT)' libMakefile2.in +$FGREP 'libfoo_a-bar.$(OBJEXT)' libMakefile.in +$FGREP 'libfoo_a-bar.$(OBJEXT)' libMakefile2.in + +$FGREP '$(foo_CFLAGS)' Makefile.in +$FGREP '$(foo_CFLAGS)' Makefile2.in +$FGREP '$(libfoo_a_CFLAGS)' libMakefile.in +$FGREP '$(libfoo_a_CFLAGS)' libMakefile2.in + +: diff --git a/t/specflg.sh b/t/specflg.sh deleted file mode 100755 index c56c6aa59..000000000 --- a/t/specflg.sh +++ /dev/null @@ -1,51 +0,0 @@ -#! /bin/sh -# Copyright (C) 1999-2012 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Test of flags specific to executable. - -. ./defs || exit 1 - -cat >> configure.ac << 'END' -AC_PROG_CC -AM_PROG_CC_C_O -END - -cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = no-dependencies -bin_PROGRAMS = foo -foo_SOURCES = foo.c -foo_CFLAGS = -DBAR -END - -# Make sure 'compile' is required. -$ACLOCAL -AUTOMAKE_fails -grep 'required.*compile' stderr - -: > compile - -$AUTOMAKE - -# Look for $(COMPILE) -c in .c.o rule. -grep 'COMPILE. [^-]' Makefile.in && exit 1 - -# Look for foo-foo.o. -grep '[^-]foo\.o' Makefile.in && exit 1 - -# Regression test for missing space. -$FGREP ')-c' Makefile.in && exit 1 - -exit 0 diff --git a/t/specflg2.sh b/t/specflg2.sh deleted file mode 100755 index 4560715c1..000000000 --- a/t/specflg2.sh +++ /dev/null @@ -1,59 +0,0 @@ -#! /bin/sh -# Copyright (C) 1999-2012 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Test library-specific flags. - -. ./defs || exit 1 - -cat >> configure.ac << 'END' -AC_PROG_CC -AM_PROG_CC_C_O -AC_PROG_CXX -AM_PROG_AR -AC_PROG_RANLIB -END - -cat > Makefile.am << 'END' -AUTOMAKE_OPTIONS = no-dependencies -lib_LIBRARIES = libfoo.a -libfoo_a_SOURCES = foo.c bar.cc -libfoo_a_CFLAGS = -DBAR -libfoo_a_CXXFLAGS = -DZOT -END - -: > ar-lib - -# Make sure 'compile' is required. -$ACLOCAL -AUTOMAKE_fails -grep 'required.*compile' stderr - -: > compile - -$AUTOMAKE - -# Look for $(COMPILE) -c in .c.o rule. -grep 'COMPILE. [^-]' Makefile.in && exit 1 - -# Look for libfoo_a-foo.o. -grep foo Makefile.in -grep '[^-]foo\.o' Makefile.in && exit 1 - -# Look for libfoo_a-bar.o. -grep bar Makefile.in -grep '[^-]bar\.o' Makefile.in && exit 1 - -exit 0 diff --git a/t/specflg3.sh b/t/specflg3.sh deleted file mode 100755 index 9c56acaf5..000000000 --- a/t/specflg3.sh +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh -# Copyright (C) 1999-2012 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Test exe-specific flags with dependency tracking. - -. ./defs || exit 1 - -cat >> configure.ac << 'END' -AC_PROG_CC -AM_PROG_CC_C_O -AC_OUTPUT -END - -cat > Makefile.am << 'END' -bin_PROGRAMS = foo -foo_SOURCES = foo.c -foo_CFLAGS = -DFOO -END - -: > compile - -$ACLOCAL -$AUTOMAKE - -$FGREP ' -o foo-foo' Makefile.in -$FGREP 'foo.o.o' Makefile.in && exit 1 -$FGREP 'foo.$(OBJEXT).$(OBJEXT)' Makefile.in && exit 1 -$FGREP '$(foo_CFLAGS)' Makefile.in - -: diff --git a/t/subdir10.sh b/t/subdir-env-interference.sh index 396aecc24..396aecc24 100755 --- a/t/subdir10.sh +++ b/t/subdir-env-interference.sh diff --git a/t/suffix13.sh b/t/suffix-custom-subobj-and-specflg.sh index bcdbc9a0b..bcdbc9a0b 100755 --- a/t/suffix13.sh +++ b/t/suffix-custom-subobj-and-specflg.sh diff --git a/t/suffix12.sh b/t/suffix-custom-subobj.sh index 22ec98520..22ec98520 100755 --- a/t/suffix12.sh +++ b/t/suffix-custom-subobj.sh diff --git a/t/yacc2.sh b/t/yacc-grepping.sh index 64e542121..19036c4c7 100755 --- a/t/yacc2.sh +++ b/t/yacc-grepping.sh @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# Copyright (C) 1996-2012 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 @@ -14,9 +14,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -# Test to make sure intermediate .h file is not generated nor removed -# if (AM_)?YFLAGS do not contain -d. Requested by Jim Meyering. -# See also the related semantic test 'yacc-d-basic.sh'. +# Some grep-based checks on yacc support: +# +# - Make sure intermediate .c file is built from yacc source. +# Report from Thomas Morgan. +# +# - Make sure intermediate .h file is not generated nor removed +# if (AM_)?YFLAGS do not contain '-d'. +# Requested by Jim Meyering. . ./defs || exit 1 @@ -38,18 +43,21 @@ END cp Makefile.am Makefile.src $AUTOMAKE -a +$FGREP 'zardoz.c' Makefile.in # If zardoz.h IS mentioned, fail. $FGREP 'zardoz.h' Makefile.in && exit 1 cp Makefile.src Makefile.am echo 'AM_YFLAGS = -d' >> Makefile.am $AUTOMAKE +$FGREP 'zardoz.c' Makefile.in # If zardoz.h is NOT mentioned, fail. $FGREP 'zardoz.h' Makefile.in cp Makefile.src Makefile.am echo 'AM_YFLAGS = ' >> Makefile.am $AUTOMAKE +$FGREP 'zardoz.c' Makefile.in # If zardoz.h IS mentioned, fail. $FGREP 'zardoz.h' Makefile.in && exit 1 diff --git a/t/yacc5.sh b/t/yacc-grepping2.sh index 4382ded62..4382ded62 100755 --- a/t/yacc5.sh +++ b/t/yacc-grepping2.sh diff --git a/t/yacc7.sh b/t/yacc-headers-and-dist-pr47.sh index 5d7be75e5..5d7be75e5 100755 --- a/t/yacc7.sh +++ b/t/yacc-headers-and-dist-pr47.sh diff --git a/t/yacc8.sh b/t/yacc-subdir.sh index 3f12c5437..3f12c5437 100755 --- a/t/yacc8.sh +++ b/t/yacc-subdir.sh diff --git a/t/yacc.sh b/t/yacc.sh deleted file mode 100755 index 0a838a9c0..000000000 --- a/t/yacc.sh +++ /dev/null @@ -1,37 +0,0 @@ -#! /bin/sh -# Copyright (C) 1996-2012 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 -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Test to make sure intermediate .c file is built from yacc source. -# Bug from Thomas Morgan. - -. ./defs || exit 1 - -cat >> configure.ac << 'END' -AC_PROG_CC -AC_PROG_YACC -END - -cat > Makefile.am <<'END' -bin_PROGRAMS = zardoz -zardoz_SOURCES = zardoz.y -END - -$ACLOCAL -$AUTOMAKE -a - -$FGREP 'zardoz.c' Makefile.in - -: |