automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [FYI] [ng] tests: fix spurious testsuite failures introduc


From: Stefano Lattarini
Subject: [Automake-NG] [FYI] [ng] tests: fix spurious testsuite failures introduced by recent changes
Date: Sat, 11 Aug 2012 15:49:03 +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/targetcla.sh: Adjust to ensure the expected automake diagnostic is
actually triggered.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 t/distcom2.sh              | 69 ----------------------------------------------
 t/distcom3.sh              | 22 +++++++--------
 t/hdr-vars-defined-once.sh | 23 +++++++---------
 t/location.sh              | 11 ++------
 t/targetclash.sh           |  5 ++--
 5 files changed, 25 insertions(+), 105 deletions(-)
 delete mode 100755 t/distcom2.sh

diff --git a/t/distcom2.sh b/t/distcom2.sh
deleted file mode 100755
index 794d2ff..0000000
--- 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 <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
-
-:
diff --git a/t/distcom3.sh b/t/distcom3.sh
index 98446c1..b1fcd8b 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 5101755..54e2cb9 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 424904b..d8921c8 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 9c71007..fccb29d 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
 
 :
-- 
1.7.12.rc0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]