]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Modernize, improve and extend tests `subobj*.test'.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 27 Jun 2010 14:34:42 +0000 (16:34 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 10 Aug 2010 17:39:21 +0000 (19:39 +0200)
* tests/subobjname.test:  Add trailing `:' command.
* tests/subobj.test: Make grepping of `Makefile.in' stricter.
Escape literal dots in grep regexps.
* tests/subobj2.test:  Add trailing `:' command.  Do not use the
unportable fgrep option `-e'.
* tests/subobj3.test: Add trailing `:' command.
(configure.in): Use proper m4 quoting, and avoid obsolescent
constructs.
* tests/subobj8.test: Likewise.  Also, enable `errexit' shell
flag, with related changes
* tests/subobj4.test: Likewise.  Also, make grepping of
`Makefile.in' stricter.
* tests/subobj5.test: Add trailing `:' command.  Move setting of
`errexit' shell flag earlier in the script (just after inclusion
of ./defs).
(configure.in): Use the stub created by `./defs', rather than
writing it from scratch, and avoid obsolescent constructs.
* tests/subobj6.test: Add trailing `:' command.  Move setting of
`errexit' shell flag earlier in the script (just after inclusion
of ./defs).  Do not create useless dummy ac-init file `f'.
* tests/subobj7.test: Do not create useless dummy ac-init file
`f'.
(configure.in): Use the stub created by `./defs', rather than
writing it from scratch, and avoid obsolescent constructs.
* tests/subobj9.test: Move setting of `errexit' shell flag earlier
in the script (just after inclusion of ./defs).  Fail the test if
`make distcheck' fails.  Ensure verbose printing of captured make
stdout.  Avoid uselsss fork by doing simple grep instead of using
test -n "`COMMAND | grep ...`".
(configure.in): Normalize the call to AC_INIT w.r.t. other tests.
(Makefile.am): Explicitly mark target "print" as phony.
* tests/subobj10.test: Removed duplicated call to `set -e'.  Add
trailing `:' command.
(configure.in): Normalize the call to AC_INIT w.r.t. other tests.

12 files changed:
ChangeLog
tests/subobj.test
tests/subobj10.test
tests/subobj2.test
tests/subobj3.test
tests/subobj4.test
tests/subobj5.test
tests/subobj6.test
tests/subobj7.test
tests/subobj8.test
tests/subobj9.test
tests/subobjname.test

index 50407bb6de2cbd64879d3b942afe6aed1985606a..56f62b498c9eb7895b1290089fe872d7a5390835 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,41 @@
 2010-08-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       Modernize, improve and extend tests `subobj*.test'.
+       * tests/subobjname.test:  Add trailing `:' command.
+       * tests/subobj.test: Make grepping of `Makefile.in' stricter.
+       Escape literal dots in grep regexps.
+       * tests/subobj2.test:  Add trailing `:' command.  Do not use the
+       unportable fgrep option `-e'.
+       * tests/subobj3.test: Add trailing `:' command.
+       (configure.in): Use proper m4 quoting, and avoid obsolescent
+       constructs.
+       * tests/subobj8.test: Likewise.  Also, enable `errexit' shell
+       flag, with related changes
+       * tests/subobj4.test: Likewise.  Also, make grepping of
+       `Makefile.in' stricter.
+       * tests/subobj5.test: Add trailing `:' command.  Move setting of
+       `errexit' shell flag earlier in the script (just after inclusion
+       of ./defs).
+       (configure.in): Use the stub created by `./defs', rather than
+       writing it from scratch, and avoid obsolescent constructs.
+       * tests/subobj6.test: Add trailing `:' command.  Move setting of
+       `errexit' shell flag earlier in the script (just after inclusion
+       of ./defs).  Do not create useless dummy ac-init file `f'.
+       * tests/subobj7.test: Do not create useless dummy ac-init file
+       `f'.
+       (configure.in): Use the stub created by `./defs', rather than
+       writing it from scratch, and avoid obsolescent constructs.
+       * tests/subobj9.test: Move setting of `errexit' shell flag earlier
+       in the script (just after inclusion of ./defs).  Fail the test if
+       `make distcheck' fails.  Ensure verbose printing of captured make
+       stdout.  Avoid uselsss fork by doing simple grep instead of using
+       test -n "`COMMAND | grep ...`".
+       (configure.in): Normalize the call to AC_INIT w.r.t. other tests.
+       (Makefile.am): Explicitly mark target "print" as phony.
+       * tests/subobj10.test: Removed duplicated call to `set -e'.  Add
+       trailing `:' command.
+       (configure.in): Normalize the call to AC_INIT w.r.t. other tests.
+
        Remove a couple of obsoleted tests.
        * tests/fpinstall.test: Removed.
        * tests/fpinst2.test: Likewise.
index 64edd0ed4dc4443a8b2c56ca049a437d3e091073..39dc1b9ac6f0ff5c9f64b153f6d555078d995882 100755 (executable)
@@ -39,10 +39,10 @@ cat stderr >&2
 grep 'install.*compile' stderr
 test -f compile
 
-$FGREP 'generic/a.$(OBJEXT)' Makefile.in
+grep '^generic/a\.\$(OBJEXT):' Makefile.in
 grep '[^/]a\.\$(OBJEXT)' Makefile.in && Exit 1
 
 # Opportunistically test for a different bug.
-grep '^generic/b.\$(OBJEXT):.*dirstamp' Makefile.in
+grep '^generic/b\.\$(OBJEXT):.*dirstamp' Makefile.in
 
 :
index a589e457bfb4e595187d625a79d573127b4c2412..dbddf29c15f6dfc5fc6df799d18f50aed9f0f60b 100755 (executable)
@@ -21,8 +21,8 @@ required=gcc  # avoid compiler errors.
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT(x, 0, x)
+cat > configure.in << END
+AC_INIT([$me], [1.0])
 AM_INIT_AUTOMAKE([subdir-objects])
 
 AM_PROG_AS
@@ -45,8 +45,6 @@ mkdir src
 : >src/c.s
 : >d.s
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
@@ -54,3 +52,5 @@ $AUTOMAKE -a
 ./configure
 $MAKE
 $MAKE distcheck
+
+:
index 1282f80865678c46f216362b7180fc5e140544ca..87a467140efa57db27201d15153a2103e1c1aa73 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2010 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
@@ -35,4 +35,6 @@ $AUTOMAKE
 
 $FGREP 'generic/a.$(OBJEXT)' Makefile.in
 grep '[^/]a\.\$(OBJEXT)' Makefile.in && Exit 1
-$FGREP -e '-c -o' Makefile.in
+grep '.*-c -o' Makefile.in
+
+:
index a4ba765d5d288d03b378b9ad8c52a5664a298ce9..4fe685c3cac3215439fb81b2351905e104da8bce 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006  Free Software
-# Foundation, Inc.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006, 2010 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
@@ -22,16 +22,17 @@ required=gcc
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT(sub/hello.c)
+cat > configure.in << END
+AC_INIT([$me], [1.0])
 dnl Prevent automake from looking in .. and ../..
-AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE(hello,0.23)
+AC_CONFIG_AUX_DIR([.])
+AM_INIT_AUTOMAKE
 AC_PROG_CC
 AC_PROG_CC_STDC
 AM_PROG_CC_C_O
 AM_C_PROTOTYPES
-AC_OUTPUT(Makefile)
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -63,3 +64,5 @@ $AUTOMAKE -a
 ./configure
 ANSI2KNR=./ansi2knr U=_ $MAKE -e
 ./hello
+
+:
index f98ae5b19fcf25a82c07ad28e8fc51bb83521495..ead2305c3563d507c760546ac166819eeb93cb6e 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2004, 2010 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
 
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_CXX
-AC_OUTPUT(d1/Makefile d2/Makefile)
+AC_CONFIG_FILES([d1/Makefile d2/Makefile])
+AC_OUTPUT
 END
 
 mkdir d1 d2
@@ -43,7 +46,9 @@ END
 : > compile
 : > d2/z.c
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+grep '\$(CC) .*\.\./d2/z\.c' d1/Makefile.in
 
-grep 'CC.*z' d1/Makefile.in
+:
index 9c9568ae384620770c4431baa79213a0a7f3c671..c857e7393634b930677162d37313565eb5493cea 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2004, 2010 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT(generic/a.c)
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([generic/Makefile])
 AC_PROG_CC
 AM_PROG_CC_C_O
-AC_OUTPUT(Makefile generic/Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
@@ -36,10 +37,12 @@ mkdir generic
 : > generic/a.c
 : > generic/Makefile.am
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --include-deps --copy --add-missing
+
 ./configure
+
 $MAKE dist
+
+:
index 42b6e14b9df4c9fac9e033d592ce75f700b5b62d..228a1e9744523d122edf8867e8085568b9926c1f 100755 (executable)
@@ -1,5 +1,6 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2004, 2010 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
@@ -20,6 +21,8 @@
 required=gcc
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
 AM_PROG_CC_C_O
 AC_OUTPUT
@@ -38,9 +41,6 @@ test-distclean: distclean
        test ! -f generic/$(am__dirstamp)
 END
 
-# The ac-init file.
-: > f
-
 mkdir generic
 cat > generic/a.c << 'END'
 #include <stdio.h>
@@ -51,8 +51,6 @@ int main ()
 }
 END
 
-set -e
-
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --include-deps --copy --add-missing
@@ -86,3 +84,5 @@ cd build2
 ../configure
 $MAKE
 $MAKE mostlyclean
+
+:
index d77670c34e29f4fe6c962cf6f180110086f7202b..dd1a8febd5021c079223eed0054fe2c0dac6caed 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2004, 2010 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
 
 set -e
 
-cat > configure.in << 'END'
-AC_INIT(f)
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
-AC_OUTPUT(Makefile)
+AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
index 63a02d18dc79cca8eed32ed4fbdb4661b7dbc43b..ae9b09bf9da0deec78ea75eaff54b1dfe01ec651 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2010 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
 
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT(Makefile.am)
-AC_CONFIG_AUX_DIR(tools)
-AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+set -e
+
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AC_CONFIG_AUX_DIR([tools])
+AM_INIT_AUTOMAKE
 AC_PROG_CC
 AM_PROG_CC_C_O
-AC_OUTPUT(Makefile foo/Makefile)
+AC_CONFIG_FILES([Makefile foo/Makefile])
+AC_OUTPUT
 END
 
 mkdir tools foo foo/bar
@@ -33,12 +36,14 @@ cat > Makefile.am << 'END'
 SUBDIRS = foo
 END
 
-cat > foo/Makefile.am << 'EOF'
+cat > foo/Makefile.am << 'END'
 AUTOMAKE_OPTIONS = subdir-objects
 bin_PROGRAMS = mumble
 mumble_SOURCES = bar/a.c
-EOF
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+test -f tools/compile
 
-$ACLOCAL || Exit 1
-$AUTOMAKE --add-missing || Exit 1
-test -f tools/compile || Exit 1
+:
index 2b331e024565c1f528c231488e735b8920ebcb74..2045d58e9bcb44f800b1d3f93c9c033ac4025132 100755 (executable)
 required='libtoolize g++'
 . ./defs || Exit 1
 
-cat > configure.in << 'END'
-AC_INIT(x, 0, x)
-AM_INIT_AUTOMAKE([subdir-objects])
+set -e
 
+cat > configure.in << END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([subdir-objects])
 AC_PROG_CXX
 AM_PROG_LIBTOOL
-
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
 END
@@ -33,7 +33,7 @@ END
 cat > Makefile.am << 'END'
 noinst_LTLIBRARIES = libfoo.la
 libfoo_la_SOURCES = src/foo.cc .//src/bar.cc  # the `.//' is meant.
-
+.PHONY: print
 print:
        @echo BEG1: "$(LTCXXCOMPILE)" :1END
        @echo BEG2: "$(CXXLINK)" :2END
@@ -55,7 +55,6 @@ int doit2 (void)
 }
 END
 
-set -e
 
 libtoolize --force
 $ACLOCAL
@@ -65,17 +64,19 @@ $AUTOMAKE -a
 # Skip this test on configure errors (e.g., broken C++ compilers).
 ./configure || Exit 77
 
-# opportunistically check that --tag=CXX is used when supported
-if test -n "`./libtool --help | grep tag=TAG`"; then
-  $MAKE print >stdout
+# Opportunistically check that --tag=CXX is used when supported.
+if ./libtool --help | grep tag=TAG; then
+  $MAKE print >stdout || { cat stdout; Exit 1; }
   cat stdout
   grep 'BEG1: .*--tag=CXX.*--mode=compile.* :1END' stdout
   grep 'BEG2: .*--tag=CXX.*--mode=link.* :2END' stdout
 fi
 
 $MAKE
-$MAKE distcheck 2>&1 | tee out
+$MAKE distcheck >output 2>&1 || { cat output; Exit 1; }
+cat output
 # GNU Make used to complain that the Makefile contained two rules
 # for `src/.dirstamp' and `.//src/.dirstamp'.
-grep 'overriding commands' out && Exit 1
+grep 'overriding commands' output && Exit 1
+
 :
index 79584cf26572f674623c0354b90132de48af97ed..a8128bb0edaf421a2bef9d202a7dea2fe132b1b8 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2010 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
@@ -70,3 +70,5 @@ dobj=`sed -n '/^am_d_OBJECTS = / {
                p
               }' Makefile.in`
 test "$cobj" = "$dobj"
+
+: