automake-ng
[Top][All Lists]
Advanced

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

[Automake-NG] [FYI] tests on warnings: fix post-merge spurious failure


From: Stefano Lattarini
Subject: [Automake-NG] [FYI] tests on warnings: fix post-merge spurious failure
Date: Sat, 12 Jan 2013 16:34:32 +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 <address@hidden>
---

 After this, the testsuite passes once again.

 t/warning-groups-win-over-strictness.sh |  9 +++++----
 t/warnings-override.sh                  |  9 ++++-----
 t/warnings-precedence.sh                |  9 ++++-----
 t/warnings-strictness-interactions.sh   |  8 ++++----
 t/warnings-win-over-strictness.sh       |  8 ++++----
 t/warnopts.sh                           | 27 ++++++++++++---------------
 6 files changed, 33 insertions(+), 37 deletions(-)

diff --git a/t/warning-groups-win-over-strictness.sh 
b/t/warning-groups-win-over-strictness.sh
index 130a4ad..5dc9100 100755
--- a/t/warning-groups-win-over-strictness.sh
+++ b/t/warning-groups-win-over-strictness.sh
@@ -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
diff --git a/t/warnings-override.sh b/t/warnings-override.sh
index 5e5dbcd..98d7bf0 100755
--- a/t/warnings-override.sh
+++ b/t/warnings-override.sh
@@ -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
diff --git a/t/warnings-precedence.sh b/t/warnings-precedence.sh
index 3f1b18d..4f984e0 100755
--- a/t/warnings-precedence.sh
+++ b/t/warnings-precedence.sh
@@ -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
diff --git a/t/warnings-strictness-interactions.sh 
b/t/warnings-strictness-interactions.sh
index 0b5c55e..c3206cb 100755
--- a/t/warnings-strictness-interactions.sh
+++ b/t/warnings-strictness-interactions.sh
@@ -20,16 +20,16 @@
 
 . 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
 
 :
diff --git a/t/warnings-win-over-strictness.sh 
b/t/warnings-win-over-strictness.sh
index 60d63dd..7a97431 100755
--- a/t/warnings-win-over-strictness.sh
+++ b/t/warnings-win-over-strictness.sh
@@ -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
diff --git a/t/warnopts.sh b/t/warnopts.sh
index f1565e7..479c026 100755
--- a/t/warnopts.sh
+++ b/t/warnopts.sh
@@ -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
-- 
1.8.1.rc3.192.g2d0029e




reply via email to

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