automake-patches
[Top][All Lists]
Advanced

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

[PATCH] Tweak, extend and improve tests `cond[a-z]*.test'.


From: Stefano Lattarini
Subject: [PATCH] Tweak, extend and improve tests `cond[a-z]*.test'.
Date: Wed, 14 Jul 2010 15:26:04 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

* tests/condd.test: Add trailing `:' command.  Typofix in
comment.  Prefer fgrep over grep.
* tests/condhook.test: Make sure target `install-data-hook' is
not called by `make install', but that data files are installed.
Use proper m4 quoting in configure.in. Add trailing `:' command.
* tests/condhook2.test: New test, sister test of condhook, with
inverted semantic.
* tests/condinc2.test: Use proper m4 quoting in configure.in.
Prefer trailing `:' command over trailing `Exit 0'.
* tests/condman2.test: Enable errexit shell flag, and related
changes.  Add trailing `:' command.
* tests/condman.test: Likewise.  Also, do not create useless
dummy manpages, and use proper m4 quoting in configure.in.
* tests/condman3.test: New test, similar to condman.test, but
it also runs ./configure and "make install", and check the
installed files.
* tests/Makefile.am (TESTS): Updated.
---
 ChangeLog            |   21 ++++++++++++++++
 tests/Makefile.am    |    2 +
 tests/Makefile.in    |    2 +
 tests/condd.test     |    8 ++++--
 tests/condhook.test  |   16 +++++++++---
 tests/condhook2.test |   50 ++++++++++++++++++++++++++++++++++++++
 tests/condinc2.test  |    7 +++--
 tests/condman.test   |   14 ++++++----
 tests/condman2.test  |   17 ++++++++----
 tests/condman3.test  |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++
 10 files changed, 180 insertions(+), 22 deletions(-)
 create mode 100755 tests/condhook2.test
 create mode 100755 tests/condman3.test

From d36d1c4017a9011da3095618c7a40222a7d5ba16 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Wed, 14 Jul 2010 15:22:12 +0200
Subject: [PATCH] Tweak, extend and improve tests `cond[a-z]*.test'.

* tests/condd.test: Add trailing `:' command.  Typofix in
comment.  Prefer fgrep over grep.
* tests/condhook.test: Make sure target `install-data-hook' is
not called by `make install', but that data files are installed.
Use proper m4 quoting in configure.in. Add trailing `:' command.
* tests/condhook2.test: New test, sister test of condhook, with
inverted semantic.
* tests/condinc2.test: Use proper m4 quoting in configure.in.
Prefer trailing `:' command over trailing `Exit 0'.
* tests/condman2.test: Enable errexit shell flag, and related
changes.  Add trailing `:' command.
* tests/condman.test: Likewise.  Also, do not create useless
dummy manpages, and use proper m4 quoting in configure.in.
* tests/condman3.test: New test, similar to condman.test, but
it also runs ./configure and "make install", and check the
installed files.
* tests/Makefile.am (TESTS): Updated.
---
 ChangeLog            |   21 ++++++++++++++++
 tests/Makefile.am    |    2 +
 tests/Makefile.in    |    2 +
 tests/condd.test     |    8 ++++--
 tests/condhook.test  |   16 +++++++++---
 tests/condhook2.test |   50 ++++++++++++++++++++++++++++++++++++++
 tests/condinc2.test  |    7 +++--
 tests/condman.test   |   14 ++++++----
 tests/condman2.test  |   17 ++++++++----
 tests/condman3.test  |   65 ++++++++++++++++++++++++++++++++++++++++++++++++++
 10 files changed, 180 insertions(+), 22 deletions(-)
 create mode 100755 tests/condhook2.test
 create mode 100755 tests/condman3.test

diff --git a/ChangeLog b/ChangeLog
index 4366381..8d20192 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2010-07-14  Stefano Lattarini  <address@hidden>
+
+       Tweak, extend and improve tests `cond[a-z]*.test'.
+       * tests/condd.test: Add trailing `:' command.  Typofix in
+       comment.  Prefer fgrep over grep.
+       * tests/condhook.test: Make sure target `install-data-hook' is
+       not called by `make install', but that data files are installed.
+       Use proper m4 quoting in configure.in. Add trailing `:' command.
+       * tests/condhook2.test: New test, sister test of condhook, with
+       inverted semantic.
+       * tests/condinc2.test: Use proper m4 quoting in configure.in.
+       Prefer trailing `:' command over trailing `Exit 0'.
+       * tests/condman2.test: Enable errexit shell flag, and related
+       changes.  Add trailing `:' command.
+       * tests/condman.test: Likewise.  Also, do not create useless
+       dummy manpages, and use proper m4 quoting in configure.in.
+       * tests/condman3.test: New test, similar to condman.test, but
+       it also runs ./configure and "make install", and check the
+       installed files.
+       * tests/Makefile.am (TESTS): Updated.
+
 2010-06-26  Ralf Wildenhues  <address@hidden>
 
        Update program --help output to match current GCS.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index af20d3e..dd2465e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -226,11 +226,13 @@ cond45.test \
 cond46.test \
 condd.test \
 condhook.test \
+condhook2.test \
 condinc.test \
 condinc2.test \
 condlib.test \
 condman.test \
 condman2.test \
+condman3.test \
 configure.test \
 conf2.test \
 confdeps.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 592faa0..ef88b48 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -437,11 +437,13 @@ cond45.test \
 cond46.test \
 condd.test \
 condhook.test \
+condhook2.test \
 condinc.test \
 condinc2.test \
 condlib.test \
 condman.test \
 condman2.test \
+condman3.test \
 configure.test \
 conf2.test \
 confdeps.test \
diff --git a/tests/condd.test b/tests/condd.test
index 0e9b6e8..754d09c 100755
--- a/tests/condd.test
+++ b/tests/condd.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2001, 2002, 2004  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2004, 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
@@ -23,7 +23,7 @@ set -e
 cat >> configure.in << 'END'
 AC_PROG_CC
 dnl Define a macro with the same name as the conditional to exhibit
-dnl any underquotted bug.
+dnl any underquoted bug.
 AC_DEFUN([COND1], ["some'meaningless;characters`])
 AM_CONDITIONAL([COND1], false)
 AC_CONFIG_FILES([foo/Makefile])
@@ -64,7 +64,9 @@ mkdir foo bar
 
 $ACLOCAL
 $AUTOCONF
-grep "meaningless;characters" configure && Exit 1
+$FGREP "meaningless;characters" configure && Exit 1
 $AUTOMAKE
 ./configure
 $MAKE test
+
+:
diff --git a/tests/condhook.test b/tests/condhook.test
index 06fa887..6f2e825 100755
--- a/tests/condhook.test
+++ b/tests/condhook.test
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2004, 2007  Free Software Foundation, Inc.
+# Copyright (C) 2004, 2007, 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
@@ -15,6 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Test install when a conditional install-*-hook is not defined.
+# Keep this in sync with sister test condhook2.test.
 # Report by Nik A. Melchior (PR/428).
 
 . ./defs || Exit 1
@@ -22,15 +23,16 @@
 set -e
 
 cat >> configure.in << 'END'
-AM_CONDITIONAL(TEST, false)
+AM_CONDITIONAL([TEST], [false])
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-sysconf_DATA = mumble
+datadir = $(prefix)/data
+data_DATA = mumble
 if TEST
 install-data-hook:
-       echo foo
+       : > $(top_srcdir)/bad
 endif
 END
 
@@ -39,5 +41,11 @@ END
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
+
 ./configure --prefix "`pwd`/inst"
+
 $MAKE install
+test -f inst/data/mumble
+test ! -f bad
+
+:
diff --git a/tests/condhook2.test b/tests/condhook2.test
new file mode 100755
index 0000000..3486684
--- /dev/null
+++ b/tests/condhook2.test
@@ -0,0 +1,50 @@
+#!/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/>.
+
+# Test install when a conditional install-*-hook is defined.
+# Keep this in sync with sister test condhook.test.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([TEST], [true])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+datadir = $(prefix)/data
+data_DATA = mumble
+if TEST
+install-data-hook:
+       : > $(top_srcdir)/good
+endif
+END
+
+: > mumble
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure --prefix "`pwd`/inst"
+
+$MAKE install
+test -f inst/data/mumble
+test -f good
+
+:
diff --git a/tests/condinc2.test b/tests/condinc2.test
index 451c56f..9fbd253 100755
--- a/tests/condinc2.test
+++ b/tests/condinc2.test
@@ -22,9 +22,11 @@
 set -e
 
 cat >> configure.in << 'END'
-AM_CONDITIONAL(TOBE, false)
+AM_CONDITIONAL([TOBE], [false])
 END
 
+$ACLOCAL
+
 cat > Makefile.am << 'END'
 if TOBE
 include adjunct
@@ -37,7 +39,6 @@ target: dependency
 endif
 END
 
-$ACLOCAL
 AUTOMAKE_fails
 grep 'adjunct:3: error: too many conditionals closed' stderr
 
@@ -59,4 +60,4 @@ END
 
 $AUTOMAKE
 
-Exit 0
+:
diff --git a/tests/condman.test b/tests/condman.test
index 3dc8bcd..ee2d41b 100755
--- a/tests/condman.test
+++ b/tests/condman.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 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
@@ -15,10 +15,13 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Make sure conditionals work with man pages.
+
 . ./defs || Exit 1
 
+set -e
+
 cat >> configure.in << 'END'
-AM_CONDITIONAL(FRED, true)
+AM_CONDITIONAL([FRED], [true])
 END
 
 cat > Makefile.am << 'END'
@@ -29,8 +32,7 @@ man_MANS = joe.1
 endif
 END
 
-: > foo.1
-: > joe.1
-
-$ACLOCAL || Exit 1
+$ACLOCAL
 $AUTOMAKE
+
+:
diff --git a/tests/condman2.test b/tests/condman2.test
index 0b448e2..c0e7216 100755
--- a/tests/condman2.test
+++ b/tests/condman2.test
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1998, 2001, 2002  Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001, 2002, 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
@@ -15,16 +15,21 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # Make sure appropriate man install targets generated in all cases.
+
 . ./defs || Exit 1
 
+set -e
+
 cat > Makefile.am << 'END'
 man_MANS = foo.1 foo.2
 man5_MANS = foo.5
 END
 
-$ACLOCAL || Exit 1
-$AUTOMAKE || Exit 1
+$ACLOCAL
+$AUTOMAKE
+
+grep '^install-man1:' Makefile.in
+grep '^install-man2:' Makefile.in
+grep '^install-man5:' Makefile.in
 
-grep '^install-man1:' Makefile.in || Exit 1
-grep '^install-man2:' Makefile.in || Exit 1
-grep '^install-man5:' Makefile.in || Exit 1
+:
diff --git a/tests/condman3.test b/tests/condman3.test
new file mode 100755
index 0000000..ff93daf
--- /dev/null
+++ b/tests/condman3.test
@@ -0,0 +1,65 @@
+#! /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/>.
+
+# Make sure conditionals work with man pages.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([COND], [test x"$FOO" = x"true"])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+if COND
+man_MANS = foo.1
+else
+man_MANS = bar.2
+endif
+
+.PHONY: test1 test2
+test1:
+       test -f $(mandir)/man1/foo.1
+       test ! -f $(mandir)/man2/bar.2
+test2:
+       test ! -f $(mandir)/man1/foo.1
+       test -f $(mandir)/man2/bar.2
+END
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+
+mkdir dir1
+cd dir1
+../configure FOO=true --prefix="`pwd`/_inst"
+sed -n '/man_MANS/p' Makefile # useful for debugging
+: > foo.1
+$MAKE install
+$MAKE test1
+
+cd ..
+mkdir dir2
+cd dir2
+../configure FOO=false --prefix="`pwd`/_inst"
+sed -n '/man_MANS/p' Makefile # useful for debugging
+: > bar.2
+$MAKE install
+$MAKE test2
+
+:
-- 
1.7.1


reply via email to

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