]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Minor improvements and fixes in tests `depcomp*.test'.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 21 Jun 2010 15:47:28 +0000 (17:47 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 10 Aug 2010 17:39:22 +0000 (19:39 +0200)
* tests/depcomp.test: Do not create useless dummy source files.
Add a trailing `:' command.
* tests/depcomp2.test: Use `unset' on the CFLAG variable to ensure
it's not in in the environment, rather tthan exporting it with an
empty value.  Do not pass CC=gcc to configure, as that's already
done in ./defs since we have gcc in $required.  Ensure verbose
printing of captured stderr, and normalize its checking.  Add a
trailing `:' command.
* tests/depcomp3.test: Quote literal dots and dollar characters in
grep regexps.  Always use `: >' rather than `touch' to create empty
files.  Explicitly declare phony targets as such in the created
Makefile.am.  Add a trailing `:' command.
* tests/depcomp4.test: Quote literal dots and dollar characters in
grep regexp.  Explicitly declare phony targets as such in the
created Makefile.am.  Ensure verbose printing of captured makes'
stoud/stderr.  Add a trailing `:' command.
* tests/depcomp5.test: Move setting of `errexit' shell flag earlier
in the script (just after inclusion of ./defs).  Quote literal dots
and dollar characters in grep regexps.  Explicitly declare phony
targets as such in the created Makefile.am.  Add a trailing `:'
command.
* tests/depcomp6.test: Consistenty use m4 quoting in the generated
configure.in.  Cosmetic fixes to spacing.  Make the "dummy" `if'
statement required by OpenBSD's sh `set -e' more robust, and add
explanatory comments to it.
* tests/depcomp7.test: Likewise, and add  a trailing `:' command.

ChangeLog
tests/depcomp.test
tests/depcomp2.test
tests/depcomp3.test
tests/depcomp4.test
tests/depcomp5.test
tests/depcomp6.test
tests/depcomp7.test

index 6c59e4628fa5ae6670bffdccfc0657616291b947..f13d3e831eadeb456f5d173c749fce7fbe410f35 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,33 @@
 2010-08-08  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       Minor improvements and fixes in tests `depcomp*.test'.
+       * tests/depcomp.test: Do not create useless dummy source files.
+       Add a trailing `:' command.
+       * tests/depcomp2.test: Use `unset' on the CFLAG variable to ensure
+       it's not in in the environment, rather tthan exporting it with an
+       empty value.  Do not pass CC=gcc to configure, as that's already
+       done in ./defs since we have gcc in $required.  Ensure verbose
+       printing of captured stderr, and normalize its checking.  Add a
+       trailing `:' command.
+       * tests/depcomp3.test: Quote literal dots and dollar characters in
+       grep regexps.  Always use `: >' rather than `touch' to create empty
+       files.  Explicitly declare phony targets as such in the created
+       Makefile.am.  Add a trailing `:' command.
+       * tests/depcomp4.test: Quote literal dots and dollar characters in
+       grep regexp.  Explicitly declare phony targets as such in the
+       created Makefile.am.  Ensure verbose printing of captured makes'
+       stoud/stderr.  Add a trailing `:' command.
+       * tests/depcomp5.test: Move setting of `errexit' shell flag earlier
+       in the script (just after inclusion of ./defs).  Quote literal dots
+       and dollar characters in grep regexps.  Explicitly declare phony
+       targets as such in the created Makefile.am.  Add a trailing `:'
+       command.
+       * tests/depcomp6.test: Consistenty use m4 quoting in the generated
+       configure.in.  Cosmetic fixes to spacing.  Make the "dummy" `if'
+       statement required by OpenBSD's sh `set -e' more robust, and add
+       explanatory comments to it.
+       * tests/depcomp7.test: Likewise, and add  a trailing `:' command.
+
        Separate failing part of test `all.test'.
        * tests/all.test: Keep only (x)failing part of the test.  Working
        checks moved out to ...
index 8b9be2948bfb7a66484165a2a857b1cd0f304048..d5b6c78353c8e0af9c7d8ddce0722b389340bb5a 100755 (executable)
@@ -40,12 +40,11 @@ END
 
 cp subdir/Makefile.am subdir2/Makefile.am
 
-: > subdir/foo.c
-: > subdir2/foo.c
-
 $ACLOCAL
 $AUTOMAKE --add-missing
 
 # There used to be a bug where this was created in the first subdir with C
 # sources in it instead of in $top_srcdir or $ac_auxdir
 test -f depcomp
+
+:
index 2b4353c516471efedc51126b518597df7154c24d..e8e4a6728d4c84d5b4a066820b2199a0f8be7058 100755 (executable)
@@ -43,11 +43,12 @@ END
 : > subdir/foo.c
 
 # Ignore user CFLAGS.
-CFLAGS=
-export CFLAGS
+unset CFLAGS || :
 
 $ACLOCAL
 $AUTOMAKE --add-missing
 $AUTOCONF
-./configure CC='gcc' 2>error.log
-test -z "`cat error.log`"
+./configure 2>stderr || { cat stderr >&2; Exit 1; }
+test ! -s stderr
+
+:
index 2a5db604983599a55067d7536c6bebaf00dde581..513a01d54c131f2718fbc1d26a268665d806fec2 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
@@ -32,14 +32,15 @@ AUTOMAKE_OPTIONS = subdir-objects
 check_PROGRAMS = prg
 prg_SOURCES = src/sub.c src/foo.h
 
+.PHONY: grepdeps
 grepdeps:
-       grep 'src/sub.$(OBJEXT).*:' src/$(DEPDIR)/sub.Po
+       grep 'src/sub\.\$(OBJEXT).*:' src/$(DEPDIR)/sub.Po
 
 END
 
 mkdir src
 
-touch src/foo.h
+: > src/foo.h
 
 cat >src/sub.c <<EOF
 #include "foo.h"
@@ -60,3 +61,5 @@ grep am_cv_CC_dependencies_compiler_type configure
 ./configure am_cv_CC_dependencies_compiler_type=dashmstdout
 $MAKE check
 $MAKE grepdeps
+
+:
index 7d228940c6fcc89dc575667077c0395fe968c070..4f2df974c0f02987012251cfa5ea35dd3679ec4e 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003  Free Software Foundation, Inc.
+# Copyright (C) 2003, 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
@@ -31,8 +31,9 @@ cat > Makefile.am << 'END'
 noinst_LTLIBRARIES = liba.la
 liba_la_SOURCES = a.c foo.h
 
+.PHONY: grepdeps
 grepdeps:
-       grep 'a.lo *:' ./$(DEPDIR)/a.Plo
+       grep 'a\.lo *:' ./$(DEPDIR)/a.Plo
 END
 
 : > foo.h
@@ -51,7 +52,9 @@ $AUTOMAKE -a
 grep am_cv_CC_dependencies_compiler_type configure
 
 ./configure am_cv_CC_dependencies_compiler_type=makedepend
-$MAKE >output 2>&1
+$MAKE >output 2>&1 || { cat output; Exit 1; }
 cat output
 grep 'unknown directive' output && Exit 1
 $MAKE grepdeps
+
+:
index 9637288c4cb8a277bd2718251cee23cb3711ea16..9a4e1b1489989277a9ed39918e6dc17df185de25 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2003, 2004  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -19,6 +19,8 @@
 required='icc'
 . ./defs || Exit 1
 
+set -e
+
 # Automake supports icc since version 7.0 through a dedicated depcomp mode.
 # icc 8.0 and greater understand gcc options, so depmode is set to gcc.
 if icc -V -help 2>&1 | grep 'Version 7'; then
@@ -27,8 +29,6 @@ else
   expect='depmode=gcc'
 fi
 
-set -e
-
 cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
@@ -40,8 +40,9 @@ AUTOMAKE_OPTIONS = subdir-objects
 check_PROGRAMS = prg
 prg_SOURCES = src/sub.c src/foo.h
 
+.PHONY: grepdeps
 grepdeps:
-       grep 'src/sub.$(OBJEXT).*:' src/$(DEPDIR)/sub.Po
+       grep 'src/sub\.\$(OBJEXT).*:' src/$(DEPDIR)/sub.Po
 
 END
 
@@ -66,3 +67,5 @@ $AUTOMAKE -a
 grep "$expect" Makefile
 $MAKE check
 $MAKE grepdeps
+
+:
index 0b6a7f5400fac10bb3561a5a6ffc49e92397d685..7fc651f60b98e74af0acc007abc119104ae024ca 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006  Free Software Foundation, Inc.
+# Copyright (C) 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
@@ -24,7 +24,7 @@ cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_RANLIB
-AC_CONFIG_FILES(sub2/Makefile)
+AC_CONFIG_FILES([sub2/Makefile])
 AC_OUTPUT
 END
 
@@ -86,7 +86,7 @@ $AUTOCONF
 $AUTOMAKE -a
 
 ./configure --enable-dependency-tracking
-$MAKE 
+$MAKE
 
 # check that dependency tracking works
 if grep 'depmode=none' Makefile; then :
@@ -94,6 +94,11 @@ else
   cd sub2
   $sleep
   echo 'choke me' > sub3/ba3.h
-  if $MAKE; then Exit 1; fi
+  # Do not use `$MAKE && Exit 1' here, since even relatively-recent
+  # versions of the BSD shell wrongly exit when the `errexit' shell
+  # flag is active if a command within "&&" fails inside a compound
+  # statement.
+  if $MAKE; then Exit 1; else :; fi
 fi
+
 :
index 67702c78174dbb3acf9da866992d2ac6811e9c9a..695041af5420c5e3aabde323c29dfee52156b816 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2006, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2006, 2007, 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
@@ -25,7 +25,7 @@ cat >> configure.in << 'END'
 AC_PROG_CC
 AM_PROG_CC_C_O
 AM_PROG_LIBTOOL
-AC_CONFIG_FILES(sub2/Makefile)
+AC_CONFIG_FILES([sub2/Makefile])
 AC_OUTPUT
 END
 
@@ -88,8 +88,9 @@ $AUTOCONF
 $AUTOMAKE -a
 
 for staticshared in --disable-shared "" --disable-static; do
+
   ./configure --enable-dependency-tracking $staticshared
-  $MAKE 
+  $MAKE
 
   # check that dependency tracking works
   if grep 'depmode=none' Makefile; then :
@@ -97,7 +98,11 @@ for staticshared in --disable-shared "" --disable-static; do
     cd sub2
     $sleep
     echo 'choke me' > sub3/ba3.h
-    if $MAKE; then Exit 1; fi
+    # Do not use `$MAKE && Exit 1' here, since even relatively-recent
+    # versions of the BSD shell wrongly exit when the `errexit' shell
+    # flag is active if a command within "&&" fails inside a compound
+    # statement.
+    if $MAKE; then Exit 1; else :; fi
     cd ..
   fi
 
@@ -106,4 +111,7 @@ for staticshared in --disable-shared "" --disable-static; do
   test ! -f sub2/sub3/ba3.d
 
   echo 'extern int x;' > sub2/sub3/ba3.h
+
 done
+
+: