m4-patches
[Top][All Lists]
Advanced

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

Re: 'make installcheck' vs. './configure --program-prefix'


From: Eric Blake
Subject: Re: 'make installcheck' vs. './configure --program-prefix'
Date: Tue, 15 Apr 2008 22:27:01 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 4/15/2008 5:03 PM:
|
| I'm still working on making the
| master branch support this, but it is taking more work (in part because
it is
| harder to trace through libtool wrappers to test with a cooked executable
| name).

As follows.  Unfortunately, AT_TESTED doesn't quite work with shell
variables, so I ended up using undocumented Autotest internals; I'll
probably have to do something about that in the autoconf lists.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgFgBQACgkQ84KuGfSFAYCdlACgoYS/bzDnzaoQbKhGtGZMp7TI
Oe0AoIzWU+1wZYvGPXKi0xB9D2Ll+dwe
=WUyR
-----END PGP SIGNATURE-----
From ce0c0b372d8f63ba391fe099a7f145d3c7b2ed2b Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Tue, 15 Apr 2008 11:20:30 -0600
Subject: [PATCH] Work around OS/2 limitation of printf(1).

* tests/null.m4: Use m4, not printf, to generate NUL byte.
* tests/null.out: Check for esyscmd failure.
Reported by Elbert Pol.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog      |    7 +++++++
 tests/null.m4  |    4 +++-
 tests/null.out |    2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0869fc5..58b874e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-04-15  Eric Blake  <address@hidden>
+
+       Work around OS/2 limitation of printf(1).
+       * tests/null.m4: Use m4, not printf, to generate NUL byte.
+       * tests/null.out: Check for esyscmd failure.
+       Reported by Elbert Pol.
+
 2008-04-14  Eric Blake  <address@hidden>
 
        Stage 21b: $@ concatenates builtins, m4wrap takes builtins.
diff --git a/tests/null.m4 b/tests/null.m4
index 83e7c34..90e339f 100644
--- a/tests/null.m4
+++ b/tests/null.m4
@@ -1,3 +1,5 @@
+dnl Use `m4 -DNUL to print a NUL byte surrounded in [], then exit
+ifdef(`NUL', `[]m4exit`'')dnl
 # This file tests m4 behavior on NUL bytes.
 dnl Use `m4 -Dm4exit' to test rest of file.  NUL not a number, needs to warn
 m4exit(`22')dnl
@@ -49,7 +51,7 @@ errprint(`errprint:' --, `--
 ')dnl
 dnl Passed to esyscmd: not tested yet. NUL truncates string, needs to warn
 dnl Generated from esyscmd:
-`esyscmd:' esyscmd(`printf "[\\0]"')
+`esyscmd:' esyscmd(__program__` -DNUL '__file__) sysval
 dnl First argument of eval: not tested yet. NUL not a number, needs to warn
 dnl Other arguments of eval: not tested yet. NUL not a number, needs to warn
 dnl First argument to format: not tested yet
diff --git a/tests/null.out b/tests/null.out
index aca4b78..cd3764f 100644
--- a/tests/null.out
+++ b/tests/null.out
@@ -6,7 +6,7 @@ user: .--.--,11.--,11.
 builtin: 3
 defn: odd name: $1
 divert: --
-esyscmd: []
+esyscmd: [] 0
 ifdef: yes: -- oops: --
 ifelse: yes: --
 index: 2 -1 -1 8
-- 
1.5.5


From 404e78ea543a099810bd61e42fe5623c50cff370 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Tue, 15 Apr 2008 13:41:21 -0600
Subject: [PATCH] Update prerequisite tools to match recent releases.

* configure.ac (AC_PREREQ): Rely on released autoconf.
(LT_PREREQ): Rely on released libtool.
* tests/testsuite.at (m4_version_prereq): Update dependence.
* bootstrap: Mention prerequisites.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog          |    6 ++++++
 HACKING            |    6 +++---
 bootstrap          |    6 +++---
 configure.ac       |    4 ++--
 tests/testsuite.at |    4 ++--
 5 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 58b874e..0673ff9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-04-15  Eric Blake  <address@hidden>
 
+       Update prerequisite tools to match recent releases.
+       * configure.ac (AC_PREREQ): Rely on released autoconf.
+       (LT_PREREQ): Rely on released libtool.
+       * tests/testsuite.at (m4_version_prereq): Update dependence.
+       * bootstrap: Mention prerequisites.
+
        Work around OS/2 limitation of printf(1).
        * tests/null.m4: Use m4, not printf, to generate NUL byte.
        * tests/null.out: Check for esyscmd failure.
diff --git a/HACKING b/HACKING
index aefa74f..19b5de9 100644
--- a/HACKING
+++ b/HACKING
@@ -63,10 +63,10 @@ and is not part of a release distribution.
 
 * Before you can build from git, you need to bootstrap.  This requires:
   - A pre-installed version of GNU M4 1.4.5 or later, built from a
-  package
-  - A git checkout of Autoconf (will become Autoconf 2.62)
+    package (recommend 1.4.11 or later)
+  - Autoconf 2.62 or later
   - Automake 1.10.1 or later
-  - Libtool 2.1b or later
+  - Libtool 2.2 or later
   - Gettext 0.16 or later
   - Help2man 1.29 or later
   - LZMA Utils 4.32 or later (from <http://tukaani.org/lzma/>)
diff --git a/bootstrap b/bootstrap
index fc29a2f..77e0c71 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# bootstrap (GNU M4) version 2008-02-11
+# bootstrap (GNU M4) version 2008-04-15
 # Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 # License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 # This is free software: you are free to change and redistribute it.
@@ -39,8 +39,8 @@
 
 # This script bootstraps a git or CVS checkout of GNU M4 by correctly calling
 # out to parts of the GNU Build Platform.  Currently this requires GNU
-# Gettext 0.16 or better, a git snapshot of Autoconf 2.61a or better,
-# GNU M4 1.4.5 or better, Automake 1.10.1 or better, Libtool 2.1b or better,
+# Gettext 0.16 or better, Autoconf 2.62 or better, GNU M4 1.4.5 or better,
+# Automake 1.10.1 or better, Libtool 2.2 or better,
 # and the latest git or CVS checkout of Gnulib.
 # Libtool must be installed; either with the same --prefix as
 # automake, or made accessible to aclocal's search path via
diff --git a/configure.ac b/configure.ac
index b4a4515..354ed11 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 dnl We depend on autotest's ./testsuite -C.
-AC_PREREQ([2.61a.347])
+AC_PREREQ([2.62])
 
 ## ------------------------ ##
 ## Autoconf initialization. ##
@@ -77,7 +77,7 @@ M4_CHECK_DEBUGGING
 ## ----------------------- ##
 ## Libtool initialization. ##
 ## ----------------------- ##
-LT_PREREQ([2.1b])
+LT_PREREQ([2.2])
 LT_CONFIG_LTDL_DIR([ltdl])
 LT_INIT([shared dlopen win32-dll])
 LTDL_INIT([nonrecursive])
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 32cf345..784248a 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -1,7 +1,7 @@
 # Process with autom4te to create an -*- Autotest -*- test suite.
 
 # Test suite for GNU M4.
-# Copyright (C) 2001, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 # This file is part of GNU M4.
 #
@@ -19,7 +19,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # We need a recent Autotest.
-m4_version_prereq([2.52e])
+m4_version_prereq([2.62])
 
 # AT_CHECK_M4(ARGS, [EXIT-STATUS = 0], [STDOUT = `'], [STDERR = `'],
 #             [STDIN = `/dev/null'])
-- 
1.5.5


From 693e6ecc7448f782c2db9fc148c6876178d8b199 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Tue, 15 Apr 2008 22:19:00 -0600
Subject: [PATCH] Fix 'make installcheck' after './configure --prefix-progname'.

* tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
program name.
(HELP_OTHER, PREPARE_TESTS): Document and use $M4.
* tests/builtins.at (patsubst): Avoid space-tab.
(divert, mkdtemp, mkstemp): Adjust tests to use $M4.
* tests/options.at (--debugfile): Likewise.
* tests/others.at (stdin seekable): Likewise.
(fstab): Avoid space-tab.
* Makefile.am (installcheck-local): Accomodate transformed name.
(DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
during 'make distcheck'.
* cfg.mk: New file, borrowed from branch.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog          |   14 ++++++++++++++
 Makefile.am        |   10 ++++++++--
 cfg.mk             |   37 +++++++++++++++++++++++++++++++++++++
 tests/builtins.at  |   12 ++++++------
 tests/options.at   |    4 ++--
 tests/others.at    |    6 +++---
 tests/testsuite.at |   24 ++++++++++++++++++++++--
 7 files changed, 92 insertions(+), 15 deletions(-)
 create mode 100644 cfg.mk

diff --git a/ChangeLog b/ChangeLog
index 0673ff9..b4bdf14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2008-04-15  Eric Blake  <address@hidden>
 
+       Fix 'make installcheck' after './configure --prefix-progname'.
+       * tests/testsuite.at (AT_CHECK_M4): Allow overriding the m4
+       program name.
+       (HELP_OTHER, PREPARE_TESTS): Document and use $M4.
+       * tests/builtins.at (patsubst): Avoid space-tab.
+       (divert, mkdtemp, mkstemp): Adjust tests to use $M4.
+       * tests/options.at (--debugfile): Likewise.
+       * tests/others.at (stdin seekable): Likewise.
+       (fstab): Avoid space-tab.
+       * Makefile.am (installcheck-local): Accomodate transformed name.
+       (DISTCHECK_CONFIGURE_FLAGS): Ensure no regressions, by using gm4
+       during 'make distcheck'.
+       * cfg.mk: New file, borrowed from branch.
+
        Update prerequisite tools to match recent releases.
        * configure.ac (AC_PREREQ): Rely on released autoconf.
        (LT_PREREQ): Rely on released libtool.
diff --git a/Makefile.am b/Makefile.am
index dc4253b..7606802 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -416,10 +416,16 @@ check-local: tests/atconfig tests/m4 $(TESTSUITE) 
$(check_LTLIBRARIES)
        $(SHELL) '$(srcdir)/tests/testsuite' -C tests \
          $(TESTS_ENVIRONMENT) $(TESTSUITEFLAGS)
 
-# Run the test suite on the *installed* tree.
+# Run the test suite on the *installed* tree, including any renames
+# the user requested.
 installcheck-local: tests/atconfig $(TESTSUITE) $(check_LTLIBRARIES)
        $(SHELL) '$(srcdir)/tests/testsuite' -C tests \
-         $(TESTS_ENVIRONMENT) AUTOTEST_PATH="$(bindir)" $(TESTSUITEFLAGS)
+         $(TESTS_ENVIRONMENT) AUTOTEST_PATH="$(bindir)" \
+         M4="`echo m4 | sed '$(program_transform_name)'`" $(TESTSUITEFLAGS)
+
+# Enough users install GNU M4 as gm4 that we make sure 'make installcheck'
+# will handle that, as part of making a release.
+DISTCHECK_CONFIGURE_FLAGS = --disable-assert --program-prefix=g
 
 # We need to remove any file droppings left behind by testsuite.
 clean-local-tests:
diff --git a/cfg.mk b/cfg.mk
new file mode 100644
index 0000000..99abe29
--- /dev/null
+++ b/cfg.mk
@@ -0,0 +1,37 @@
+# Customize maint.mk.                           -*- makefile -*-
+# Copyright (C) 2003-2008 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 3 of the License, 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 alpha.gnu.org for alpha and beta releases.
+# Use ftp.gnu.org for major releases.
+gnu_ftp_host-alpha = alpha.gnu.org
+gnu_ftp_host-beta = alpha.gnu.org
+gnu_ftp_host-major = ftp.gnu.org
+gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
+
+url_dir_list = ftp://$(gnu_rel_host)/gnu/m4
+
+# The GnuPG ID of the key used to sign the tarballs.
+gpg_key_ID = F4850180
+
+# Tests not to run as part of "make distcheck".
+# Exclude changelog-check here so that there's less churn in ChangeLog
+# files -- otherwise, you'd need to have the upcoming version number
+# at the top of the file for each `make distcheck' run.
+local-checks-to-skip = changelog-check
+
+# The local directory containing the checked-out copy of gnulib used in this
+# release.  Used solely to get gnulib's SHA1 for the "announcement" target.
+gnulib_dir = $(srcdir)/../gnulib
diff --git a/tests/builtins.at b/tests/builtins.at
index 2feae51..2030b14 100644
--- a/tests/builtins.at
+++ b/tests/builtins.at
@@ -296,7 +296,7 @@ hello world
 
 dnl Test large diversions, which were broken in m4 1.4.8-1.4.10.
 AT_CHECK([echo 'divert(1)hi
-format(%1000000d, 1)' | m4 | sed 1q], [0], [[hi
+format(%1000000d, 1)' | $M4 | sed 1q], [0], [[hi
 ]])
 
 AT_DATA([in.m4], [M4_ONE_MEG_DEFN[divert(`2')f`'dnl
@@ -687,9 +687,9 @@ AT_DATA([[in]],
 [[translit(substr(esyscmd(`ls -ld 'mkdtemp(`m4-fooXXXXXX')), `0', `10'),
            `SsT', `-x-')
 ]])
-AT_CHECK([m4 < in], [0], [[drwx------
+AT_CHECK([$M4 < in], [0], [[drwx------
 ]])
-AT_CHECK([umask 700; m4 < in], [0], [[d---------
+AT_CHECK([umask 700; $M4 < in], [0], [[d---------
 ]])
 
 AT_CLEANUP
@@ -721,9 +721,9 @@ dnl Check that umask has an effect
 AT_DATA([[in]],
 [[substr(esyscmd(`ls -ld 'mkstemp(`m4-fooXXXXXX')), `0', `10')
 ]])
-AT_CHECK([m4 < in], [0], [[-rw-------
+AT_CHECK([$M4 < in], [0], [[-rw-------
 ]])
-AT_CHECK([umask 700; m4 < in], [0], [[----------
+AT_CHECK([umask 700; $M4 < in], [0], [[----------
 ]])
 
 dnl Check for Solaris compatibility of maketemp.  Hopefully the pid is
@@ -970,7 +970,7 @@ patsubst(`GNUs not Unix.', `\<\w', `\&=')
 patsubst(`GNUs not Unix.', `\w*', `(\&)')
 patsubst(`GNUs not Unix.', `\w+', `(\&)')
 patsubst(`GNUs not Unix.', `\w+')
-patsubst(`GNUs  not     Unix.', `[     ]+', ` ')
+patsubst(`GNUs  not  '`         Unix.', `[      ]+', ` ')
 ]])
 
 AT_DATA([[expout]],
diff --git a/tests/options.at b/tests/options.at
index ac41c3a..19b8874 100644
--- a/tests/options.at
+++ b/tests/options.at
@@ -1,5 +1,5 @@
 # Hand crafted tests for GNU M4.                               -*- Autotest -*-
-# Copyright (C) 2001, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 # This file is part of GNU M4.
 #
@@ -290,7 +290,7 @@ AT_CHECK_M4([--debugfile= -tfoo -Dfoo=bar in], [0],
 dnl check that all tracing gets diverted to the trace file.  Don't use
 dnl AT_CHECK_M4 on the first run, because sanitizing stderr breaks the
 dnl comparison with the raw data in the trace file of the second run.
-AT_CHECK([m4 -b -dV in], [0], [[foo
+AT_CHECK([$M4 -dV in], [0], [[foo
 ]], [stderr])
 mv stderr expout
 AT_CHECK_M4([--debugfile=trace4 -dV in], [0], [[foo
diff --git a/tests/others.at b/tests/others.at
index 22e8b99..68d58a3 100644
--- a/tests/others.at
+++ b/tests/others.at
@@ -209,7 +209,7 @@ AT_CLEANUP
 AT_SETUP([fstab])
 
 AT_DATA([[fstab.m4]],
-[[define(`concat', `translit(``$*'', `         ')')
+[[define(`concat', `translit(``$*'', `  ')')
 define(`fsent', `format(`%-25s %-16s nfs    %-16s 0 0', `$1:$2', `$3', 
concat$4)')
 
 fsent(freja, /home/gevn, /home/gevn, (rw, soft, bg, grpid))
@@ -582,7 +582,7 @@ dnl Check external follow-on process, after m4exit.
 AT_DATA([in.m4], [[m4exit(
 0)trailing data
 ]])
-AT_CHECK([(m4; cat) < in.m4], [0], [[trailing data
+AT_CHECK([($M4; cat) < in.m4], [0], [[trailing data
 ]])
 
 dnl Check external follow-on process, after fatal error.
@@ -590,7 +590,7 @@ dnl We can't use AT_CHECK_M4, so we must post-process 
stderr ourselves.
 AT_DATA([in.m4], [[dnl(
 0)trailing data
 ]])
-AT_CHECK([(m4 -EE; cat) < in.m4], [0], [[trailing data
+AT_CHECK([($M4 -EE; cat) < in.m4], [0], [[trailing data
 ]], [stderr])
 AT_CHECK([[sed 's/^[^:]*[lt-]*m4[.ex]*:/m4:/' stderr]], [0],
 [[m4:stdin:1: Warning: dnl: extra arguments ignored: 1 > 0
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 784248a..089395e 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -21,6 +21,26 @@
 # We need a recent Autotest.
 m4_version_prereq([2.62])
 
+# Default to testing "m4 -b", but allow overrides.
+dnl This uses knowledge of undocumented autotest internals; hopefully
+dnl it isn't too much of a problem.  FIXME: Help autoconf document
+dnl proper usage of HELP_OTHER, at_write_fail, and at_tested (or better
+dnl yet, add AT_FOO macros that wrap these internal details).
+m4_divert_text([HELP_OTHER],
+[cat <<\_ATEOF || at_write_fail=1
+
+The environment variable `M4' controls which binary is tested, default `m4 -b'.
+_ATEOF])
+m4_divert_text([PREPARE_TESTS],
+[[if test "${M4+set}" = set; then
+  case $M4 in
+    *[\\/]* ) at_tested= ;;
+    * ) at_tested=`set x $M4; echo $2` ;;
+  esac
+else
+  M4='m4 -b'
+fi]])
+
 # AT_CHECK_M4(ARGS, [EXIT-STATUS = 0], [STDOUT = `'], [STDERR = `'],
 #             [STDIN = `/dev/null'])
 # ------------------------------------------------------------------
@@ -47,8 +67,8 @@ m4_version_prereq([2.62])
 # or m4:input.m4:7: cannot open module `no_such': can't open the module
 # to m4:input.m4:7: cannot open module `no_such'
 m4_define([AT_CHECK_M4],
-[AT_CHECK([m4 -b -d $1 ]m4_if([$5], [-], [<&-],
-                             [< m4_default([$5], [/dev/null])]),
+[AT_CHECK([$M4 -d $1 ]m4_if([$5], [-], [<&-],
+                           [< m4_default([$5], [/dev/null])]),
           [$2], [$3], m4_case([$4], [], [], [ignore], [ignore], [stderr]))
 m4_case([$4], [], [], [ignore], [],
 [AT_CHECK([[sed 's/^[^:]*[lt-]*m4[.ex]*:/m4:/
-- 
1.5.5


reply via email to

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