diff options
Diffstat (limited to 't')
-rw-r--r-- | t/ansi2knr-no-more.sh | 2 | ||||
-rw-r--r-- | t/ax/test-defs.in | 6 | ||||
-rw-r--r-- | t/get-sysconf.sh | 4 | ||||
-rw-r--r-- | t/libobj-no-dependency-tracking.sh | 56 | ||||
-rw-r--r-- | t/list-of-tests.mk | 3 | ||||
-rw-r--r-- | t/local.mk (renamed from t/Makefile.inc) | 12 | ||||
-rw-r--r-- | t/subobj-objname-clash.sh | 104 | ||||
-rw-r--r-- | t/wrap/aclocal.in | 29 | ||||
-rw-r--r-- | t/wrap/automake.in | 27 |
9 files changed, 173 insertions, 70 deletions
diff --git a/t/ansi2knr-no-more.sh b/t/ansi2knr-no-more.sh index f9128022b..8c13cd0a3 100644 --- a/t/ansi2knr-no-more.sh +++ b/t/ansi2knr-no-more.sh @@ -32,7 +32,7 @@ $ACLOCAL -Wnone 2>stderr && { cat stderr >&2; exit 1; } cat stderr >&2 grep "^configure\\.ac:5:.*$warn_rx" stderr -cat aclocal.sav "$am_automake_acdir"/obsolete.m4 > aclocal.m4 +cat aclocal.sav "$am_top_srcdir"/m4/obsolete.m4 > aclocal.m4 $AUTOCONF -Wnone 2>stderr && { cat stderr >&2; exit 1; } cat stderr >&2 grep "^configure\\.ac:5:.*$warn_rx" stderr diff --git a/t/ax/test-defs.in b/t/ax/test-defs.in index 2465c61c1..8cace053b 100644 --- a/t/ax/test-defs.in +++ b/t/ax/test-defs.in @@ -55,13 +55,13 @@ case ${am_running_installcheck:=no} in ;; no) am_amdir=$am_top_srcdir/lib/am - am_automake_acdir=$am_top_srcdir/m4 - am_bindir=$am_top_builddir/t/wrap + am_automake_acdir="" + am_bindir=$am_top_builddir/bin am_datadir=$am_top_srcdir am_docdir=$am_top_srcdir/doc am_pkgvdatadir=$am_top_srcdir/lib am_scriptdir=$am_top_srcdir/lib - am_system_acdir=$am_top_srcdir/m4/acdir + am_system_acdir="" ;; *) echo "$me: variable 'am_running_installcheck' has invalid" diff --git a/t/get-sysconf.sh b/t/get-sysconf.sh index 986c1dd36..a768b4769 100644 --- a/t/get-sysconf.sh +++ b/t/get-sysconf.sh @@ -55,8 +55,8 @@ $YACC --version || : $YACC --help || : cat "$am_top_builddir/config.log" || st=1 -cat "$am_top_builddir/t/wrap/aclocal-$APIVERSION" || st=1 -cat "$am_top_builddir/t/wrap/automake-$APIVERSION" || st=1 +cat "$am_top_builddir/bin/aclocal-$APIVERSION" || st=1 +cat "$am_top_builddir/bin/automake-$APIVERSION" || st=1 if test $st -eq 0; then # This test SKIPs, so that all the information it has gathered and diff --git a/t/libobj-no-dependency-tracking.sh b/t/libobj-no-dependency-tracking.sh new file mode 100644 index 000000000..1f024057e --- /dev/null +++ b/t/libobj-no-dependency-tracking.sh @@ -0,0 +1,56 @@ +#! /bin/sh +# Copyright (C) 2017 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/>. + +# Ensure that LIBOBJS source files are properly built without dependency +# tracking when using out of tree builds. +# +# This is a non regression test which is following an issue in flex-2.6.4 when +# "malloc.o" was required, see <https://github.com/westes/flex/issues/244>. + +. test-init.sh + +# The LIBOBJS are in a separate LIBOBJ_DIR directory without anything else in +# it to not trigger the creation of the build directory accidentally. +cat >> configure.ac << 'END' +AC_PROG_CC +AC_CONFIG_LIBOBJ_DIR([foo]) +AC_LIBOBJ([foo]) +AC_OUTPUT +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects +bin_PROGRAMS = helldl +LDADD = $(LIBOBJS) +.PHONY: dummy +dummy: $(LIBOBJS) +END + +mkdir foo +cat > foo/foo.c << 'END' +int foo() { return 0; } +END + +mkdir build + +$ACLOCAL +$AUTOCONF +$AUTOMAKE + +cd build +../configure --disable-dependency-tracking +run_make dummy +: diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index 051ac0c70..5e31ca2b6 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -38,6 +38,7 @@ t/override-conditional-pr13940.sh \ t/dist-pr109765.sh \ t/instdir-cond2.sh \ t/java-nobase.sh \ +t/libobj-no-dependency-tracking.sh \ t/objext-pr10128.sh \ t/remake-timing-bug-pr8365.sh \ t/lex-subobj-nodep.sh \ @@ -604,6 +605,7 @@ t/lflags.sh \ t/lflags-cxx.sh \ t/libexec.sh \ t/libobj-basic.sh \ +t/libobj-no-dependency-tracking.sh \ t/libobj2.sh \ t/libobj3.sh \ t/libobj4.sh \ @@ -1059,6 +1061,7 @@ t/subobjname.sh \ t/subobj-clean-pr10697.sh \ t/subobj-clean-lt-pr10697.sh \ t/subobj-indir-pr13928.sh \ +t/subobj-objname-clash.sh \ t/subobj-vpath-pr13928.sh \ t/subobj-pr13928-more-langs.sh \ t/subpkg.sh \ diff --git a/t/Makefile.inc b/t/local.mk index 708e93397..d5fd00cb1 100644 --- a/t/Makefile.inc +++ b/t/local.mk @@ -20,13 +20,13 @@ ## ------------ ## # Run the tests with a proper shell detected at configure time. -LOG_COMPILER = $(AM_TEST_RUNNER_SHELL) +LOG_COMPILER = ./pre-inst-env $(AM_TEST_RUNNER_SHELL) TEST_EXTENSIONS = .pl .sh .tap SH_LOG_COMPILER = $(LOG_COMPILER) TAP_LOG_COMPILER = $(LOG_COMPILER) -PL_LOG_COMPILER = $(PERL) -AM_PL_LOG_FLAGS = -Mstrict -I $(builddir)/lib -I $(srcdir)/lib -w +PL_LOG_COMPILER = ./pre-inst-env $(PERL) +AM_PL_LOG_FLAGS = -Mstrict -w TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(SHELL) $(srcdir)/lib/tap-driver.sh @@ -100,7 +100,7 @@ $(srcdir)/%D%/testsuite-part.am: $(srcdir)/gen-testsuite-part $(srcdir)/%D%/testsuite-part.am: Makefile.am # Hand-written tests for stuff in 'contrib/'. -include $(srcdir)/contrib/%D%/Makefile.inc +include $(srcdir)/contrib/%D%/local.mk TESTS += $(contrib_TESTS) EXTRA_DIST += $(contrib_TESTS) @@ -110,10 +110,6 @@ EXTRA_DIST += $(contrib_TESTS) # "make all". This makes it easier to run the test cases by # hand after having simply configured and built the package. -nodist_noinst_SCRIPTS += \ - %D%/wrap/aclocal-$(APIVERSION) \ - %D%/wrap/automake-$(APIVERSION) - dist_noinst_DATA += \ %D%/ax/test-init.sh \ %D%/ax/test-lib.sh \ diff --git a/t/subobj-objname-clash.sh b/t/subobj-objname-clash.sh new file mode 100644 index 000000000..a33d36bc5 --- /dev/null +++ b/t/subobj-objname-clash.sh @@ -0,0 +1,104 @@ +#! /bin/sh +# Copyright (C) 1996-2017 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 that object names don't clash when using subdir-objects. +# The check is done for clashing programs, clashing libraries and +# a program that clashes with a library + +. test-init.sh + +mkdir src + +cat >> configure.ac << 'END' +AC_PROG_CC +AC_PROG_RANLIB +AC_OUTPUT +END + +cat > Makefile.am << 'END' +AUTOMAKE_OPTIONS = subdir-objects foreign +noinst_PROGRAMS = +noinst_LIBRARIES = + +# CLASHING PROGRAMS +noinst_PROGRAMS += foo src/foo +foo_SOURCES = src/foo.c src/main.c +foo_CPPFLAGS = -DVAL=0 +src_foo_CPPFLAGS = -DVAL=1 +src_foo_SOURCES = src/foo.c src/main.c + +# CLASHING LIBS +noinst_PROGRAMS += bar src/bar +noinst_LIBRARIES += libbar.a src/libbar.a +bar_SOURCES = src/main.c +bar_LDADD = libbar.a +src_bar_SOURCES = src/main.c +src_bar_LDADD = src/libbar.a +libbar_a_SOURCES = src/foo.c +libbar_a_CPPFLAGS = -DVAL=0 +src_libbar_a_SOURCES = src/foo.c +src_libbar_a_CPPFLAGS = -DVAL=1 + +# CLASHING PROGRAM + LIB +noinst_PROGRAMS += libzap_a src/zap +noinst_LIBRARIES += src/libzap.a +libzap_a_SOURCES = src/main.c src/foo.c +libzap_a_CPPFLAGS = -DVAL=2 +src_zap_SOURCES = src/main.c +src_zap_LDADD = src/libzap.a +src_libzap_a_SOURCES = src/foo.c +src_libzap_a_CPPFLAGS = -DVAL=3 + +# NON-CLASHING +noinst_PROGRAMS += src/foo-uniq +src_foo_uniq_SOURCES = src/main.c src/foo.c +src_foo_uniq_CPPFLAGS = -DVAL=4 +END + +cat > src/foo.c << 'END' +int +foo () +{ + return VAL; +} +END + +cat > src/main.c << 'END' +int foo (void); + +int +main () +{ + return foo (); +} +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE --add-missing + +./configure +$MAKE +set +e +./foo || fail_ "./foo should return 0" +./src/foo; test $? = 1 || fail_ "./src/foo should return 1" +./bar || fail_ "./bar should return 0" +./src/bar; test $? = 1 || fail_ "./src/bar should return 1" +./libzap_a; test $? = 2 || fail_ "./libfoo_a should return 2" +./src/zap; test $? = 3 || fail_ "./src/prog_libfoo should return 3" +./src/foo-uniq; test $? = 4 || fail_ "./foo_uniq should return 4" +set -e +$MAKE clean diff --git a/t/wrap/aclocal.in b/t/wrap/aclocal.in deleted file mode 100644 index a624bcb16..000000000 --- a/t/wrap/aclocal.in +++ /dev/null @@ -1,29 +0,0 @@ -#!@PERL@ -w -# @configure_input@ - -# Copyright (C) 2012-2017 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/>. - -BEGIN -{ - use strict; - @Aclocal::perl_libdirs = ('@abs_top_srcdir@/lib'); - unshift @Aclocal::perl_libdirs, '@abs_top_builddir@/lib' - if '@srcdir@' ne '.'; - unshift @ARGV, - '--automake-acdir=@abs_top_srcdir@/m4', - '--system-acdir=@abs_top_srcdir@/m4/acdir'; -} -require '@abs_top_builddir@/bin/aclocal'; diff --git a/t/wrap/automake.in b/t/wrap/automake.in deleted file mode 100644 index 1075346a1..000000000 --- a/t/wrap/automake.in +++ /dev/null @@ -1,27 +0,0 @@ -#!@PERL@ -w -# @configure_input@ - -# Copyright (C) 2012-2017 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/>. - -BEGIN -{ - use strict; - @Automake::perl_libdirs = ('@abs_top_srcdir@/lib'); - unshift @Automake::perl_libdirs, '@abs_top_builddir@/lib' - if '@srcdir@' ne '.'; - unshift @ARGV, '--libdir=@abs_top_srcdir@/lib'; -} -require '@abs_top_builddir@/bin/automake'; |