]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] tests: fix spurious testsuite failures introduced by recent changes
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 11 Aug 2012 13:18:34 +0000 (15:18 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 11 Aug 2012 13:50:23 +0000 (15:50 +0200)
* t/distcom2.sh: Remove as basically obsolete.
* t/distcom3.sh: Use semantic checks rather than brittle grepping checks.
* t/hdr-vars-defined-once.sh: Likewise.
* t/location.sh: Remove some checks that would become too cumbersome to
run.
* t/targetclash.sh: Adjust to ensure the expected automake diagnostic is
actually triggered.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/distcom2.sh [deleted file]
t/distcom3.sh
t/hdr-vars-defined-once.sh
t/location.sh
t/targetclash.sh

diff --git a/t/distcom2.sh b/t/distcom2.sh
deleted file mode 100755 (executable)
index 794d2ff..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2001-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 that depcomp and compile are added to am.dist.common-files.
-# Report from Pavel Roskin.  Report of problems with '--no-force' from
-# Scott James Remnant (Debian #206299)
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_CONFIG_FILES([subdir/Makefile])
-AC_OUTPUT
-END
-
-cat > Makefile.am << 'END'
-SUBDIRS = subdir
-END
-
-mkdir subdir
-: > subdir/foo.c
-
-cat > subdir/Makefile.am << 'END'
-noinst_PROGRAMS = foo
-foo_SOURCES = foo.c
-foo_CFLAGS = -DBAR
-END
-
-$ACLOCAL
-
-for opt in '' --no-force; do
-
-  $AUTOMAKE $opt --add-missing
-
-  test -f compile
-  test -f depcomp
-
-  for dir in . subdir; do
-    sed -n 's/^am.dist.common-files = *\(.*\)$/ \1 /p' \
-      <$dir/Makefile.in >$dir/dc.txt
-  done
-
-  cat dc.txt # For debugging.
-  cat subdir/dc.txt # Likewise.
-
-  $FGREP ' $(am.conf.aux-dir)/depcomp ' subdir/dc.txt
-  # The 'compile' script will be listed in the am.dist.common-files of
-  # the top-level Makefile because it's required in configure.ac
-  # (by AM_PROG_CC_C_O).
-  $FGREP ' $(am.conf.aux-dir)/compile ' dc.txt \
-    || $FGREP ' compile ' dc.txt
-
-done
-
-:
index 98446c10d8ed638ddd69fb732caa94e76e52e8df..b1fcd8b8549280ed9e7954bec5a4e13d62caf24b 100755 (executable)
 
 . ./defs || exit 1
 
+echo AC_OUTPUT >> configure.ac
+
 cat > Makefile.am << 'END'
 README:
        echo 'I bet you are reading me.' > README
+test-distcommon:
+       echo ' ' $(am.dist.common-files) ' ' | grep ' README '
 END
 
 # Files required by '--gnu'.
@@ -36,20 +40,14 @@ $AUTOMAKE --add-missing --gnu >output 2>&1 || { cat output; exit 1; }
 cat output
 grep README output && exit 1
 
-sed -n -e '/^am.dist.common-files =.*\\$/ {
-   :loop
-   p
-   n
-   t clear
-   :clear
-   s/\\$/\\/
-   t loop
-   p
-   n
-   }' -e '/^am.dist.common-files =/ p' Makefile.in | grep README
-
+$AUTOCONF
+./configure
+$MAKE test-distcommon
+$MAKE distdir
+test -f $distdir/README
 
 # Should warn about missing README.
+rm -f README
 : > Makefile.am
 AUTOMAKE_fails --add-missing --gnu
 grep 'required file.*README.*not found' stderr
index 5101755f1c1dc50979647c3cc36e40436c73ad2c..54e2cb95d7eb526ff036c75c0055956771e45e75 100755 (executable)
@@ -25,25 +25,22 @@ END
 
 cat > Makefile.am << 'END'
 include Will_Be_Included_In_Makefile
+test-distcommon:
+       echo ' ' $(am.dist.common-files) ' ' \
+          | grep '[ /]Will_Be_Included_In_Makefile '
 END
 
-: > Will_Be_Included_In_Makefile
+id=0c35bbde7c95b569a
+echo "# $id" > Will_Be_Included_In_Makefile
 
 $ACLOCAL
 $AUTOMAKE
 test $(grep -c '^srcdir' Makefile.in) -eq 1
 
-# Also make sure include file is distributed.
-sed -n -e '/^am.dist.common-files =.*\\$/ {
-   :loop
-   p
-   n
-   t clear
-   :clear
-   s/\\$/\\/
-   t loop
-   p
-   n
-   }' -e '/^am.dist.common-files =/ p' Makefile.in | grep Will_Be_Included_In_Makefile
+$AUTOCONF
+./configure
+$MAKE test-distcommon
+$MAKE distdir
+grep "$id" $distdir/Will_Be_Included_In_Makefile
 
 :
index 424904be45d83f8e6325e53219a59e75230135cd..d8921c816d9514e25ee7533c4eacdd413084aa13 100755 (executable)
@@ -19,7 +19,6 @@
 . ./defs || exit 1
 
 cat >> configure.ac << 'END'
-AM_CONDITIONAL([COND1], [true])
 AM_CONDITIONAL([COND2], [true])
 AC_PROG_CC
 AM_PROG_AR
@@ -31,9 +30,6 @@ bin_PROGRAMS = libfoo.a
 if COND2
   lib_LIBRARIES = libfoo.a
 endif
-if COND1
-  bin_PROGRAMS += distdir
-endif
 VAR = 1 \
       2 \
       3
@@ -62,8 +58,8 @@ smash_useless_diffs stderr >observed
 # Apparently useless use of sed here required to avoid spuriously
 # triggering some maintainer-checks failures.
 sed 's/^> //' > expected << 'END'
-> Makefile.am:12: warning: VAR multiply defined in condition TRUE ...
-> Makefile.am:8: ... 'VAR' previously defined here
+> Makefile.am:9: warning: VAR multiply defined in condition TRUE ...
+> Makefile.am:5: ... 'VAR' previously defined here
 > automake: error: libfoo_a_OBJECTS should not be defined
 > Makefile.am:3:   while processing library 'libfoo.a'
 > automake: error: use 'libfoo_a_LDADD', not 'libfoo_a_LIBADD'
@@ -77,9 +73,6 @@ sed 's/^> //' > expected << 'END'
 > Makefile.am:1:   while processing program 'libfoo.a'
 > library.am: ... 'libfoo.a' previously defined here
 > Makefile.am:3:   while processing library 'libfoo.a'
-> distdir.am: warning: redefinition of 'distdir' ...
-> program.am: ... 'distdir$(EXEEXT)' previously defined here
-> Makefile.am:6:   while processing program 'distdir'
 END
 
 cat expected
index 9c71007e7c9bee7229338ef63e66eb7f31ac8d3b..fccb29d8f24dd8d5b1546ec5593ff7171275d37c 100755 (executable)
@@ -23,11 +23,12 @@ AC_PROG_CC
 END
 
 cat > Makefile.am << 'END'
-bin_PROGRAMS = distdir
+data_DATA =
+bin_PROGRAMS = uninstall-dataDATA
 END
 
 $ACLOCAL
 AUTOMAKE_fails -a
-grep 'redefinition.*distdir' stderr
+grep 'redefinition.*uninstall-dataDATA' stderr
 
 :