From: Stefano Lattarini Date: Sat, 12 Jan 2013 15:09:52 +0000 (+0100) Subject: tests on warnings: fix post-merge spurious failure X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99bde3e9777eaf82e175efaf46d53b6f6a256740;p=thirdparty%2Fautomake.git tests on warnings: fix post-merge spurious failure * 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 --- diff --git a/t/warning-groups-win-over-strictness.sh b/t/warning-groups-win-over-strictness.sh index 130a4adce..5dc9100e2 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 < 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 5e5dbcd58..98d7bf074 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 <> configure.ac - cat > Makefile.am <> configure.ac $ACLOCAL cat > Makefile.am <> configure.ac $ACLOCAL cat > Makefile.am < 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