]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autotest/general.m4 (AT_CAPTURE_FILE): New macro.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 1 Jan 2005 08:12:12 +0000 (08:12 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 1 Jan 2005 08:12:12 +0000 (08:12 +0000)
(AT_SETUP): Clear AT_capture_files.
(_AT_CHECK): On failure, log each of AT_capture_files.  Fix comment.
(AT_KEYWORDS): Fix comment typo.
* tests/autotest.at (AT_CHECK_AT): Use AT_CAPTURE_FILE.
* tests/local.at (AT_CHECK_CONFIGURE): Use AT_CAPTURE_FILE.
* doc/autoconf.texi (Writing testsuite.at): Document AT_CAPTURE_FILE.

ChangeLog
doc/autoconf.texi
lib/autotest/general.m4
tests/autotest.at
tests/local.at

index d2e3b95de5d51567af12c81f049b71dd03a3987f..39b9b23bc3a586764462d7b56ab65ee9ac82f3a6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-12-30  Noah Misch  <noah@cs.caltech.edu>
+
+       * lib/autotest/general.m4 (AT_CAPTURE_FILE): New macro.
+       (AT_SETUP): Clear AT_capture_files.
+       (_AT_CHECK): On failure, log each of AT_capture_files.  Fix comment.
+       (AT_KEYWORDS): Fix comment typo.
+       * tests/autotest.at (AT_CHECK_AT): Use AT_CAPTURE_FILE.
+       * tests/local.at (AT_CHECK_CONFIGURE): Use AT_CAPTURE_FILE.
+       * doc/autoconf.texi (Writing testsuite.at): Document AT_CAPTURE_FILE.
+
 2004-12-27  Noah Misch  <noah@cs.caltech.edu>
 
        * BUGS (Minor Problems): Warn about makefile limitations.
index 6bc7a295e404a2eb8e67005a5bb1a7320a8d29c5..4422e4610937fd1a1d2ce500f926a4518483ca27 100644 (file)
@@ -15460,6 +15460,12 @@ other words, don't fear registering several times the same keyword in a
 test group.
 @end defmac
 
+@defmac AT_CAPTURE_FILE (@var{file})
+@atindex{CAPTURE_FILE}
+If the current test group fails, log the contents of @var{file}.
+Several identical calls within one test group have no additional effect.
+@end defmac
+
 @defmac AT_XFAIL_IF (@var{shell-condition})
 @atindex{XFAIL_IF}
 Determine whether the test is expected to fail because it is a known
index 80fc0e21ec58f3f4df4054bc2f4f17732569a9f5..5b4551722fef1ec6e5e0fc02f4ce4b01a85ecee6 100644 (file)
@@ -1040,6 +1040,7 @@ m4_define([AT_TESTED],
 # The group is testing what DESCRIPTION says.
 m4_define([AT_SETUP],
 [m4_ifdef([AT_keywords], [m4_undefine([AT_keywords])])
+m4_ifdef([AT_capture_files], [m4_undefine([AT_capture_files])])
 m4_define([AT_line], AT_LINE)
 m4_define([AT_xfail], [at_xfail=no])
 m4_define([AT_description], [$1])
@@ -1071,13 +1072,21 @@ m4_case([$1],
       $1 && at_xfail=yes])])])
 
 
-# AT_KEYWORDS(KEYOWRDS)
+# AT_KEYWORDS(KEYWORDS)
 # ---------------------
 # Declare a list of keywords associated to the current test group.
 m4_define([AT_KEYWORDS],
 [m4_append_uniq([AT_keywords], [$1], [ ])])
 
 
+# AT_CAPTURE_FILE(FILE)
+# ---------------------
+# If the current test group does not behave as expected, save the contents of
+# FILE in the test suite log.
+m4_define([AT_CAPTURE_FILE],
+[m4_append_uniq([AT_capture_files], ["$1"], [ ])])
+
+
 # AT_CLEANUP
 # ----------
 # Complete a group of related tests.
@@ -1378,7 +1387,10 @@ m4_case([$2],
       at_failed=:;;])
 esac
 AS_IF($at_failed, [$5
+  m4_ifdef([AT_capture_files],
+    [for file in AT_capture_files
+     do echo "$file:"; sed 's/^/> /' "$file"; done])
   echo 1 > "$at_status_file"
   exit 1], [$6])
 $at_traceon
-])# AT_CHECK_NOESCAPE
+])# _AT_CHECK
index 47db3580e1d14e947e384b0433400b9c5997965f..4e4c52c89e811efb4d9a09fa00ff1262a78a2f3a 100644 (file)
@@ -30,6 +30,7 @@ m4_define([AT_CHECK_AT],
 [
 AT_SETUP([$1])
 AT_KEYWORDS([autotest])
+AT_CAPTURE_FILE([micro-suite.log])
 AT_XFAIL_IF([$3])
 
 AT_DATA([package.m4],[[
index 4834c7b2ba530d42d6d0c57ec65d6fb15c96e79e..674fe37070d14f69ba302ab2bc945aa1c81c3191 100644 (file)
@@ -258,11 +258,10 @@ m4_define([AT_CHECK_AUTOHEADER],
 # `abs_top_srcdir' is needed so that `./configure' finds install-sh.
 # Using --srcdir is more expensive.
 m4_define([AT_CHECK_CONFIGURE],
-[AT_CHECK([top_srcdir=$abs_top_srcdir ./configure $1],
+[AT_CAPTURE_FILE([config.log])[]dnl
+ AT_CHECK([top_srcdir=$abs_top_srcdir ./configure $1],
          [$2],
-         m4_default([$3], [ignore]), [$4],
-         [{ echo "$srcdir/AT_LINE: config.log"; sed 's/^/> /' config.log; } >>$at_group_log ])
-])
+         m4_default([$3], [ignore]), [$4])])
 
 
 # AT_CHECK_ENV