autoconf-patches
[Top][All Lists]
Advanced

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

FYI: Reordering the test suite


From: Akim Demaille
Subject: FYI: Reordering the test suite
Date: 16 Nov 2000 15:45:23 +0100
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

The logs Lars sent me clearly demonstrate that the order was poor and
needed to be improved.

I'd like to rename torture.at into config.status.at, or status.at I
don't know, depending upon your fears on the name.  semantics should
probably be renamed to, maybe check.at or ac-check.at.

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        Reorder the test suite so that low level features are tested
        before high level ones.

        * tests/semantics.at (AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS):
        (missing templates): Move to...
        * tests/torture.at: here.
        Reorder the file so that the torture test is last.
        * tests/semantics.at (AC_TRY_LINK_FUNC, AC_PROG_CPP with warnings)
        (AC_PROG_CPP without warnings): Move to...
        * tests/compile.at: here, new file.
        * tests/suite.at: Run `torture' and then `compile' before
        `semantics'.

Index: tests/Makefile.am
===================================================================
RCS file: /cvs/autoconf/tests/Makefile.am,v
retrieving revision 1.37
diff -u -u -r1.37 Makefile.am
--- tests/Makefile.am 2000/11/14 10:31:40 1.37
+++ tests/Makefile.am 2000/11/16 14:53:06
@@ -22,7 +22,7 @@
 
 SUITE = suite.at \
         m4sugar.at m4sh.at \
-        base.at tools.at semantics.at torture.at syntax.at update.at
+        base.at tools.at torture.at compile.at semantics.at syntax.at update.at
 
 # We don't actually distribute the testsuite, since one only
 # needs m4 to build it, m4 being required anyway to install Autoconf.
Index: tests/compile.at
===================================================================
RCS file: compile.at
diff -N compile.at
--- /dev/null   Tue Aug 29 07:25:14 2000
+++ tests/compile.at Thu Nov 16 06:53:07 2000
@@ -0,0 +1,105 @@
+#                                                      -*- autoconf -*-
+
+cat <<EOF
+
+Low level compiling/preprocessing macros.
+
+EOF
+
+# Since the macros which compile are required by most tests, check
+# them first.  But remember that looking for a compiler is even more
+# primitive, so check those first.
+
+
+## ------------ ##
+## C keywords.  ##
+## ------------ ##
+
+# GCC supports `const', `volatile', and `inline'.
+AT_CHECK_MACRO([C keywords],
+[[AC_PROG_CC
+AC_C_CONST
+AC_C_INLINE
+AC_C_VOLATILE
+case "$GCC,$ac_cv_c_const,$ac_cv_c_inline,$ac_cv_c_volatile" in
+ yes,*no*)
+   AC_MSG_ERROR([failed to detect `const', `inline' or `volatile' support]);;
+esac]])
+
+
+
+## --------------------------- ##
+## AC_PROG_CPP with warnings.  ##
+## --------------------------- ##
+
+
+# It's Ok for strict preprocessors to produce warnings.
+
+AT_SETUP([AC_PROG_CPP with warnings])
+
+AT_DATA([mycpp],
+[[#! /bin/sh
+echo noise >&2
+exec ${1+"$@"}
+]])
+
+chmod +x mycpp
+
+_AT_CHECK_AC_MACRO(
+[AC_PROG_CPP
+# If the preprocessor is not strict, just ignore
+test "x$ac_c_preproc_warn_flag" = xyes &&
+  AC_MSG_ERROR([preprocessor has no warning option], 77)
+CPP="./mycpp $CPP"
+AC_CHECK_HEADERS(stdio.h autoconf_io.h)])
+
+AT_CHECK_DEFINES(
+[/* #undef HAVE_AUTOCONF_IO_H */
+#define HAVE_STDIO_H 1
+])
+
+AT_CLEANUP(configure config.status config.log config.cache config.hin config.h 
env-after)dnl
+
+
+## ------------------------------ ##
+## AC_PROG_CPP without warnings.  ##
+## ------------------------------ ##
+
+AT_SETUP([AC_PROG_CPP without warnings])
+
+AT_DATA([mycpp],
+[[#! /bin/sh
+/lib/cpp ${1+"$@"}
+exit 0
+]])
+
+chmod +x mycpp
+
+_AT_CHECK_AC_MACRO(
+[# Ignore if /lib/cpp doesn't work
+/lib/cpp </dev/null >/dev/null 2>&1 ||
+  AC_MSG_ERROR([preprocessor doesn't work], 77)
+CPP=./mycpp
+AC_PROG_CPP
+test "x$ac_c_preproc_warn_flag" != xyes &&
+  AC_MSG_ERROR([failed to detect preprocessor warning option])
+AC_CHECK_HEADERS(stdio.h autoconf_io.h)])
+
+AT_CHECK_DEFINES(
+[/* #undef HAVE_AUTOCONF_IO_H */
+#define HAVE_STDIO_H 1
+])
+
+AT_CLEANUP(configure config.status config.log config.cache config.hin config.h 
env-after)dnl
+
+
+
+## ------------------ ##
+## AC_TRY_LINK_FUNC.  ##
+## ------------------ ##
+
+AT_CHECK_MACRO([AC_TRY_LINK_FUNC],
+[AC_TRY_LINK_FUNC(exit,,
+                  [AC_MSG_ERROR([cannot find `exit'])])
+AC_TRY_LINK_FUNC(Be_doomed_if_your_libc_has_a_function_named_like_this,
+                 [AC_MSG_ERROR([found a nonexistent function])])])
Index: tests/semantics.at
===================================================================
RCS file: /cvs/autoconf/tests/semantics.at,v
retrieving revision 1.5
diff -u -u -r1.5 semantics.at
--- tests/semantics.at 2000/11/14 10:05:15 1.5
+++ tests/semantics.at 2000/11/16 14:53:07
@@ -400,74 +400,3 @@
 ])
 
 AT_CLEANUP(configure config.status config.log config.cache config.hin config.h 
env-after)dnl
-
-
-
-
-
-## ------------- ##
-## Base macros.  ##
-## ------------- ##
-
-
-AT_SETUP([AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS])
-
-AT_DATA(configure.in,
-[[AC_INIT
-rm -rf header file link command
-touch header.in file.in link.in command.in
-case $what_to_test in
- header)   AC_CONFIG_HEADERS(header:header.in);;
- file)     AC_CONFIG_FILES(file:file.in);;
- command)  AC_CONFIG_COMMANDS(command:command.in, [cp command.in command]);;
- link)     AC_CONFIG_LINKS(link:link.in);;
-esac
-AC_OUTPUT
-]])
-
-AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
-
-# Create a header
-AT_CHECK([./configure what_to_test=header], 0, ignore)
-AT_CHECK([ls header file command link 2>/dev/null], [], [header
-])
-
-# Create a file
-AT_CHECK([./configure what_to_test=file], 0, ignore)
-AT_CHECK([ls header file command link 2>/dev/null], [], [file
-])
-
-# Execute a command
-AT_CHECK([./configure what_to_test=command], 0, ignore)
-AT_CHECK([ls header file command link 2>/dev/null], [], [command
-])
-
-# Create a link
-AT_CHECK([./configure what_to_test=link], 0, ignore)
-AT_CHECK([ls header file command link 2>/dev/null], [], [link
-])
-
-AT_CLEANUP(header file link command header.in file.in link.in command.in 
configure config.status)
-
-
-
-## ------------------------------------------------------ ##
-## Check that config.status detects missing input files.  ##
-## ------------------------------------------------------ ##
-
-AT_SETUP([missing templates])
-
-AT_DATA(configure.in,
-[[AC_INIT
-AC_CONFIG_FILES([nonexistent])
-AC_OUTPUT
-]])
-
-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
-AT_CHECK([./configure], 1, ignore,
-[[config.status: error: cannot find input file `nonexistent.in'
-]])
-# Make sure that the output file doesn't exist
-AT_CHECK([test -f nonexistent], 1)
-
-AT_CLEANUP(configure config.status config.log config.cache config.h defs)
Index: tests/suite.at
===================================================================
RCS file: /cvs/autoconf/tests/suite.at,v
retrieving revision 1.2
diff -u -u -r1.2 suite.at
--- tests/suite.at 2000/10/27 14:43:45 1.2
+++ tests/suite.at 2000/11/16 14:53:07
@@ -8,7 +8,7 @@
 # like contributing new tests?  If you do, you may tell your intent to
 # address@hidden', so no two people work at the same thing.
 
-AT_INIT(autoconf)
+AT_INIT([autoconf])
 
 cat <<EOF
 Some tests might be ignored if you don't have the software which the
@@ -19,25 +19,32 @@
 # the most selective to the easiest.
 
 # M4sugar.
-AT_INCLUDE(m4sugar.at)
+AT_INCLUDE([m4sugar.at])
 
 # M4sh.m4.
-AT_INCLUDE(m4sh.at)
+AT_INCLUDE([m4sh.at])
 
 # Autoconf base macros.
-AT_INCLUDE(base.at)
+AT_INCLUDE([base.at])
 
 # The executables.
-AT_INCLUDE(tools.at)
+AT_INCLUDE([tools.at])
 
-# Checking that AC_CHECK_FOO macros work properly.
-AT_INCLUDE(semantics.at)
+# Testing config.status
+# ---------------------
+# Actually should be named config.status.at but I fear problems with
+# the name.  Does no `checking...' at all, but exercises only code
+# which following section use too.  Hence, run it first.
+AT_INCLUDE([torture.at])
+
+# Checking AC_PROG_CC, AC_COMPILE_IFELSE etc.
+AT_INCLUDE([compile.at])
 
-# Stressing config.status.
-AT_INCLUDE(torture.at)
+# Checking that AC_CHECK_FOO macros work properly.
+AT_INCLUDE([semantics.at])
 
 # Checking all the AC_DEFUN'd macros.
-AT_INCLUDE(syntax.at)
+AT_INCLUDE([syntax.at])
 
-# Checking that updatiing an obsolete macro produces a valid configure.in
-AT_INCLUDE(update.at)
+# Checking that updating an obsolete macro produces a valid configure.in
+AT_INCLUDE([update.at])
Index: tests/torture.at
===================================================================
RCS file: /cvs/autoconf/tests/torture.at,v
retrieving revision 1.2
diff -u -u -r1.2 torture.at
--- tests/torture.at 2000/11/03 08:53:27 1.2
+++ tests/torture.at 2000/11/16 14:53:07
@@ -2,7 +2,7 @@
 
 cat <<\EOF
 
-Torturing config.status.
+Testing config.status.
 
 ## ---------------------------------------------------------------- ##
 ## This section of torture tests is trying to make Autoconf produce ##
@@ -13,88 +13,73 @@
 
 EOF
 
-dnl The value used as a big value for AC_DEFINE.
-dnl Don't use sh active chars here, below it is also used in a sh
-dnl assignment.
-define(Big_Value,
-[This value should be long enough to torture the various limits of sed and 
other tools used by Autoconf.])
+## ---------------------------------------------- ##
+## AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS.  ##
+## ---------------------------------------------- ##
 
-define(DEFINE_Description,
-[Define to a long string if your `Autoconf' works properly.])
 
+AT_SETUP([AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS])
 
-# AT_DUMMY_VAR(NUMBER)
-# --------------------
-# Build a name used for AC_SUBST and AC_DEFINE.  Put ac_ in it
-# so that the check for user name space invasion does not complain
-# of the new variables defined.
-#
-# Note that you should not use the name ac_dummy, because it will be
-# turned into ac_uummy during the construction of config.status.  Yes,
-# this is admittedly a bug, but it would be too hard to fix this.
-# There is really no point in AC_DEFINE a var named ac_d.*.
-define(AT_DUMMY_VAR,
-[ac_Dummy_[]m4_patsubst([000$1], [.*\(...\)$], [\1])])
+AT_DATA(configure.in,
+[[AC_INIT
+rm -rf header file link command
+touch header.in file.in link.in command.in
+case $what_to_test in
+ header)   AC_CONFIG_HEADERS(header:header.in);;
+ file)     AC_CONFIG_FILES(file:file.in);;
+ command)  AC_CONFIG_COMMANDS(command:command.in, [cp command.in command]);;
+ link)     AC_CONFIG_LINKS(link:link.in);;
+esac
+AC_OUTPUT
+]])
 
-dnl This call was quite delicate to write because we didn't want to
-dnl produce the 100 commands by hand.  Be very careful if you want to
-dnl touch something.
+AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
 
+# Create a header
+AT_CHECK([./configure what_to_test=header], 0, ignore)
+AT_CHECK([ls header file command link 2>/dev/null], [], [header
+])
 
+# Create a file
+AT_CHECK([./configure what_to_test=file], 0, ignore)
+AT_CHECK([ls header file command link 2>/dev/null], [], [file
+])
 
-## ------------------------- ##
-## Torturing config.status.  ##
-## ------------------------- ##
+# Execute a command
+AT_CHECK([./configure what_to_test=command], 0, ignore)
+AT_CHECK([ls header file command link 2>/dev/null], [], [command
+])
 
-## Require 100 AC_DEFINE and AC_SUBST with a significantly big value.
-## This is mostly to check that Autoconf produces portable sed scripts
-## in config.status.  sed is used to skip the first two lines
-## `Generated by...'.
+# Create a link
+AT_CHECK([./configure what_to_test=link], 0, ignore)
+AT_CHECK([ls header file command link 2>/dev/null], [], [link
+])
 
-AT_SETUP(config.status under extreme conditions)
+AT_CLEANUP(header file link command header.in file.in link.in command.in 
configure config.status)
 
-AT_DATA(dummy.in,
-[m4_for(AT_Count, 1, 100,
address@hidden(AT_Count)@
-])])
 
+
+## ------------------------------------------------------ ##
+## Check that config.status detects missing input files.  ##
+## ------------------------------------------------------ ##
+
+AT_SETUP([missing templates])
+
 AT_DATA(configure.in,
-[AC_INIT
-AC_CONFIG_HEADERS(config.h:config.hin)
-AC_CONFIG_FILES(dummy)
-[define]([AC_DEFUBST_VALUE], Big_Value)
-dnl The following 4 lines are a transfert from AT_DUMMY_VAR in Autotest
-dnl to AC_DUMMY_VAR in Autoconf.
-[define]([AC_DUMMY_VAR],
-changequote({{, }})dnl
-[defn({{AT_DUMMY_VAR}})]dnl
-changequote([, ]))
-m4_for(AT_Count, 1, 100,
-[AC_DEFUBST(AT_Count)
-])
+[[AC_INIT
+AC_CONFIG_FILES([nonexistent])
 AC_OUTPUT
-])
-
-AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
-AT_CHECK([../autoheader --autoconf-dir .. -l $at_srcdir], 0, [], [])
-AT_CHECK([./configure], 0, ignore)
+]])
 
-# Checking that AC_DEFINE worked properly.
-AT_DATA(expout,
-[m4_for(AT_Count, 1, 100,
-[
-/* DEFINE_Description */
-[#define] AT_DUMMY_VAR(AT_Count) "Big_Value"
-])])
-AT_CHECK([sed -n -e '3,$ p' config.h], 0, expout)
+AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
+AT_CHECK([./configure], 1, ignore,
+[[config.status: error: cannot find input file `nonexistent.in'
+]])
+# Make sure that the output file doesn't exist
+AT_CHECK([test -f nonexistent], 1)
 
-# Checking that AC_SUBST worked properly.
-AT_DATA(expout,
-[m4_for(AT_Count, 1, 100,
-[Big_Value
-])])
+AT_CLEANUP(configure config.status config.log config.cache config.h defs)
 
-AT_CLEANUP(dummy)
 
 
 
@@ -108,7 +93,7 @@
 # (ii) correctly passes them to `config.status', which we check by
 # running `config.status --recheck'.
 
-AT_SETUP(command line interface)
+AT_SETUP([command line interface])
 
 AT_DATA(configure.in,
 [[AC_INIT
@@ -212,3 +197,87 @@
 AT_CHECK([sed -e 's/ $//' defs], 0, expout)
 
 AT_CLEANUP(configure config.status config.log config.cache config.h defs)
+
+
+
+## ------------------------- ##
+## Torturing config.status.  ##
+## ------------------------- ##
+
+## Require 100 AC_DEFINE and AC_SUBST with a significantly big value.
+## This is mostly to check that Autoconf produces portable sed scripts
+## in config.status.  sed is used to skip the first two lines
+## `Generated by...'.
+
+dnl The value used as a big value for AC_DEFINE.
+dnl Don't use sh active chars here, below it is also used in a sh
+dnl assignment.
+define([Big_Value],
+[This value should be long enough to torture the various limits of sed and 
other tools used by Autoconf.])
+
+define([DEFINE_Description],
+[Define to a long string if your `Autoconf' works properly.])
+
+
+# AT_DUMMY_VAR(NUMBER)
+# --------------------
+# Build a name used for AC_SUBST and AC_DEFINE.  Put ac_ in it
+# so that the check for user name space invasion does not complain
+# of the new variables defined.
+#
+# Note that you should not use the name ac_dummy, because it will be
+# turned into ac_uummy during the construction of config.status.  Yes,
+# this is admittedly a bug, but it would be too hard to fix this.
+# There is really no point in AC_DEFINE a var named ac_d.*.
+define([AT_DUMMY_VAR],
+[ac_Dummy_[]m4_patsubst([000$1], [.*\(...\)$], [\1])])
+
+dnl This call was quite delicate to write because we didn't want to
+dnl produce the 100 commands by hand.  Be very careful if you want to
+dnl touch something.
+
+
+AT_SETUP([Torturing config.status])
+
+AT_DATA(dummy.in,
+[m4_for(AT_Count, 1, 100,
address@hidden(AT_Count)@
+])])
+
+AT_DATA(configure.in,
+[AC_INIT
+AC_CONFIG_HEADERS(config.h:config.hin)
+AC_CONFIG_FILES(dummy)
+[define]([AC_DEFUBST_VALUE], Big_Value)
+dnl The following 4 lines are a transfert from AT_DUMMY_VAR in Autotest
+dnl to AC_DUMMY_VAR in Autoconf.
+[define]([AC_DUMMY_VAR],
+changequote({{, }})dnl
+[defn({{AT_DUMMY_VAR}})]dnl
+changequote([, ]))
+m4_for(AT_Count, 1, 100,
+[AC_DEFUBST(AT_Count)
+])
+AC_OUTPUT
+])
+
+AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])
+AT_CHECK([../autoheader --autoconf-dir .. -l $at_srcdir], 0, [], [])
+AT_CHECK([./configure], 0, ignore)
+
+# Checking that AC_DEFINE worked properly.
+AT_DATA(expout,
+[m4_for(AT_Count, 1, 100,
+[
+/* DEFINE_Description */
+[#define] AT_DUMMY_VAR(AT_Count) "Big_Value"
+])])
+AT_CHECK([sed -n -e '3,$ p' config.h], 0, expout)
+
+# Checking that AC_SUBST worked properly.
+AT_DATA(expout,
+[m4_for(AT_Count, 1, 100,
+[Big_Value
+])])
+
+AT_CLEANUP(dummy)



reply via email to

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