]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* tests/mktests.sh: New file, which replaces the code inlined in
authorAkim Demaille <akim@epita.fr>
Thu, 5 Oct 2000 09:39:06 +0000 (09:39 +0000)
committerAkim Demaille <akim@epita.fr>
Thu, 5 Oct 2000 09:39:06 +0000 (09:39 +0000)
Makefile.am.
* src/Makefile.am (macros.m4): Use `mktests.sh'.
* tests/suite.m4: Reorder from low level to high level.

ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/mktests.sh [new file with mode: 0755]
tests/suite.m4
tests/torture.m4

index 81c480a1898504991c59144d86f70db886419e7f..297f5e89e4f71cc0bb5a5e236e8611ab96dfd4a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-10-05  Akim Demaille  <akim@epita.fr>
+
+       * tests/mktests.sh: New file, which replaces the code inlined in
+       Makefile.am.
+       * src/Makefile.am (macros.m4): Use `mktests.sh'.
+       * tests/suite.m4: Reorder from low level to high level.
+
 2000-10-02  Akim Demaille  <akim@epita.fr>
 
        * aclang.m4 (_AC_LANG_ABBREV, _AC_LANG_ABBREV(C))
index a2c23e308261346dafd773cc5d249e143a34bcba..6e924ee2af33fc74d0fd6a70d427a7ecb9e28190 100644 (file)
@@ -24,9 +24,9 @@ SUITE = torture.m4 semantics.m4 syntax.m4 base.m4 tools.m4
 
 # We don't actually distribute the testsuite, since one only
 # needs m4 to build it, m4 being required anyway to install Autoconf.
-EXTRA_DIST = atgeneral.m4 atspecific.m4 suite.m4 macros.m4 aclocal.m4 $(SUITE)
-
-PERL = perl
+EXTRA_DIST = atgeneral.m4 atspecific.m4 suite.m4 macros.m4 aclocal.m4 \
+             $(SUITE) \
+             mktests.sh
 
 check-local: atconfig testsuite
        $(SHELL) testsuite
@@ -39,87 +39,12 @@ testsuite: atgeneral.m4 atspecific.m4 suite.m4 macros.m4 $(SUITE)
        mv $@-tmp $@
 
 
-
-# FILTER_MACROS
-# -------------
-# The test `syntax.m4' tries to run all the macros of Autoconf to check
-# for syntax problems, etc.  Not all the macros can be run without argument,
-# and some are already tested elsewhere.  EGREP_EXCLUDE must filter out
-# the macros we don't want to test in syntax.m4.
-#
-# - AC_CANONICALIZE, AC_PREFIX_PROGRAM
-#   Need an argument.
-# - AC_CHECK decl, file, func, header, lib, member, prog, sizeof, type
-#   Performed in the semantics tests.
-# - AC_CONFIG
-#   They fail when the source does not exist.
-# - AC_INIT
-#   AC_INIT includes all the AC_INIT macros.  Note that there is an
-#   infinite m4 recursion if AC_INIT it used twice.
-# - AC_LANG*
-#   Heavily used by other macros.
-# - AC_PATH_PROGS?, AC_F77_FUNC
-#   They produce `= val' because $1, the variable used to store the result,
-#   is empty.
-# - AC_TRY, AC_.*_IFELSE
-#   Used in many places.
-# - _AC_
-#   Internal macros are used elsewhere.
-# - AC_OUTPUT
-#   Already tested by `AT_CHECK_MACRO'.
-# - AC_FD_CC
-#   Is a number.
-# - AC_PROG_CC, AC_C_(CONST|INLINE|VOLATILE)
-#   Checked in semantics.
-# - AC_CYGWIN, AC_CYGWIN32, AC_EMXOS2, AC_MING32, AC_EXEEXT, AC_OBJEXT
-#   AU defined to nothing.
-#
-# Multiple `-e' to egrep are not portable, so join all the patterns together.
-# We use the fact that automake will replace all the `\\\n' with ` '.
-FILTER_MACROS = egrep -v -e \
-`echo '^AC_ARG_VAR$$\
-^AC_CANONICALIZE$$\
-^AC_CHECK_(DECL|FILE|FUNC|HEADER|LIB|MEMBER|PROG|SIZEOF|TOOL|TYPE)S?$$\
-^AC_CONFIG\
-^AC_F77_FUNC$$\
-^AC_INIT\
-^AC_LANG\
-^AC_LINKER_OPTION$$\
-^AC_LINK_FILES$$\
-^AC_LIST_MEMBER_OF$$\
-^AC_OUTPUT$$\
-^AC_PATH_(TOOL|PROG)S?$$\
-^AC_PREFIX_PROGRAM$$\
-^AC_REPLACE_FUNCS$$\
-^AC_SEARCH_LIBS$$\
-^AC_TRY\
-^AC_.*_IFELSE$$\
-^AC_FD_CC$$\
-^(AC_(PROG_CC|C_CONST|C_INLINE|C_VOLATILE))$$\
-^AC_(CYGWIN|CYGWIN32|EMXOS2|MING32|EXEEXT|OBJEXT)$$\
-_AC_' | tr ' ' '|'`
-
 # The files which contains macro we check for syntax.
 MACRO_FILES = $(top_srcdir)/acgeneral.m4   $(top_srcdir)/acspecific.m4 \
               $(top_srcdir)/acfunctions.m4 $(top_srcdir)/aclang.m4
 
 macros.m4: $(MACRO_FILES) $(srcdir)/Makefile.am
-       cat $(MACRO_FILES) | \
-         sed -ne 's/^A[CU]_DEFUN\(_ONCE\)\?(\[*\([a-zA-Z0-9_]*\).*$$/\2/p' | \
-         sort | uniq | $(FILTER_MACROS) >defuns
-# Get the list of macros that are required: there is little interest
-# in testing them since they will be run but the guy who requires
-# them.
-       cat $(MACRO_FILES) | \
-         sed -ne 's/dnl.*//;s/.*AC_REQUIRE(\[*\([a-zA-Z0-9_]*\).*$$/\1/p' | \
-         sort | uniq >requires
-       for macro in `cat defuns`; do \
-         if fgrep "$$macro" requires >/dev/null 2>&1; then :; else \
-           echo "AT_CHECK_MACRO([$$macro])" >>$@-t; \
-         fi; \
-       done
-       rm defuns requires
-       mv $@-t $@
+       ./mktests.sh $@ $(MACRO_FILES)
 
 CLEANFILES = debug-*.sh macro configure configure.in config.status \
 config.cache config.log config.h.in config.h
index ce628102223cf919b650ad1b10ac01a840ac705a..82d1571e97719d4b31c131656561c51311acc40b 100644 (file)
@@ -69,48 +69,10 @@ SUITE = torture.m4 semantics.m4 syntax.m4 base.m4 tools.m4
 
 # We don't actually distribute the testsuite, since one only
 # needs m4 to build it, m4 being required anyway to install Autoconf.
-EXTRA_DIST = atgeneral.m4 atspecific.m4 suite.m4 macros.m4 aclocal.m4 $(SUITE)
+EXTRA_DIST = atgeneral.m4 atspecific.m4 suite.m4 macros.m4 aclocal.m4              $(SUITE)              mktests.sh
 
-PERL = perl
-
-# FILTER_MACROS
-# -------------
-# The test `syntax.m4' tries to run all the macros of Autoconf to check
-# for syntax problems, etc.  Not all the macros can be run without argument,
-# and some are already tested elsewhere.  EGREP_EXCLUDE must filter out
-# the macros we don't want to test in syntax.m4.
-#
-# - AC_CANONICALIZE, AC_PREFIX_PROGRAM
-#   Need an argument.
-# - AC_CHECK decl, file, func, header, lib, member, prog, sizeof, type
-#   Performed in the semantics tests.
-# - AC_CONFIG
-#   They fail when the source does not exist.
-# - AC_INIT
-#   AC_INIT includes all the AC_INIT macros.  Note that there is an
-#   infinite m4 recursion if AC_INIT it used twice.
-# - AC_LANG*
-#   Heavily used by other macros.
-# - AC_PATH_PROGS?, AC_F77_FUNC
-#   They produce `= val' because $1, the variable used to store the result,
-#   is empty.
-# - AC_TRY, AC_.*_IFELSE
-#   Used in many places.
-# - _AC_
-#   Internal macros are used elsewhere.
-# - AC_OUTPUT
-#   Already tested by `AT_CHECK_MACRO'.
-# - AC_FD_CC
-#   Is a number.
-# - AC_PROG_CC, AC_C_(CONST|INLINE|VOLATILE)
-#   Checked in semantics.
-# - AC_CYGWIN, AC_CYGWIN32, AC_EMXOS2, AC_MING32, AC_EXEEXT, AC_OBJEXT
-#   AU defined to nothing.
-#
-# Multiple `-e' to egrep are not portable, so join all the patterns together.
-# We use the fact that automake will replace all the `\\\n' with ` '.
-FILTER_MACROS = egrep -v -e `echo '^AC_ARG_VAR$$ ^AC_CANONICALIZE$$ ^AC_CHECK_(DECL|FILE|FUNC|HEADER|LIB|MEMBER|PROG|SIZEOF|TOOL|TYPE)S?$$ ^AC_CONFIG ^AC_F77_FUNC$$ ^AC_INIT ^AC_LANG ^AC_LINKER_OPTION$$ ^AC_LINK_FILES$$ ^AC_LIST_MEMBER_OF$$ ^AC_OUTPUT$$ ^AC_PATH_(TOOL|PROG)S?$$ ^AC_PREFIX_PROGRAM$$ ^AC_REPLACE_FUNCS$$ ^AC_SEARCH_LIBS$$ ^AC_TRY ^AC_.*_IFELSE$$ ^AC_FD_CC$$ ^(AC_(PROG_CC|C_CONST|C_INLINE|C_VOLATILE))$$ ^AC_(CYGWIN|CYGWIN32|EMXOS2|MING32|EXEEXT|OBJEXT)$$ _AC_' | tr ' ' '|'`
 
+PERL = perl
 
 # The files which contains macro we check for syntax.
 MACRO_FILES = $(top_srcdir)/acgeneral.m4   $(top_srcdir)/acspecific.m4               $(top_srcdir)/acfunctions.m4 $(top_srcdir)/aclang.m4
@@ -241,22 +203,7 @@ testsuite: atgeneral.m4 atspecific.m4 suite.m4 macros.m4 $(SUITE)
        mv $@-tmp $@
 
 macros.m4: $(MACRO_FILES) $(srcdir)/Makefile.am
-       cat $(MACRO_FILES) | \
-         sed -ne 's/^A[CU]_DEFUN\(_ONCE\)\?(\[*\([a-zA-Z0-9_]*\).*$$/\2/p' | \
-         sort | uniq | $(FILTER_MACROS) >defuns
-# Get the list of macros that are required: there is little interest
-# in testing them since they will be run but the guy who requires
-# them.
-       cat $(MACRO_FILES) | \
-         sed -ne 's/dnl.*//;s/.*AC_REQUIRE(\[*\([a-zA-Z0-9_]*\).*$$/\1/p' | \
-         sort | uniq >requires
-       for macro in `cat defuns`; do \
-         if fgrep "$$macro" requires >/dev/null 2>&1; then :; else \
-           echo "AT_CHECK_MACRO([$$macro])" >>$@-t; \
-         fi; \
-       done
-       rm defuns requires
-       mv $@-t $@
+       ./mktests.sh $@ $(MACRO_FILES)
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/tests/mktests.sh b/tests/mktests.sh
new file mode 100755 (executable)
index 0000000..9164958
--- /dev/null
@@ -0,0 +1,120 @@
+#! /bin/sh
+
+# Build some of the Autoconf test files.
+
+# Copyright (C) 2000 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.
+
+dst=$1
+shift
+src="$@"
+
+# filter_macros_list
+# ------------------
+# The test `syntax.m4' tries to run all the macros of Autoconf to check
+# for syntax problems, etc.  Not all the macros can be run without argument,
+# and some are already tested elsewhere.  EGREP_EXCLUDE must filter out
+# the macros we don't want to test in syntax.m4.
+#
+# - AC_CANONICALIZE, AC_PREFIX_PROGRAM
+#   Need an argument.
+# - AC_CHECK decl, file, func, header, lib, member, prog, sizeof, type
+#   Performed in the semantics tests.
+# - AC_CONFIG
+#   They fail when the source does not exist.
+# - AC_INIT
+#   AC_INIT includes all the AC_INIT macros.  Note that there is an
+#   infinite m4 recursion if AC_INIT it used twice.
+# - AC_LANG*
+#   Heavily used by other macros.
+# - AC_PATH_PROGS?, AC_F77_FUNC
+#   They produce `= val' because $1, the variable used to store the result,
+#   is empty.
+# - AC_TRY, AC_.*_IFELSE
+#   Used in many places.
+# - _AC_
+#   Internal macros are used elsewhere.
+# - AC_OUTPUT
+#   Already tested by `AT_CHECK_MACRO'.
+# - AC_FD_CC
+#   Is a number.
+# - AC_PROG_CC, AC_C_(CONST|INLINE|VOLATILE)
+#   Checked in semantics.
+# - AC_CYGWIN, AC_CYGWIN32, AC_EMXOS2, AC_MING32, AC_EXEEXT, AC_OBJEXT
+#   AU defined to nothing.
+filter_macros_list='^AC_ARG_VAR$
+^AC_CANONICALIZE$
+^AC_CHECK_(DECL|FILE|FUNC|HEADER|LIB|MEMBER|PROG|SIZEOF|TOOL|TYPE)S?$
+^AC_CONFIG
+^AC_F77_FUNC$
+^AC_INIT
+^AC_LANG
+^AC_LINKER_OPTION$
+^AC_LINK_FILES$
+^AC_LIST_MEMBER_OF$
+^AC_OUTPUT$
+^AC_PATH_(TOOL|PROG)S?$
+^AC_PREFIX_PROGRAM$
+^AC_REPLACE_FUNCS$
+^AC_SEARCH_LIBS$
+^AC_TRY
+^AC_.*_IFELSE$
+^AC_FD_CC$
+^(AC_(PROG_CC|C_CONST|C_INLINE|C_VOLATILE))$
+^AC_(CYGWIN|CYGWIN32|EMXOS2|MING32|EXEEXT|OBJEXT)$
+_AC_'
+
+# filter_macros_egrep --
+# Build a single egrep pattern out of filter_macros_list.
+# Sed is used to get rid of the trailing `|' coming from the trailing
+# `\n' from `echo'.
+filter_macros_egrep=`echo "$filter_macros_list" | tr '
+' '|' | sed 's/.$//'`
+
+
+case $dst in
+ *macros.m4)
+    # Get the list of macros which are defined in Autoconf level.
+    # Get rid of the macros we are not interested in.
+    cat $src | \
+      sed -ne 's/^A[CU]_DEFUN\(_ONCE\)\?(\[*\([a-zA-Z0-9_]*\).*$/\2/p' | \
+      sort | uniq | egrep -v "$filter_macros_egrep" >defuns
+
+    # Get the list of macros that are required: there is little interest
+    # in testing them since they will be run but the guy who requires
+    # them.
+    cat $src | \
+      sed -ne 's/dnl.*//;s/.*AC_REQUIRE(\[*\([a-zA-Z0-9_]*\).*$/\1/p' | \
+      sort | uniq >requires
+
+    # Filter out.
+    for macro in `cat defuns`; do \
+      if fgrep "$macro" requires >/dev/null 2>&1; then :; else \
+       echo "AT_CHECK_MACRO([$macro])" >>$dst-t; \
+      fi; \
+    done
+
+    rm defuns requires
+    mv $dst-t $dst
+  ;;
+
+  *)
+    echo "$0: don't know how to do $src" >&2
+    exit 1
+esac
+
+exit 0
index 46c33c2c3e1b66ff9fba81c0b69462be635c7c79..0debd03b8d32c3bcb9a89b10485c045f4f7902e3 100644 (file)
@@ -14,10 +14,20 @@ Some tests might be ignored if you don't have the software which the
 macros are supposed to test (e.g., a Fortran compiler).
 EOF
 
-dnl Run the tests from the most selective to the easiest.
+# Run the tests from the lowest level to the highest level, and from
+# the most selective to the easiest.
 
-AT_INCLUDE(torture.m4)
+# libm4.
+AT_INCLUDE(base.m4)
+
+# The executables.
+AT_INCLUDE(tools.m4)
+
+# Checking that AC_CHECK_FOO macros work properly.
 AT_INCLUDE(semantics.m4)
+
+# Stressing config.status.
+AT_INCLUDE(torture.m4)
+
+# Checking all the AC_DEFUN'd macros.
 AT_INCLUDE(syntax.m4)
-AT_INCLUDE(tools.m4)
-AT_INCLUDE(base.m4)
index 692fa9adcf4c23c42aa42712eeee340fd3568162..394114ec8c301a04cf157caf479052a0190482ad 100644 (file)
@@ -5,10 +5,10 @@ cat <<\EOF
 Torturing config.status.
 
 ## ---------------------------------------------------------------- ##
-## This section of tests is trying to make Autoconf produce failing ##
-## `configure' scripts, which must not happen.  If these tests ever ##
-## fail, it is extremely important that you report the failure to   ##
-## bug-autoconf@gnu.org.                                            ##
+## This section of torture tests is trying to make Autoconf produce ##
+## failing `configure' scripts, which must never happen.  If one of ##
+## these tests ever fails, it is extremely important that you       ##
+## report the failure to bug-autoconf@gnu.org.                      ##
 ## ---------------------------------------------------------------- ##
 
 EOF