automake-patches
[Top][All Lists]
Advanced

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

A few more perl code coverage patches


From: Ralf Wildenhues
Subject: A few more perl code coverage patches
Date: Sun, 6 Jun 2010 19:54:19 +0200
User-agent: Mutt/1.5.20 (2009-10-28)

I'm merging a handful of trivial patches increasing coverage of the
Automake perl code, to master.

Cheers,
Ralf

    Coverage for aclocal diagnosing underquoted macros.
    
    * tests/acloca23.test: New test.
    * tests/Makefile.am: Update.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index f709593..0db7851 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -66,6 +66,7 @@ acloca19.test \
 acloca20.test \
 acloca21.test \
 acloca22.test \
+acloca23.test \
 acoutnoq.test \
 acoutpt.test \
 acoutpt2.test \
diff --git a/tests/acloca23.test b/tests/acloca23.test
new file mode 100755
index 0000000..1741e70
--- /dev/null
+++ b/tests/acloca23.test
@@ -0,0 +1,37 @@
+#! /bin/sh
+# Copyright (C) 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
+# 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/>.
+
+# Ensure we diagnose underquoted AC_DEFUN's.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+FOO
+END
+
+mkdir m4
+cat >m4/foo.m4 <<EOF
+AC_DEFUN(FOO, [echo foo])
+EOF
+
+$ACLOCAL -I m4 2>stderr && { cat stderr >&2; Exit 1; }
+cat stderr >&2
+grep 'underquoted definition.*FOO' stderr
+grep 'warning.*warning' stderr && Exit 1
+
+:


    Testsuite coverage for bogus macro file serial numbers.
    
    * tests/acloca18.test: Also test ill-formed serial numbers
    and serial numbers after macro definitions.

diff --git a/tests/acloca18.test b/tests/acloca18.test
index 276e5ba..6f2de7e 100755
--- a/tests/acloca18.test
+++ b/tests/acloca18.test
@@ -25,7 +25,7 @@ AM_MACRO1
 AM_MACRO2
 END
 
-mkdir 1 2 3 4
+mkdir 1 2 3 4 5 6
 
 cat >1/m1.m4 <<EOF
 #serial 1.8.1230.9
@@ -53,6 +53,17 @@ cat >4/mumble.m4 <<EOF
 AC_DEFUN([AM_MACRO1], [echo macro14 >> foo])
 EOF
 
+cat >5/ill-formed.m4 <<EOF
+#serial bla
+#serial .2
+#serial
+AC_DEFUN([AM_MACRO1], [echo macro15 >> foo])
+EOF
+
+cat >6/after-def.m4 <<EOF
+AC_DEFUN([AM_MACRO1], [echo macro16 >> foo])
+#serial 1
+EOF
 
 ACLOCAL_TESTSUITE_FLAGS='-I 1 -I 2 -I 3 -I 4'
 
@@ -112,3 +123,9 @@ cat output
 grep '#serial 456' output
 test ! -f 4/m1.m4
 grep 'installing.*4/m1.m4' stderr
+
+$ACLOCAL -I 5 2>stderr && { cat stderr >&2; Exit 1; }
+test `grep -c 'ill-formed serial' stderr` -eq 3
+
+$ACLOCAL -I 6 2>stderr && { cat stderr >&2; Exit 1; }
+grep 'serial.*before any macro definition' stderr



    Coverage for use of anachronistic variables.
    
    * tests/oldvars.test: New test.
    * tests/Makefile.am: Update.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0db7851..2a46750 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -518,6 +518,7 @@ number.test \
 objc.test \
 objc2.test \
 obsolete.test \
+oldvars.test \
 order.test \
 outdir.test \
 output.test \
diff --git a/tests/oldvars.test b/tests/oldvars.test
new file mode 100755
index 0000000..7a2bb71
--- /dev/null
+++ b/tests/oldvars.test
@@ -0,0 +1,37 @@
+#! /bin/sh
+# Copyright (C) 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
+# 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/>.
+
+# Use of these variables is deprecated:
+# LISP, HEADERS, DATA, SCRIPTS, LTLIBRARIES, LIBRARIES, PROGRAMS, MANS.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >Makefile.am <<\EOF
+DATA =
+HEADERS =
+LIBRARIES =
+LISP =
+LTLIBRARIES =
+MANS =
+PROGRAMS =
+SCRIPTS =
+EOF
+
+$ACLOCAL
+AUTOMAKE_fails
+test `grep -c anachronism stderr` -eq 8



    Coverage for TAGS_DEPENDENCIES warning.
    
    * tests/tags2.test: New test.
    * tests/Makefile.am: Update.

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2a46750..361294b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -711,6 +711,7 @@ symlink2.test \
 symlink3.test \
 syntax.test \
 tags.test \
+tags2.test \
 tagsub.test \
 tar.test \
 tar2.test \
diff --git a/tests/tags2.test b/tests/tags2.test
new file mode 100755
index 0000000..f6e018c
--- /dev/null
+++ b/tests/tags2.test
@@ -0,0 +1,44 @@
+#! /bin/sh
+# Copyright (C) 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
+# 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/>.
+
+# TAGS_DEPENDENCIES only make sense if other tag-worthy things (such as
+# sources) exist.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AC_OUTPUT
+END
+
+cat >Makefile.am << 'END'
+TAGS_DEPENDENCIES = foo
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'define.*TAGS_DEPENDENCIES.*without' stderr
+
+cat >>Makefile.am << 'END'
+bin_PROGRAMS = bar
+END
+
+AUTOMAKE_run 0
+grep 'define.*TAGS_DEPENDENCIES.*without' stderr && Exit 1
+
+:



reply via email to

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