(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-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.
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
# 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])
$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.
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
[
AT_SETUP([$1])
AT_KEYWORDS([autotest])
+AT_CAPTURE_FILE([micro-suite.log])
AT_XFAIL_IF([$3])
AT_DATA([package.m4],[[
# `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