From: Stefano Lattarini Date: Sat, 11 Aug 2012 13:18:34 +0000 (+0200) Subject: [ng] tests: fix spurious testsuite failures introduced by recent changes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93db6407baed3590fcdcfb617a47db2a81a53cfb;p=thirdparty%2Fautomake.git [ng] tests: fix spurious testsuite failures introduced by recent changes * 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 --- diff --git a/t/distcom2.sh b/t/distcom2.sh deleted file mode 100755 index 794d2ffd1..000000000 --- a/t/distcom2.sh +++ /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 . - -# 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 - -: diff --git a/t/distcom3.sh b/t/distcom3.sh index 98446c10d..b1fcd8b85 100755 --- a/t/distcom3.sh +++ b/t/distcom3.sh @@ -19,9 +19,13 @@ . ./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 diff --git a/t/hdr-vars-defined-once.sh b/t/hdr-vars-defined-once.sh index 5101755f1..54e2cb95d 100755 --- a/t/hdr-vars-defined-once.sh +++ b/t/hdr-vars-defined-once.sh @@ -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 : diff --git a/t/location.sh b/t/location.sh index 424904be4..d8921c816 100755 --- a/t/location.sh +++ b/t/location.sh @@ -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 diff --git a/t/targetclash.sh b/t/targetclash.sh index 9c71007e7..fccb29d8f 100755 --- a/t/targetclash.sh +++ b/t/targetclash.sh @@ -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 :