[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AT_BANNER handling
From: |
Eric Blake |
Subject: |
AT_BANNER handling |
Date: |
Thu, 18 Oct 2007 20:46:10 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Two patches. First, document AT_BANNER, and add a testcase (in part, to prove
my second patch didn't introduce regressions :) Second, alter the testsuite to
make each test call at_func_banner, which prints the appropriate banner on an
as-needed basis. This in turn simplifies the startup handling (one less awk
process when selecting a subset of tests), and removes the need for a case
statement inside the main loop. Not to mention reducing output, therefore
speeding up autom4te in creating the testsuite.
Best of three timing runs on cygwin.
Pre:
$ time (./testsuite 1 >/dev/null)
real 0m10.093s
user 0m11.499s
sys 0m4.313s
$ time (./testsuite -10 >/dev/null)
real 0m49.000s
user 0m57.398s
sys 0m21.902s
Post:
$ time (./testsuite 1 >/dev/null)
real 0m10.234s
user 0m11.644s
sys 0m4.309s
$ time (./testsuite -10 >/dev/null)
real 0m48.750s
user 0m57.216s
sys 0m21.166s
It seems like a slight slowdown for one test, and a slight speedup for a group
of tests, but the numbers are close to being in the noise. Size-wise, this
shaves another 43k off autoconf's testsuite; much of the second patch is just
indentation changes.
OK to apply both patches?
2007-10-18 Eric Blake <address@hidden>
Improve AT_BANNER handling.
* lib/autotest/general.m4 (BANNERS_START, BANNERS, BANNERS_END):
New named diversions.
(AT_INIT) <BANNERS_START>: Factor all banners into a shell
function, which prints only as needed.
<PARSE_ARGS_END>: No longer need awk to find banners.
<TESTS>: Banners are no longer processed by main driver loop, so
we no longer need case statement.
(AT_BANNER): Rewrite to populate new diversions.
(AT_SETUP): Each test invokes its own banner. No output is needed
to the TESTS diversion.
Document and test AT_BANNER.
* doc/autoconf.texi (Writing Testsuites): Document AT_BANNER.
* tests/autotest.at (AT_CHECK_EGREP): Share between tests.
(AT_CHECK_BANNERS): New test.
>From 7c19008285cb418173ae53deabdd463fe71e5980 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Thu, 18 Oct 2007 12:03:19 -0600
Subject: [PATCH] Document and test AT_BANNER.
* doc/autoconf.texi (Writing Testsuites): Document AT_BANNER.
* tests/autotest.at (AT_CHECK_EGREP): Share between tests.
(AT_CHECK_BANNERS): New test.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 5 +++
doc/autoconf.texi | 12 ++++++++-
tests/autotest.at | 71 ++++++++++++++++++++++++++++++++++++++++++++++++----
3 files changed, 81 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 483e6db..37d093d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2007-10-18 Eric Blake <address@hidden>
+ Document and test AT_BANNER.
+ * doc/autoconf.texi (Writing Testsuites): Document AT_BANNER.
+ * tests/autotest.at (AT_CHECK_EGREP): Share between tests.
+ (AT_CHECK_BANNERS): New test.
+
Fix AT_TESTED, AT_KEYWORDS.
* lib/m4sugar/m4sugar.m4 (m4_append_uniq): Warn if separator
occurs in string, as duplicates may be added.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 184f474..ede0018 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -19875,7 +19875,8 @@ for tests. Each such included file, or the remainder of
@file{testsuite.at} if include files are not used, contain a sequence of
test groups. Each test group begins with a call to @code{AT_SETUP},
then an arbitrary number of shell commands or calls to @code{AT_CHECK},
-and then completes with a call to @code{AT_CLEANUP}.
+and then completes with a call to @code{AT_CLEANUP}. Multiple test
+groups can be categorized by a call to @code{AT_BANNER}.
@defmac AT_INIT (@ovar{name})
@atindex{INIT}
@@ -19915,6 +19916,15 @@ diagnostics.
@sp 1
address@hidden AT_BANNER (@var{test-category-name})
address@hidden
+This macro identifies the start of a category of related test groups.
+When testsuite is invoked with more than one test group to run, the
+testsuite output will include a banner containing
address@hidden prior to any tests run from that category. The
+banner should be no more than about 40 or 50 characters.
address@hidden defmac
+
@defmac AT_SETUP (@var{test-group-name})
@atindex{SETUP}
This macro starts a group of related tests, all to be executed in the
diff --git a/tests/autotest.at b/tests/autotest.at
index e3a4662..867ea69 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -73,6 +73,17 @@ m4_pattern_allow([^AT_])
m4_define([AT_NO_CMDSUBST],
[if (eval 'foo=$(echo bar) && test "$foo" = bar') >/dev/null 2>&1; then false;
else :; fi])
+# AT_CHECK_EGREP(PATTERN, STATUS, COUNT)
+# --------------------------------------
+# Run grep -E, counting how many times PATTERN occurs in the file 'stdout',
+# and expecting exit STATUS and output COUNT.
+m4_define([AT_CHECK_EGREP],
+[AT_CHECK([$EGREP -c '$1' stdout], $2, [$3
+], ignore)
+])
+
+
+
## ------------------ ##
## Empty test suite. ##
@@ -370,6 +381,60 @@ AT_CHECK([(cd micro-suite.dir/1 && ./run MY_VAR='one
space')],
])
+## -------- ##
+## Banners. ##
+## -------- ##
+AT_SETUP([Banners])
+AT_KEYWORDS([autotest])
+
+AT_DATA([b.at],
+[[m4_define([AT_PACKAGE_STRING],[b])
+m4_define([AT_PACKAGE_BUGREPORT],[devnull])
+AT_INIT
+AT_SETUP(zero)# 1
+AT_CHECK(:)
+AT_CLEANUP
+
+AT_BANNER([first])
+AT_SETUP(one a)# 2
+AT_CHECK(:)
+AT_CLEANUP
+AT_SETUP(one b)# 3
+AT_CHECK(:)
+AT_CLEANUP
+
+AT_BANNER([second])
+AT_SETUP(two a)# 4
+AT_CHECK(:)
+AT_CLEANUP
+AT_SETUP(two b)# 5
+AT_CHECK(:)
+AT_CLEANUP
+]])
+AT_CHECK_AUTOM4TE([--language=autotest -o b b.at])
+
+# AT_CHECK_BANNERS(TESTSUITE-OPTIONS, PATTERN1, COUNT1, PATTERN2, COUNT2)
+m4_define([AT_CHECK_BANNERS],
+[AT_CHECK([./b $1], 0, [stdout])
+AT_CHECK_EGREP([$2], m4_if([$3], [0], [1], [0]), [$3])
+AT_CHECK_EGREP([$4], m4_if([$5], [0], [1], [0]), [$5])
+])
+
+AT_CHECK_BANNERS([], [first], [1], [second], [1])
+AT_CHECK_BANNERS([-k zero], [first], [0], [second], [0])
+AT_CHECK_BANNERS([1], [first], [0], [second], [0])
+AT_CHECK_BANNERS([-2], [first], [1], [second], [0])
+AT_CHECK_BANNERS([-3], [first], [1], [second], [0])
+AT_CHECK_BANNERS([-k one], [first], [1], [second], [0])
+AT_CHECK_BANNERS([3-4], [first], [1], [second], [1])
+AT_CHECK_BANNERS([3-], [first], [1], [second], [1])
+AT_CHECK_BANNERS([-k a], [first], [1], [second], [1])
+AT_CHECK_BANNERS([4], [first], [0], [second], [0])
+AT_CHECK_BANNERS([4-], [first], [0], [second], [1])
+AT_CHECK_BANNERS([-k two], [first], [0], [second], [1])
+AT_CLEANUP
+
+
## --------- ##
## Keywords. ##
## --------- ##
@@ -401,12 +466,6 @@ AT_CHECK_AUTOM4TE([--language=autotest -o k k.at])
dnl check that AT_KEYWORDS does not duplicate words
AT_CHECK([grep 'key1.*key1' k], [1])
-# AT_CHECK_EGREP(PATTERN, STATUS, COUNT)
-m4_define([AT_CHECK_EGREP],
-[AT_CHECK([$EGREP -c '$1' stdout], $2, [$3
-], ignore)
-])
-
# AT_CHECK_KEYS(TESTSUITE-OPTIONS, PATTERN1, COUNT1, PATTERN2, COUNT2)
m4_define([AT_CHECK_KEYS],
[AT_CHECK([./k $1], 0, [stdout])
--
1.5.3.2
>From e1b54553eed0c0386451e832a935bbda341c3c13 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Thu, 18 Oct 2007 14:00:05 -0600
Subject: [PATCH] Improve AT_BANNER handling.
* lib/autotest/general.m4 (BANNERS_START, BANNERS, BANNERS_END):
New named diversions.
(AT_INIT) <BANNERS_START>: Factor all banners into a shell
function, which prints only as needed.
<PARSE_ARGS_END>: No longer need awk to find banners.
<TESTS>: Banners are no longer processed by main driver loop, so
we no longer need case statement.
(AT_BANNER): Rewrite to populate new diversions.
(AT_SETUP): Each test invokes its own banner. No output is needed
to the TESTS diversion.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 12 ++
lib/autotest/general.m4 | 295 +++++++++++++++++++++++------------------------
2 files changed, 158 insertions(+), 149 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 37d093d..bb9d2ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
2007-10-18 Eric Blake <address@hidden>
+ Improve AT_BANNER handling.
+ * lib/autotest/general.m4 (BANNERS_START, BANNERS, BANNERS_END):
+ New named diversions.
+ (AT_INIT) <BANNERS_START>: Factor all banners into a shell
+ function, which prints only as needed.
+ <PARSE_ARGS_END>: No longer need awk to find banners.
+ <TESTS>: Banners are no longer processed by main driver loop, so
+ we no longer need case statement.
+ (AT_BANNER): Rewrite to populate new diversions.
+ (AT_SETUP): Each test invokes its own banner. No output is needed
+ to the TESTS diversion.
+
Document and test AT_BANNER.
* doc/autoconf.texi (Writing Testsuites): Document AT_BANNER.
* tests/autotest.at (AT_CHECK_EGREP): Share between tests.
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index 9335874..7f8eb4f 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -95,6 +95,14 @@
# - VERSION_END
# Tail of the handling of --version.
#
+# - BANNERS_START
+# Output shell initialization for handling banners.
+# - BANNERS
+# The core of the banner handler. Opens a function and case statement,
+# then contains the text for each banner.
+# - BANNERS_END
+# Wraps up the banners case statement and function.
+#
# - PREPARE_TESTS
# Like DEFAULTS but run after argument processing for purposes of
# optimization. Do anything else that needs to be done to prepare for
@@ -126,11 +134,14 @@ m4_define([_m4_divert(HELP_END)], 304)
m4_define([_m4_divert(VERSION)], 350)
m4_define([_m4_divert(VERSION_NOTICES)], 351)
m4_define([_m4_divert(VERSION_END)], 352)
-m4_define([_m4_divert(PREPARE_TESTS)], 400)
-m4_define([_m4_divert(TESTS)], 401)
-m4_define([_m4_divert(TESTS_END)], 402)
-m4_define([_m4_divert(TEST_SCRIPT)], 403)
-m4_define([_m4_divert(TEST_GROUPS)], 500)
+m4_define([_m4_divert(BANNERS_START)], 400)
+m4_define([_m4_divert(BANNERS)], 401)
+m4_define([_m4_divert(BANNERS_END)], 402)
+m4_define([_m4_divert(PREPARE_TESTS)], 500)
+m4_define([_m4_divert(TESTS)], 501)
+m4_define([_m4_divert(TESTS_END)], 502)
+m4_define([_m4_divert(TEST_SCRIPT)], 503)
+m4_define([_m4_divert(TEST_GROUPS)], 600)
# AT_LINE
@@ -205,11 +216,44 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# How were we run?
at_cli_args="address@hidden"
-m4_divert_push([PREPARE_TESTS])dnl
+m4_divert_push([BANNERS_START])dnl
+
+# Should we print banners?
+case $at_groups in
+ *' '*' '* | *"$as_nl"*"$as_nl"* )
+ at_print_banners=: ;;
+ * ) at_print_banners=false ;;
+esac
+# Have we printed banner N yet?
+m4_divert_pop([BANNERS_START])dnl back to DEFAULTS
+m4_divert_push([BANNERS])dnl
+
## --------------- ##
## Shell functions ##
## --------------- ##
+# at_func_banner NUMBER
+# ---------------------
+# Output banner NUMBER, provided the testsuite is running multiple groups
+# and this particular banner has not yet been printed.
+at_func_banner ()
+{
+ $at_print_banners || return 0
+ at_banner_text=
+ case $[1] in
+dnl banner case patterns inserted here (BANNERS)
+m4_divert_pop([BANNERS])dnl back to DEFAULTS
+m4_divert_push([BANNERS_END])dnl
+ * ) AS_ECHO(["$as_me: no such banner: $[1]"]) >&2
+ return 1 ;;
+ esac
+ eval \$at_banner_$[1]_printed && return 0
+ eval at_banner_$[1]_printed=:
+ AS_ECHO(["$as_nl$at_banner_text$as_nl"])
+} # at_func_banner
+m4_divert_pop([BANNERS_END])dnl back to DEFAULTS
+m4_divert_push([PREPARE_TESTS])dnl
+
# at_func_check_newline COMMAND
# -----------------------------
# Test if COMMAND includes a newline and, if so, print a message and return
@@ -556,31 +600,8 @@ done
if test -z "$at_groups"; then
at_groups=$at_groups_all
else
- # Sort the tests, removing duplicates:
+ # Sort the tests, removing duplicates.
at_groups=`AS_ECHO(["$at_groups"]) | tr ' ' "$as_nl" | sort -nu`
- # and add banners. (Passing at_groups_all is tricky--see the comment
- # starting with "Passing at_groups is tricky.")
- at_groups=`AS_ECHO(["$at_groups$as_nl $at_groups_all"]) |
- awk ['BEGIN { FS = "@" } # Effectively switch off field splitting.
- /^$/ { next } # Ignore the empty line.
- !/ / { groups++; selected[$ 0] = 1; next }
- # The last line, containing at_groups_all.
- {
- n = split($ 0, a, " ")
- # If there are several tests, select their banners:
- if (groups > 1) {
- for (i = 1; i <= n; i++) {
- if (a[i] ~ /^banner-/)
- banner = a[i]
- else if (banner != "" && selected[a[i]] == 1)
- selected[banner] = 1
- }
- }
- for (i = 1; i <= n; i++)
- if (selected[a[i]] == 1)
- list = list " " a[i]
- print list
- }']`
fi
m4_divert_pop([PARSE_ARGS_END])dnl
m4_divert_push([HELP])dnl
@@ -835,28 +856,20 @@ do
# Clearly separate the test groups when verbose.
test $at_group_count != 0 && $at_verbose echo
- case $at_group in
- banner-*)
- at_group_log=$at_suite_log
- ;;
+ at_group_normalized=$at_group
+ _AT_NORMALIZE_TEST_GROUP_NUMBER(at_group_normalized)
- *)
- at_group_normalized=$at_group
- _AT_NORMALIZE_TEST_GROUP_NUMBER(at_group_normalized)
-
- # Create a fresh directory for the next test group, and enter.
- at_group_dir=$at_suite_dir/$at_group_normalized
- at_group_log=$at_group_dir/$as_me.log
- if test -d "$at_group_dir"; then
- find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
- rm -fr "$at_group_dir" ||
- AS_WARN([test directory could not be cleaned.])
- fi
- # Be tolerant if the above `rm' was not able to remove the directory.
- AS_MKDIR_P([$at_group_dir])
- cd $at_group_dir
- ;;
- esac
+ # Create a fresh directory for the next test group, and enter.
+ at_group_dir=$at_suite_dir/$at_group_normalized
+ at_group_log=$at_group_dir/$as_me.log
+ if test -d "$at_group_dir"; then
+ find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
+ rm -fr "$at_group_dir" ||
+ AS_WARN([test directory could not be cleaned.])
+ fi
+ # Be tolerant if the above `rm' was not able to remove the directory.
+ AS_MKDIR_P([$at_group_dir])
+ cd $at_group_dir
echo 0 > "$at_status_file"
@@ -868,98 +881,89 @@ do
at_tee_pipe='cat >> "$at_group_log"'
fi
- case $at_group in
-dnl Test groups inserted here (TESTS).
+ if at_func_test $at_group && . "$at_test_source"; then :; else
+ AS_ECHO(["$as_me: unable to parse test group: $at_group"]) >&2
+ at_failed=:
+ fi
m4_divert_pop([TESTS])[]dnl
m4_divert_push([TESTS_END])[]dnl
- * )
- AS_ECHO(["$as_me: no such test group: $at_group"]) >&2
- continue
- ;;
- esac
-
# Be sure to come back to the suite directory, in particular
# since below we might `rm' the group directory we are in currently.
cd "$at_suite_dir"
- case $at_group in
- banner-*) ;;
- *)
- if test ! -f "$at_check_line_file"; then
- sed "s/^ */$as_me: warning: /" <<_ATEOF
+ if test ! -f "$at_check_line_file"; then
+ sed "s/^ */$as_me: warning: /" <<_ATEOF
A failure happened in a test group before any test could be
run. This means that test suite is improperly designed. Please
report this failure to <AT_PACKAGE_BUGREPORT>.
_ATEOF
- AS_ECHO(["$at_setup_line"]) >"$at_check_line_file"
+ AS_ECHO(["$at_setup_line"]) >"$at_check_line_file"
+ fi
+ at_group_count=`expr 1 + $at_group_count`
+ $at_verbose AS_ECHO_N(["$at_group. $at_setup_line: "])
+ AS_ECHO_N(["$at_group. $at_setup_line: "]) >> "$at_group_log"
+ case $at_xfail:$at_status in
+ yes:0)
+ at_msg="UNEXPECTED PASS"
+ at_xpass_list="$at_xpass_list $at_group"
+ at_errexit=$at_errexit_p
+ ;;
+ no:0)
+ at_msg="ok"
+ at_pass_list="$at_pass_list $at_group"
+ at_errexit=false
+ ;;
+ *:77)
+ at_msg='skipped ('`cat "$at_check_line_file"`')'
+ at_skip_list="$at_skip_list $at_group"
+ at_errexit=false
+ ;;
+ yes:*)
+ at_msg='expected failure ('`cat "$at_check_line_file"`')'
+ at_xfail_list="$at_xfail_list $at_group"
+ at_errexit=false
+ ;;
+ no:*)
+ at_msg='FAILED ('`cat "$at_check_line_file"`')'
+ at_fail_list="$at_fail_list $at_group"
+ at_errexit=$at_errexit_p
+ ;;
+ esac
+ # Make sure there is a separator even with long titles.
+ AS_ECHO([" $at_msg"])
+ at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
+ case $at_status in
+ 0|77)
+ # $at_times_file is only available if the group succeeded.
+ # We're not including the group log, so the success message
+ # is written in the global log separately. But we also
+ # write to the group log in case they're using -d.
+ if test -f "$at_times_file"; then
+ at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')'
+ rm -f "$at_times_file"
+ fi
+ AS_ECHO(["$at_log_msg"]) >> "$at_group_log"
+ AS_ECHO(["$at_log_msg"]) >&AS_MESSAGE_LOG_FD
+
+ # Cleanup the group directory, unless the user wants the files.
+ if $at_debug_p ; then
+ at_func_create_debugging_script
+ elif test -d "$at_group_dir"; then
+ find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
+ rm -fr "$at_group_dir"
fi
- at_group_count=`expr 1 + $at_group_count`
- $at_verbose AS_ECHO_N(["$at_group. $at_setup_line: "])
- AS_ECHO_N(["$at_group. $at_setup_line: "]) >> "$at_group_log"
- case $at_xfail:$at_status in
- yes:0)
- at_msg="UNEXPECTED PASS"
- at_xpass_list="$at_xpass_list $at_group"
- at_errexit=$at_errexit_p
- ;;
- no:0)
- at_msg="ok"
- at_pass_list="$at_pass_list $at_group"
- at_errexit=false
- ;;
- *:77)
- at_msg='skipped ('`cat "$at_check_line_file"`')'
- at_skip_list="$at_skip_list $at_group"
- at_errexit=false
- ;;
- yes:*)
- at_msg='expected failure ('`cat "$at_check_line_file"`')'
- at_xfail_list="$at_xfail_list $at_group"
- at_errexit=false
- ;;
- no:*)
- at_msg='FAILED ('`cat "$at_check_line_file"`')'
- at_fail_list="$at_fail_list $at_group"
- at_errexit=$at_errexit_p
- ;;
- esac
- # Make sure there is a separator even with long titles.
- AS_ECHO([" $at_msg"])
- at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
- case $at_status in
- 0|77)
- # $at_times_file is only available if the group succeeded.
- # We're not including the group log, so the success message
- # is written in the global log separately. But we also
- # write to the group log in case they're using -d.
- if test -f "$at_times_file"; then
- at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')'
- rm -f "$at_times_file"
- fi
- AS_ECHO(["$at_log_msg"]) >> "$at_group_log"
- AS_ECHO(["$at_log_msg"]) >&AS_MESSAGE_LOG_FD
-
- # Cleanup the group directory, unless the user wants the files.
- if $at_debug_p ; then
- at_func_create_debugging_script
- elif test -d "$at_group_dir"; then
- find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
- rm -fr "$at_group_dir"
- fi
- ;;
- *)
- # Upon failure, include the log into the testsuite's global
- # log. The failure message is written in the group log. It
- # is later included in the global log.
- AS_ECHO(["$at_log_msg"]) >> "$at_group_log"
-
- # Upon failure, keep the group directory for autopsy, and
- # create the debugging script.
- at_func_create_debugging_script
- $at_errexit && break
- ;;
- esac
+ ;;
+ *)
+ # Upon failure, include the log into the testsuite's global
+ # log. The failure message is written in the group log. It
+ # is later included in the global log.
+ AS_ECHO(["$at_log_msg"]) >> "$at_group_log"
+
+ # Upon failure, keep the group directory for autopsy, and
+ # create the debugging script.
+ at_func_create_debugging_script
+ $at_errexit && break
;;
esac
done
@@ -1310,6 +1314,8 @@ m4_divert_push([TEST_GROUPS])dnl
[#AT_START_]AT_ordinal
@%:@ AT_ordinal. m4_defn([AT_line]): m4_defn([AT_description])
at_setup_line='m4_defn([AT_line])'
+m4_if(AT_banner_ordinal, [0], [], [at_func_banner AT_banner_ordinal
+])dnl
at_desc="AS_ESCAPE(m4_dquote(m4_defn([AT_description])))"
$at_quiet AS_ECHO_N([m4_format(["%3d: $at_desc%*s"], AT_ordinal,
m4_max(0, m4_eval(47 - m4_qlen(m4_defn([AT_description])))), [])])
@@ -1371,31 +1377,22 @@ m4_undivert([TEST_SCRIPT])dnl Insert the code here
at_status=`cat "$at_status_file"`
[#AT_STOP_]AT_ordinal
m4_divert_pop([TEST_GROUPS])dnl Back to KILL.
-m4_divert_text([TESTS],
-[ AT_ordinal )
- if at_func_test AT_ordinal && . "$at_test_source"; then :; else
- AS_ECHO(["$as_me: unable to parse test group: $[1]"]) >&2
- at_failed=:
- fi ;;])
])# AT_CLEANUP
# AT_BANNER(TEXT)
# ---------------
-# Output TEXT without any shell expansion.
+# Start a category of related test groups. If multiple groups are executed,
+# output TEXT as a banner without any shell expansion, prior to any test
+# from the category.
m4_define([AT_BANNER],
[m4_define([AT_banner_ordinal], m4_incr(AT_banner_ordinal))
-m4_append([AT_groups_all], [ banner-]m4_defn([AT_banner_ordinal]))
-m4_divert_text([TESTS],
-[
- banner-AT_banner_ordinal ) @%:@ Banner AT_banner_ordinal. AT_LINE
- cat <<\_ATEOF
-
-$1
-
-_ATEOF
- ;;
-])dnl
+m4_divert_text([BANNERS_START],
+[at_banner_]AT_banner_ordinal[_printed=false])
+m4_divert_text([BANNERS],
+[ AT_banner_ordinal ) @%:@ Banner AT_banner_ordinal. AT_LINE
+ @%:@ Category starts at test group m4_incr(AT_ordinal).
+ at_banner_text="AS_ESCAPE([$1])" ;;])dnl
])# AT_BANNER
--
1.5.3.2
- AT_BANNER handling,
Eric Blake <=
- Re: AT_BANNER handling, Ralf Wildenhues, 2007/10/19
- Re: AT_BANNER handling, Eric Blake, 2007/10/19
- Re: AT_BANNER handling, Ralf Wildenhues, 2007/10/19
- Re: AT_BANNER handling, Eric Blake, 2007/10/19
- Re: AT_BANNER handling, Eric Blake, 2007/10/21
- Re: AT_BANNER handling, Ralf Wildenhues, 2007/10/21
- Re: AT_BANNER handling, Eric Blake, 2007/10/21