]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests on warnings: fix post-merge spurious failure
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 12 Jan 2013 15:09:52 +0000 (16:09 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 12 Jan 2013 15:24:44 +0000 (16:24 +0100)
* t/warnopts.sh.sh: Adjust to reflect the fact that subdir sources no
longer require AM_PROG_CC_C_O in 'configure.ac'.  Instead, use the
fact that the 'aux' directory name is diagnosed as being reserved on
Windows.
* t/warnings-override.sh: Likewise.
* t/warnings-precedence.sh: Likewise.
* t/warnings-strictness-interactions.sh: Likewise.
* t/warnings-win-over-strictness.sh: Likewise.
* t/warning-groups-win-over-strictness.sh: Adjust to reflect the fact
that subdir sources no longer require AM_PROG_CC_C_O in 'configure.ac'.
Instead, use the fact that AUTOMAKE_OPTIONS cannot hold conditional
content.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
t/warning-groups-win-over-strictness.sh
t/warnings-override.sh
t/warnings-precedence.sh
t/warnings-strictness-interactions.sh
t/warnings-win-over-strictness.sh
t/warnopts.sh

index 130a4adce7cc2e544b60c803c41b750e200cb2ed..5dc9100e22e776b847886d685d55d18544d59ad3 100755 (executable)
@@ -30,8 +30,8 @@ touch README INSTALL NEWS AUTHORS ChangeLog COPYING THANKS
 cat > configure.ac << END
 AC_INIT([$me], [1.0])
 m4_include([am-init-automake.m4])
-AC_PROG_CC
 AC_CONFIG_FILES([Makefile])
+AM_CONDITIONAL([NEVERTRUE], [false)]
 # Other similar tests do not use AC_OUTPUT, so we use it here,
 # for completeness and for better coverage.
 AC_OUTPUT
@@ -39,8 +39,9 @@ END
 
 cat > Makefile.am <<END
 include automake-options.am
-noinst_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
+if NEVERTRUE
+AUTOMAKE_OPTIONS = no-dependencies
+endif
 END
 
 rm -rf autom4te*.cache
@@ -48,7 +49,7 @@ rm -rf autom4te*.cache
 echo 'AM_INIT_AUTOMAKE' > am-init-automake.m4
 $ACLOCAL
 AUTOMAKE_fails -Werror -Wall --foreign
-grep '^Makefile\.am:3:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr
+grep "^Makefile\\.am:3:.*AUTOMAKE_OPTIONS.*conditional" stderr
 
 rm -rf autom4te*.cache
 : > automake-options.am
index 5e5dbcd5865448ce8d5249ea50acee9526c98a75..98d7bf0742a22055e61f0cfca2e3941ba7fcc17d 100755 (executable)
@@ -23,6 +23,8 @@
 
 . test-init.sh
 
+mkdir aux || skip_ "cannot create directories named 'aux'"
+
 # We want (almost) complete control over automake options.
 AUTOMAKE="$am_original_AUTOMAKE -Werror"
 
@@ -44,15 +46,12 @@ ok ()
 ko ()
 {
   AUTOMAKE_fails $*
-  grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr
+  grep "^Makefile\\.am:.*'aux' is reserved on W32" stderr
 }
 
-echo AC_PROG_CC >> configure.ac
-
 cat > Makefile.am <<END
 AUTOMAKE_OPTIONS = ## For later editing by 'set_am_opts'.
-noinst_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
+SUBDIRS = aux
 END
 
 $ACLOCAL
index 3f1b18dcc6dcc5b60b62bde47d3351a0e71c1359..4f984e0c8da501021059fb527b72342b7dc0f895 100755 (executable)
@@ -20,6 +20,8 @@
 
 . test-init.sh
 
+mkdir aux || skip_ "cannot create directories named 'aux'"
+
 # We want (almost) complete control over automake options.
 AUTOMAKE="$am_original_AUTOMAKE -Werror"
 
@@ -41,18 +43,15 @@ ok ()
 ko ()
 {
   AUTOMAKE_fails $*
-  grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr
+  grep "^Makefile\\.am:.*'aux' is reserved on W32" stderr
 }
 
 # Files required in gnu strictness.
 touch README INSTALL NEWS AUTHORS ChangeLog COPYING
 
-echo AC_PROG_CC >> configure.ac
-
 cat > Makefile.am <<END
 AUTOMAKE_OPTIONS = ## For later editing by 'set_warnings'.
-noinst_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
+SUBDIRS = aux
 END
 
 $ACLOCAL
index 0b5c55e4deabbe171895994051cdf77f8d2eacf0..c3206cb2de070e8b2012fa37ac3cf5e6782397b7 100755 (executable)
 
 . test-init.sh
 
+mkdir aux || skip_ "cannot create directories named 'aux'"
+
 # We want (almost) complete control over automake options.
 AUTOMAKE="$am_original_AUTOMAKE -Werror"
 
-echo AC_PROG_CC >> configure.ac
 $ACLOCAL
 
 cat > Makefile.am <<END
 AUTOMAKE_OPTIONS = ## For later editing by 'set_am_opts'.
-noinst_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
+SUBDIRS = aux
 END
 
 set_am_opts ()
@@ -56,6 +56,6 @@ set_am_opts '-Wno-portability' configure.ac
 set_am_opts 'gnu' Makefile.am
 
 AUTOMAKE_fails
-grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr
+grep "^Makefile\\.am:.*'aux' is reserved on W32" stderr
 
 :
index 60d63dd688dc1cc66ba435cb1dd533d48463aee3..7a97431b6f9cee76d01426180f74df59a71d61e8 100755 (executable)
@@ -19,6 +19,8 @@
 
 . test-init.sh
 
+mkdir aux || skip_ "cannot create directories named 'aux'"
+
 # We want complete control over automake options.
 AUTOMAKE=$am_original_AUTOMAKE
 
@@ -31,7 +33,7 @@ ok ()
 ko ()
 {
   AUTOMAKE_run $*
-  grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr
+  grep "^Makefile\\.am:.*'aux' is reserved on W32" stderr
   test $(wc -l <stderr) -eq 1
 }
 
@@ -48,13 +50,11 @@ set_am_opts ()
 # Files required in gnu strictness.
 touch README INSTALL NEWS AUTHORS ChangeLog COPYING
 
-echo AC_PROG_CC >> configure.ac
 $ACLOCAL
 
 cat > Makefile.am <<END
 AUTOMAKE_OPTIONS = ## For later editing by 'set_am_opts'.
-noinst_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
+SUBDIRS = aux
 END
 
 ko --foreign -Wportability
index f1565e73ef8b05dbdcfdb18ddc9b90e5ba814ab6..479c02670bc68807f93e70fa12b983e59d4e6867 100755 (executable)
@@ -25,41 +25,38 @@ AM_CONDITIONAL([COND_FALSE], [false])
 AC_OUTPUT
 END
 
-mkdir sub
+mkdir aux sub sub/aux || skip_ "cannot create directories named 'aux'"
 
 # These two Makefile contain the same errors, but have different
 # warnings disabled.
 
 cat > Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects -Wno-unsupported
+AUTOMAKE_OPTIONS = -Wno-unsupported
 if COND_FALSE
 AUTOMAKE_OPTIONS += no-dependencies
 endif
-bin_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
-SUBDIRS = sub
+SUBDIRS = sub aux
 END
 
 cat > sub/Makefile.am << 'END'
-AUTOMAKE_OPTIONS = subdir-objects -Wno-portability
+AUTOMAKE_OPTIONS = -Wno-portability
 if COND_FALSE
 AUTOMAKE_OPTIONS += no-dependencies
 endif
-bin_PROGRAMS = foo
-foo_SOURCES = sub/foo.c
+SUBDIRS = aux
 END
 
 $ACLOCAL
 AUTOMAKE_fails
-# The expected diagnostic is
+# The expected diagnostic is:
 #   automake: warnings are treated as errors
-#   Makefile.am:6: warning: compiling 'sub/foo.c' in subdir requires 'AM_PROG_CC_C_O' in 'configure.ac'
+#   Makefile.am:5: warning: name 'aux' is reserved on W32 and DOS platforms
 #   sub/Makefile.am:1: warning: 'AUTOMAKE_OPTIONS' cannot have conditional contents
-grep '^Makefile\.am:.*sub/foo\.c.*AM_PROG_CC_C_O' stderr
-grep '^sub/Makefile.am:.*AUTOMAKE_OPTIONS' stderr
-grep '^sub/Makefile\.am:.*AM_PROG_CC_C_O' stderr && exit 1
-grep '^Makefile\.am:.*AUTOMAKE_OPTIONS' stderr && exit 1
-# Only two lines of warnings.
+grep "^Makefile\\.am:.*'aux' is reserved on W32" stderr
+grep "^sub/Makefile\\.am:.*AUTOMAKE_OPTIONS.*conditional" stderr
+grep "^Makefile\\.am:.*AUTOMAKE_OPTIONS" stderr && exit 1
+grep "^sub/Makefile\\.am:.*'aux'" stderr && exit 1
+# Only two lines of warnings proper.
 test $(grep -v 'warnings are treated as errors' stderr | wc -l) -eq 2
 
 rm -rf autom4te*.cache