m4-patches
[Top][All Lists]
Advanced

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

14-modernize-autotest.patch


From: Akim Demaille
Subject: 14-modernize-autotest.patch
Date: Mon, 20 Aug 2001 17:43:06 +0200

We _are_ converging.  distcheck works, but... check fails! :) This is
for stupid reasons of path canonicalization:

--- experr      Sun Aug 19 22:54:04 2001
+++ at-stderr   Sun Aug 19 22:54:05 2001
@@ -1,4 +1,4 @@
-m4: ../examples/regexp.m4: 2: WARNING: [...]
+m4: .././examples/regexp.m4: 2: WARNING: [...]

and it is Autotest which is culprit.  But I'm not sure how to clean
this completely, as it also demonstrates some big lack of
factorization in Autoconf itself (it's related to the src vs build,
top vs local mess).

I will fix this once we have a definitive interface of Autotest
integrated in Autoconf itself (something like AC_CONFIG_TESTDIR or so,
but it has to be debated, M4 does not need to follow the saga on a day
per day basis).

I'm happy.  Autotest made significant progress this weekend.

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * config/atconfig.m4: New, until part of Autoconf per se.
        * configure.in (AT_CONFIG): Use it.
        Adjust.
        * tests/mkconfig.sh, tests/atconfig.in, tests/defs: Remove.
        * tests/atlocal.in: New.
        * tests/generate.awk: For the time being, the empty quadrigraph is
        address@hidden@'.
        * tests/others.at (changeword, gmp): Check the configuration
        variable against `yes'.
        * tests/testsuite.at (dnl): Allow it, as it's used all over the
        place.

Index: configure.in
--- configure.in Sat, 18 Aug 2001 10:08:06 +0200 akim
+++ configure.in Sun, 19 Aug 2001 22:32:34 +0200 akim
@@ -23,6 +23,7 @@
 AC_CONFIG_SRCDIR([src/m4.h])
 AC_CONFIG_AUX_DIR(config)
 AM_CONFIG_HEADER(config.h:config-h.in)
+AT_CONFIG(tests)

 AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION)

@@ -102,6 +103,7 @@
 else
   AC_MSG_RESULT(no)
 fi], [AC_MSG_RESULT(no)])
+AC_SUBST([ENABLE_CHANGEWORD], $enable_changeword)

 AC_MSG_CHECKING(for modules to preload)
 m4_pattern_allow([^m4_default_preload$])dnl
@@ -130,6 +132,8 @@
 AC_CHECK_FUNCS(getcwd gethostname mktime uname)
 AC_CHECK_FUNCS(setenv unsetenv putenv clearenv)
 AM_WITH_GMP
+AC_SUBST([WITH_GMP], [$with_gmp])
+
 AM_WITH_DMALLOC
 if test "$USE_INCLUDED_LIBINTL" = yes; then
   AC_SUBST([INTLINCL], ['-I$(top_srcdir)/intl'])
@@ -145,11 +149,7 @@

 # Outputs.
 AC_CONFIG_FILES(Makefile config/Makefile doc/Makefile m4/Makefile
-                src/Makefile modules/Makefile tests/Makefile tests/atconfig
+                src/Makefile modules/Makefile tests/Makefile
                 examples/Makefile)

-m4_pattern_allow([^m4_top_srcdir$])dnl
-AC_CONFIG_COMMANDS([tests/config.sh],
-                   [$SHELL $m4_top_srcdir/tests/mkconfig.sh],
-                   [m4_top_srcdir=$srcdir])
 AC_OUTPUT
Index: config/Makefile.am
--- config/Makefile.am Thu, 16 Aug 2001 13:02:57 +0200 akim
+++ config/Makefile.am Sun, 19 Aug 2001 22:25:16 +0200 akim
@@ -31,6 +31,7 @@
 texinfo.tex

 EXTRA_DIST =                                   \
+atconfig.m4                                    \
 debug.m4                                       \
 gmp.m4                                         \
 gnu-obstack.m4                                 \
Index: tests/Makefile.am
--- tests/Makefile.am Sat, 18 Aug 2001 16:23:21 +0200 akim
+++ tests/Makefile.am Sun, 19 Aug 2001 22:34:13 +0200 akim
@@ -19,14 +19,13 @@
 # The next line is needed by `others.at:esyscmd'
 #  Ty Coon, President of Vice

-EXTRA_DIST = mkconfig.sh foo incl.m4 atconfig.in generate.awk \
-       defs $(OTHER_FILES) $(TESTSUITE_SOURCES) $(TESTSUITE)
+EXTRA_DIST = generate.awk atlocal.in \
+       $(OTHER_FILES) $(TESTSUITE_SOURCES) $(TESTSUITE)

-MAINTAINERCLEANFILES = Makefile.in generated.at config.m4 config.sh \
-       $(TESTSUITE)
+MAINTAINERCLEANFILES = Makefile.in generated.at $(TESTSUITE)

 OTHER_FILES = \
-       iso8859.m4 \
+       iso8859.m4 incl.m4 foo \
        stackovf.test

 TESTSUITE_SOURCES = testsuite.at others.at generated.at
Index: tests/generate.awk
--- tests/generate.awk Sat, 18 Aug 2001 16:23:21 +0200 akim
+++ tests/generate.awk Sun, 19 Aug 2001 22:44:24 +0200 akim
@@ -97,7 +97,7 @@
       gsub ("@[{]", "{", line);
       gsub ("@}", "}", line);
       gsub ("@@", "@", line);
-      gsub ("@comment.*", "@\"\"@", line);
+      gsub ("@comment.*", "@__@", line);

       # Some of the examples have improperly balanced square brackets.
       gsub ("[[]", "@<:@", line);
Index: tests/others.at
--- tests/others.at Sat, 18 Aug 2001 16:23:21 +0200 akim
+++ tests/others.at Sun, 19 Aug 2001 22:49:44 +0200 akim
@@ -44,7 +44,7 @@
 AT_SETUP([changeword])

 # cannot perform test without --enable-changeword
-AT_CHECK([test -z "$ENABLE_CHANGEWORD" && exit 77])
+AT_CHECK([test "$ENABLE_CHANGEWORD" = yes || exit 77])

 AT_DATA([[in]],
 [[define(1, 0)
@@ -283,7 +283,7 @@ rimfaxe:/home/rimfaxe     /home/rimfaxe
 AT_SETUP([gmp])

 # cannot perform test without --with-gmp
-AT_CHECK([test -z "$WITH_GMP" && exit 77])
+AT_CHECK([test "$WITH_GMP" = yes || exit 77])

 AT_DATA([[in]],
 [[divert(-1)
Index: tests/testsuite.at
--- tests/testsuite.at Sat, 18 Aug 2001 16:23:21 +0200 akim
+++ tests/testsuite.at Sun, 19 Aug 2001 22:38:35 +0200 akim
@@ -31,7 +31,8 @@ m4_define([AT_CHECK_M4],
 ])


-
+# We use `dnl' in zillions of places...
+m4_pattern_allow([^dnl$])

 AT_INIT([$M4])

Index: config/atconfig.m4
--- 0.21/config/atconfig.m4 Sun, 19 Aug 2001 22:56:30 +0200 akim ()
+++ config/atconfig.m4 Sun, 19 Aug 2001 22:24:41 +0200 akim
@@ -0,0 +1,74 @@
+## ----------------------##                              -*- Autoconf -*-
+## Prepare for testing.  ##
+## ----------------------##
+
+#serial 6
+
+# Copyright 2000, 2001 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+
+# AT_CONFIG(TEST-DIRECTORY, [AUTOTEST-PATH = .])
+# ----------------------------------------------
+# Configure the test suite.
+#
+# AUTOTEST-PATH must help the test suite to find the executables,
+# i.e., if the executables are in `src/', pass `src'.  If there are
+# also executables in the source tree, use `src:$top_srcdir/src'.
+
+AC_DEFUN([AT_CONFIG],
+[AC_CONFIG_COMMANDS([$1/atconfig],
+[cat >$1/atconfig <<EOF
address@hidden:@ Configurable variable values for building test suites.
address@hidden:@ Generated by $[0]
address@hidden:@ Copyright 2000, 2001 Free Software Foundation, Inc.
+
+at_package='$at_package'
+at_version='$at_version'
+at_bugreport='$at_bugreport'
+
+at_n='$at_n'
+at_c='$at_c'
+
+at_testdir='$1'
+at_topbuild_2_topsrc='$at_topbuild_2_topsrc'
+
+AUTOTEST_PATH='m4_default([$2], [.])'
+
+SHELL=\${CONFIG_SHELL-'$at_shell'}
+PATH_SEPARATOR='$at_path_separator'
+
+EOF
+],
+[at_package='$PACKAGE_NAME'
+at_version='$PACKAGE_VERSION'
+at_bugreport='$PACKAGE_BUGREPORT'
+
+at_n='$ECHO_N'
+at_c='$ECHO_C'
+
+# Path from top_build to top_src
+at_topbuild_2_topsrc=$srcdir
+
+at_shell='$SHELL'
+at_path_separator='$PATH_SEPARATOR'
+])
+
+if test -f $srcdir/$1/atlocal.in; then
+  AC_CONFIG_FILES([$1/atlocal])
+fi
+])# AT_CONFIG
Index: tests/atlocal.in
--- 0.21/tests/atlocal.in Sun, 19 Aug 2001 22:56:30 +0200 akim ()
+++ tests/atlocal.in Sun, 19 Aug 2001 22:42:25 +0200 akim
@@ -0,0 +1,14 @@
+# -*- shell-script -*-
+# @configure_generated@
+# Configurable variable values for M4 test suite.
+# Copyright 2000, 2001 Free Software Foundation, Inc.
+
+# We overwrite at_package, because Autotest expects `M4', not `m4'.
+at_package='GNU m4'
+
+# See how GNU m4 should be run.  No options as default.
+test -z "$M4" &&
+  M4="${SHELL} $top_builddir/libtool --mode=execute $top_builddir/src/m4"
+
address@hidden@
address@hidden@
Index: tests/atconfig.in
--- tests/atconfig.in Sat, 18 Aug 2001 10:08:06 +0200 akim
+++ 0.21(w)/tests/atconfig.in Sun, 19 Aug 2001 22:56:30 +0200 akim ()
@@ -1,74 +0,0 @@
-# -*- shell-script -*-
-# Generated automatically from atconfig.in by configure.
-# Configurable variable values for building test suites.
-# Copyright 2000, 2001 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, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# This script is part of Autotest.  Unlimited permission to copy,
-# distribute and modify the testing scripts that are the output of
-# that Autotest script is given.  You need not follow the terms of the
-# GNU General Public License when using or distributing such scripts,
-# even though portions of the text of Autotest appear in them.  The
-# GNU General Public License (GPL) does govern all other use of the
-# material that constitutes the Autotest.
-#
-# Certain portions of the Autotest source text are designed to be
-# copied (in certain cases, depending on the input) into the output of
-# Autotest.  We call these the "data" portions.  The rest of the
-# Autotest source text consists of comments plus executable code that
-# decides which of the data portions to output in any given case.  We
-# call these comments and executable code the "non-data" portions.
-# Autotest never copies any of the non-data portions into its output.
-#
-# This special exception to the GPL applies to versions of Autotest
-# released by the Free Software Foundation.  When you make and
-# distribute a modified version of Autotest, you may extend this
-# special exception to the GPL to apply to your modified version as
-# well, *unless* your modified version has the potential to copy into
-# its output some of the text that was the non-data portion of the
-# version that you started with.  (In other words, unless your change
-# moves or copies text from the non-data portions to the data
-# portions.)  If your modification has such potential, you must delete
-# any notice of this special exception to the GPL from your modified
-# version.
-
-# This debugging script has been automatically generated from `make check'.
-# Call it with `--help' to get a quick usage summary.
-
-at_package='GNU m4'
-at_version='1.4q'
-at_bugreport='address@hidden'
-
-at_n='-n'
-at_c=''
-
-srcdir='@srcdir@'
-top_srcdir='@top_srcdir@'
-top_builddir='..'
-AUTOTEST_PATH='../bin'
-
-SHELL=${CONFIG_SHELL-'/bin/sh'}
-PATH_SEPARATOR=':'
-
-# User can set MAKE to choose which make to use.  Must use GNU make.
-test -z "$MAKE" && MAKE=make
-
-# See how GNU m4 should be run.  No options as default.
-test -z "$M4" &&
-  M4="${SHELL} $top_builddir/libtool --mode=execute $top_builddir/src/m4"
-
-. ./config.sh
Index: tests/defs
--- tests/defs Thu, 16 Aug 2001 17:25:17 +0200 akim
+++ 0.21(w)/tests/defs Sun, 19 Aug 2001 22:56:30 +0200 akim ()
@@ -1,82 +0,0 @@
-# -*- sh -*-
-# Defines for GNU m4 testing environment.
-# Copyright 1991-1994, 1999, 2000, 2001 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 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, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# 02111-1307  USA
-#
-# Written by Erick Branderhorst <address@hidden>
-
-# Setting nls related vars. Override them in the test when needed.
-LANGUAGE=C
-export LANGUAGE
-LC_ALL=C
-export LC_ALL
-LANG=C
-export LANG
-
-# CDPATH.
-unset CDPATH >/dev/null 2>&1
-test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
-
-# Ensure $srcdir set correctly.
-test -f ${srcdir}/defs || {
-   echo "defs: installation error" 1>&2
-   exit 1
-}
-
-# If srcdir is relative, we need to modify it.
-case "$srcdir" in
- /*)
-    ;;
-
- .)
-    srcdir=".."
-    ;;
-
- *)
-    srcdir="../$srcdir"
-    ;;
-esac
-
-# Since we `cd', it is somewhat dangerous to rely upon relative paths.
-top_builddir=`cd $top_builddir && pwd`
-top_srcdir=`cd $top_srcdir && pwd`
-
-rm -rf testSubDir > /dev/null 2>&1
-mkdir testSubDir
-cd testSubDir
-
-# Build appropriate environment in test directory.  Eg create
-# configure.in, touch all necessary files, etc.
-
-# nothing yet
-
-# See how redirections should work.  User can set VERBOSE to see all
-# output.
-test -z "$VERBOSE" && {
-   exec > /dev/null 2>&1
-}
-
-# User can set MAKE to choose which make to use.  Must use GNU make.
-test -z "$MAKE" && MAKE=make
-
-echo "=== Running test $0"
-
-# See how GNU m4 should be run.  No options as default.
-test -z "$M4" && M4="${SHELL-/bin/sh} $top_builddir/libtool --mode=execute 
$top_builddir/src/m4"
-
-# See how cmp should be run.
-test -z "$CMP" && CMP=cmp
Index: tests/mkconfig.sh
--- tests/mkconfig.sh Fri, 10 Aug 2001 14:01:13 +0200 akim
+++ 0.21(w)/tests/mkconfig.sh Sun, 19 Aug 2001 22:56:30 +0200 akim ()
@@ -1,4 +0,0 @@
-#!/bin/sh
-env >/tmp/env
-sed -n -e '/^#define \(ENABLE_.*\) \(.*\)$/s//define(\1, \2)dnl/p' -e 
'/^#define \(WITH_.*\) \(.*\)$/s//define(\1, \2)dnl/p' config.h > 
tests/config.m4
-sed -n -e '/^#define \(ENABLE_.*\) \(.*\)$/s//\1=\2/p' -e '/^#define 
\(WITH_.*\) \(.*\)$/s//\1=\2/p' config.h > tests/config.sh



reply via email to

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