]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
More tests on warnings and strictness.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 13 Jan 2011 22:57:16 +0000 (23:57 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 15 Jan 2011 14:24:22 +0000 (15:24 +0100)
* tests/warnings-strictness-interactions.test: New test.
* tests/warnings-unknown.test: Likewise.
* tests/Makefile.am (TESTS): Update.

ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/warnings-strictness-interactions.test [new file with mode: 0755]
tests/warnings-unknown.test [new file with mode: 0755]

index d30523d611a14c2f128c76306ecd8c1490b26a24..9130140af311d1886cb2ad95eecc8976a794f51f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-01-15  Stefano Lattarini  <stefano.lattarini@gmail.com>
 
+       More tests on warnings and strictness.
+       * tests/warnings-strictness-interactions.test: New test.
+       * tests/warnings-unknown.test: Likewise.
+       * tests/Makefile.am (TESTS): Update.
+
        New test on silent-rules mode and portability warnings.
        * tests/silent-nowarn.test: New test.
        * tests/Makefile.am (TESTS): Update.
index 53dbe9cc651d498f50138ad66d9029a2a08ac085..972f8a9bcb4d62195af50de3ac753fd54d75bd70 100644 (file)
@@ -947,6 +947,8 @@ vtexi3.test \
 vtexi4.test \
 warnings-override.test \
 warnings-precedence.test \
+warnings-strictness-interactions.test \
+warnings-unknown.test \
 warnopts.test \
 werror.test \
 werror2.test \
index f2d695fc2b03f3076703f6ef0345d9c876050688..282afe0703d40941b861b250acd7d15129164239 100644 (file)
@@ -1210,6 +1210,8 @@ vtexi3.test \
 vtexi4.test \
 warnings-override.test \
 warnings-precedence.test \
+warnings-strictness-interactions.test \
+warnings-unknown.test \
 warnopts.test \
 werror.test \
 werror2.test \
diff --git a/tests/warnings-strictness-interactions.test b/tests/warnings-strictness-interactions.test
new file mode 100755 (executable)
index 0000000..e2c7675
--- /dev/null
@@ -0,0 +1,59 @@
+#! /bin/sh
+# Copyright (C) 2011 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that the default warnings triggered by a strictness specified
+# in AUTOMAKE_OPTIONS take precedence over explicit warnings given in
+# AM_INIT_AUTOMAKE.
+
+. ./defs || Exit 1
+
+# We want (almost) complete control over automake options.
+AUTOMAKE="$original_AUTOMAKE -Werror"
+
+cat > Makefile.am <<END
+AUTOMAKE_OPTIONS =
+FOO := bar
+END
+
+set_am_opts ()
+{
+  set +x
+  sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \
+                -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|"
+  mv -f $2-t $2
+  set -x
+  cat $2
+}
+
+set_am_opts '-Wportability' configure.in
+set_am_opts 'foreign' Makefile.am
+
+$ACLOCAL
+$AUTOMAKE
+
+rm -rf autom4te*.cache
+
+# Files required in gnu strictness.
+touch README INSTALL NEWS AUTHORS ChangeLog COPYING
+
+set_am_opts '-Wno-portability' configure.in
+set_am_opts 'gnu' Makefile.am
+
+AUTOMAKE_fails
+$ACLOCAL
+grep '^Makefile\.am:2:.*:=.*not portable' stderr
+
+:
diff --git a/tests/warnings-unknown.test b/tests/warnings-unknown.test
new file mode 100755 (executable)
index 0000000..77ed589
--- /dev/null
@@ -0,0 +1,44 @@
+#! /bin/sh
+# Copyright (C) 2011 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check that automake complains about unknown warnings.
+
+. ./defs || Exit 1
+
+# We want (almost) complete control over automake options.
+AUTOMAKE="$original_AUTOMAKE --foreign -Werror"
+
+cat > configure.in <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([-Wno-zardoz])
+AC_CONFIG_FILES([Makefile])
+END
+
+cat > Makefile.am <<END
+AUTOMAKE_OPTIONS = -Wfoobar
+END
+
+$ACLOCAL
+
+AUTOMAKE_fails -Wbazquux
+grep '^configure\.in:2:.* unknown warning category.*zardoz' stderr
+grep '^Makefile\.am:1:.* unknown warning category.*foobar' stderr
+grep '^automake:.* unknown warning category.*bazquux' stderr
+
+# Check that we can override warnings about unknown warning categories.
+$AUTOMAKE -Wno-unsupported -Wbazquux
+
+: