* t/subdir5.sh: Rename ... * t/subdir-add-pr46.sh: ... like this. * t/subdir8.sh: Rename ... * t/subdir-add2-pr46.sh: ... like this. * t/cond2.sh: Rename ... * t/subdir-cond-err.sh: ... like this. * t/subdir9.sh: Rename ... * t/subdir-with-slash.sh: ... like this; improve heading comments. * t/subcond.sh: Rename ... * t/subdir-cond-gettext.sh: ... like this; improve m4 quoting. * t/subcond2.sh: Rename ... * t/subdir-am-cond.sh: ... like this; adjust heading comments. * t/subcond3.sh: Rename ... * t/subdir-ac-subst.sh: ... like this; adjust heading comments. * t/subdir2.sh: Rename ... * t/subdir-subsub.sh: ... like this; enhance so that it also runs './configure' and 'make'. * t/subdir-order.sh: New test, check that the $(SUDBIRS) entries are processed in the order they are specified. * doc/automake.texi: Adjust references to tests.
Signed-off-by: Stefano Lattarini <stefano.lattar...@gmail.com> --- doc/automake.texi | 4 +- t/{subcond3.sh => subdir-ac-subst.sh} | 4 +- t/{subdir5.sh => subdir-add-pr46.sh} | 0 t/{subdir8.sh => subdir-add2-pr46.sh} | 0 t/{subcond2.sh => subdir-am-cond.sh} | 4 +- t/{cond2.sh => subdir-cond-err.sh} | 0 t/{subcond.sh => subdir-cond-gettext.sh} | 6 +- t/subdir-order.sh | 147 ++++++++++++++++++++++++++++++ t/{subdir2.sh => subdir-subsub.sh} | 9 +- t/{subdir9.sh => subdir-with-slash.sh} | 2 +- 10 files changed, 168 insertions(+), 8 deletions(-) rename t/{subcond3.sh => subdir-ac-subst.sh} (97%) rename t/{subdir5.sh => subdir-add-pr46.sh} (100%) rename t/{subdir8.sh => subdir-add2-pr46.sh} (100%) rename t/{subcond2.sh => subdir-am-cond.sh} (97%) rename t/{cond2.sh => subdir-cond-err.sh} (100%) rename t/{subcond.sh => subdir-cond-gettext.sh} (94%) create mode 100644 t/subdir-order.sh rename t/{subdir2.sh => subdir-subsub.sh} (91%) rename t/{subdir9.sh => subdir-with-slash.sh} (97%) diff --git a/doc/automake.texi b/doc/automake.texi index 222f9ec..1f4d7db 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -4338,7 +4338,7 @@ does not know the possible values of these variables. In this case @cindex @code{SUBDIRS} and @code{AM_CONDITIONAL} @cindex @code{AM_CONDITIONAL} and @code{SUBDIRS} -@c Keep in sync with subcond2.sh +@c Keep in sync with subdir-am-cond.sh @file{configure} should output the @file{Makefile} for each directory and define a condition into which @file{opt/} should be built. @@ -4378,7 +4378,7 @@ automatically because it knows that @code{MAYBE_OPT} can contain @cindex @code{SUBDIRS} and @code{AC_SUBST} @cindex @code{AC_SUBST} and @code{SUBDIRS} -@c Keep in sync with subcond3.sh +@c Keep in sync with subdir-ac-subst.sh Another possibility is to define @code{MAYBE_OPT} from @file{./configure} using @code{AC_SUBST}: diff --git a/t/subcond3.sh b/t/subdir-ac-subst.sh similarity index 97% rename from t/subcond3.sh rename to t/subdir-ac-subst.sh index e84aa41..0ef238b 100755 --- a/t/subcond3.sh +++ b/t/subdir-ac-subst.sh @@ -16,7 +16,7 @@ # The for conditional SUBDIRS. # SUBDIRS + AC_SUBST setup from the manual. -# Lots of lines here are duplicated in subcond2.test. +# Lots of lines here are duplicated in subcond-am-cond.test. . ./defs || Exit 1 @@ -88,3 +88,5 @@ $MAKE distcheck test -f sanity1 DISTCHECK_CONFIGURE_FLAGS=want_opt=yes $MAKE distcheck test -f sanity2 + +: diff --git a/t/subdir5.sh b/t/subdir-add-pr46.sh similarity index 100% rename from t/subdir5.sh rename to t/subdir-add-pr46.sh diff --git a/t/subdir8.sh b/t/subdir-add2-pr46.sh similarity index 100% rename from t/subdir8.sh rename to t/subdir-add2-pr46.sh diff --git a/t/subcond2.sh b/t/subdir-am-cond.sh similarity index 97% rename from t/subcond2.sh rename to t/subdir-am-cond.sh index 0e9f451..7f5e34a 100755 --- a/t/subcond2.sh +++ b/t/subdir-am-cond.sh @@ -16,7 +16,7 @@ # The for conditional SUBDIRS. # SUBDIRS + AM_CONDITIONAL setup from the manual. -# Lots of lines here are duplicated in subcond3.test. +# Lots of lines here are duplicated in subdir-ac-subst.test. . ./defs || Exit 1 @@ -87,3 +87,5 @@ $MAKE distcheck test -f sanity1 DISTCHECK_CONFIGURE_FLAGS=want_opt=yes $MAKE distcheck test -f sanity2 + +: diff --git a/t/cond2.sh b/t/subdir-cond-err.sh similarity index 100% rename from t/cond2.sh rename to t/subdir-cond-err.sh diff --git a/t/subcond.sh b/t/subdir-cond-gettext.sh similarity index 94% rename from t/subcond.sh rename to t/subdir-cond-gettext.sh index c09e5ad..459f639 100755 --- a/t/subcond.sh +++ b/t/subdir-cond-gettext.sh @@ -21,9 +21,9 @@ required=gettext cat >> configure.ac << 'END' AM_GNU_GETTEXT -AM_CONDITIONAL(MAUDE, true) +AM_CONDITIONAL([MAUDE], [true]) ALL_LINGUAS= -AC_SUBST(ALL_LINGUAS) +AC_SUBST([ALL_LINGUAS]) END mkdir po intl @@ -40,3 +40,5 @@ END $ACLOCAL # Gettext wants config.guess etc. $AUTOMAKE --add-missing + +: diff --git a/t/subdir-order.sh b/t/subdir-order.sh new file mode 100644 index 0000000..0321c25 --- /dev/null +++ b/t/subdir-order.sh @@ -0,0 +1,147 @@ +#! /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/>. + +# The $(SUDBIRS) entries are processed in the order they are specified. + +. ./defs || Exit 1 + +cat >> configure.ac << 'END' +AC_CONFIG_FILES([ + sub0/Makefile + sub1/Makefile + sub2/Makefile + sub3/Makefile + sub3/a/Makefile + sub3/b/Makefile +]) +AC_OUTPUT +END + +mkdir sub0 sub1 sub2 sub3 sub3/a sub3/b + +cat > Makefile.am << 'END' +SUBDIRS = sub2 sub1 sub3 sub0 +all-local: + test -f sub0/run + test -f sub1/run + test -f sub2/run + test -f sub3/run + test -f sub3/a/run + test -f sub3/b/run + test ! -f run + : > run + +CLEANFILES = \ + run \ + sub0/run \ + sub1/run \ + sub2/run \ + sub3/run \ + sub3/a/run \ + sub3/b/run +END + +cat > sub0/Makefile.am << 'END' +all-local: + test ! -f $(top_builddir)/run + test -f $(top_builddir)/sub1/run + test -f $(top_builddir)/sub3/run + test -f $(top_builddir)/sub3/a/run + test -f $(top_builddir)/sub3/b/run + test ! -f run + : > run +END + +cat > sub1/Makefile.am << 'END' +all-local: + test ! -f $(top_builddir)/run + test ! -f $(top_builddir)/sub0/run + test -f $(top_builddir)/sub2/run + test ! -f $(top_builddir)/sub3/run + test ! -f $(top_builddir)/sub3/a/run + test ! -f $(top_builddir)/sub3/b/run + test ! -f run + : > run +END + + +cat > sub2/Makefile.am << 'END' +all-local: + test ! -f $(top_builddir)/run + test ! -f $(top_builddir)/sub0/run + test ! -f $(top_builddir)/sub1/run + test ! -f $(top_builddir)/sub3/run + test ! -f $(top_builddir)/sub3/a/run + test ! -f $(top_builddir)/sub3/b/run + test ! -f run + : > run +END + +cat > sub3/Makefile.am << 'END' +SUBDIRS = b . a +all-local: + test ! -f $(top_builddir)/run + test ! -f $(top_builddir)/sub0/run + test -f $(top_builddir)/sub1/run + test ! -f $(top_builddir)/sub3/a/run + test -f $(top_builddir)/sub3/b/run + test ! -f run + : > run +END + +cat > sub3/a/Makefile.am << 'END' +all-local: + test ! -f $(top_builddir)/run + test ! -f $(top_builddir)/sub0/run + test -f $(top_builddir)/sub1/run + test -f $(top_builddir)/sub3/b/run + test -f $(top_builddir)/sub3/run + test ! -f run + : > run +END + +cat > sub3/b/Makefile.am << 'END' +all-local: + test ! -f $(top_builddir)/run + test ! -f $(top_builddir)/sub0/run + test -f $(top_builddir)/sub1/run + test ! -f $(top_builddir)/sub3/b/run + test ! -f $(top_builddir)/sub3/run + test ! -f run + : > run +END + + +$ACLOCAL +$AUTOCONF +$AUTOMAKE -c --add-missing + +./configure + +for j in '' -j12; do + $MAKE $j + test -f run + test -f sub0/run + test -f sub1/run + test -f sub3/run + test -f sub3/a/run + test -f sub3/b/run + $MAKE clean + find . | grep 'run$' && Exit 1 + : # For shells with busted 'set -e' +done + +: diff --git a/t/subdir2.sh b/t/subdir-subsub.sh similarity index 91% rename from t/subdir2.sh rename to t/subdir-subsub.sh index 31e3c61..15f2f93 100755 --- a/t/subdir2.sh +++ b/t/subdir-subsub.sh @@ -43,10 +43,17 @@ SUBDIRS = two END cat > one/two/Makefile.am << 'END' -pkgdata_DATA = +pkgdata_DATA = data.txt +data.txt: + echo dummy >$@ END $ACLOCAL +$AUTOCONF $AUTOMAKE --gnu +./configure +$MAKE +test -f one/two/data.txt + : diff --git a/t/subdir9.sh b/t/subdir-with-slash.sh similarity index 97% rename from t/subdir9.sh rename to t/subdir-with-slash.sh index 116e1c3..eb9f4fe 100755 --- a/t/subdir9.sh +++ b/t/subdir-with-slash.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/>. -# Test SUDBIRS with /. +# Test SUDBIRS with '/' in them. . ./defs || Exit 1 -- 1.7.9.5