]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Ensure unnamed test group categories are separated from previous.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 2 Aug 2010 19:10:00 +0000 (21:10 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 2 Aug 2010 20:17:50 +0000 (22:17 +0200)
* doc/autoconf.texi (Writing Testsuites) <AT_BANNER>: Update
description.
* lib/autotest/general.m4 (AT_INIT) <at_fn_banner>: Set banner
to single space, not empty line, once printed.  For empty
banners, print a single empty line to separate them from a
previous test group category.
* tests/autotest.at (Banners): Insert another test group; adjust
tests accordingly.  Extend test to cover semantic change.
* NEWS: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
NEWS
doc/autoconf.texi
lib/autotest/general.m4
tests/autotest.at

index 34133cb3af93dd946a0966342efc5c595c1b60f6..9dbd2cc14598455fbd942c42d679081ffd7fad45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Ensure unnamed test group categories are separated from previous.
+       * doc/autoconf.texi (Writing Testsuites) <AT_BANNER>: Update
+       description.
+       * lib/autotest/general.m4 (AT_INIT) <at_fn_banner>: Set banner
+       to single space, not empty line, once printed.  For empty
+       banners, print a single empty line to separate them from a
+       previous test group category.
+       * tests/autotest.at (Banners): Insert another test group; adjust
+       tests accordingly.  Extend test to cover semantic change.
+       * NEWS: Update.
+
 2010-07-31  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Fix typos in perlpod docs.
diff --git a/NEWS b/NEWS
index b59716cae9c4a337421f9629cdfa2c3353e283f6..d7c74dfe2b9bf483e686def5b5d380ccc2aa0cec 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ GNU Autoconf NEWS - User visible changes.
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** AT_BANNER() with empty argument will cause visual separation from previous
+   test category.
+
 
 * Major changes in Autoconf 2.67 (2010-07-21) [stable]
   Released by Eric Blake, based on git versions 2.66.*.
index 7e804a7345a6409ab9d2e29fd889f1d5485eb3c6..df0e298d89f30ee87b1feec20f07a8f95c09dcbe 100644 (file)
@@ -23755,9 +23755,8 @@ When the resulting @file{testsuite} is invoked with more than one test
 group to run, its output will include a banner containing
 @var{test-category-name} prior to any tests run from that category.  The
 banner should be no more than about 40 or 50 characters.  A blank banner
-will not print, effectively ending a category and letting subsequent
-test groups behave as though they are uncategorized when run in
-isolation.
+indicates uncategorized tests; an empty line will be inserted after
+tests from an earlier category, effectively ending that category.
 @end defmac
 
 @defmac AT_SETUP (@var{test-group-name})
index ba576e3d4482bd00d42d85028d9f5231c1c4cf9d..170200c9a4e25ea4b274b7302f50a9edfc62235d 100644 (file)
@@ -233,7 +233,7 @@ case $at_groups in
       at_print_banners=: ;;
   * ) at_print_banners=false ;;
 esac
-# Text for banner N, set to empty once printed.
+# Text for banner N, set to a single space once printed.
 m4_divert_pop([BANNERS])dnl back to DEFAULTS
 m4_divert_push([PREPARE_TESTS])dnl
 
@@ -246,9 +246,13 @@ at_fn_banner ()
 {
   $at_print_banners || return 0
   eval at_banner_text=\$at_banner_text_$[1]
-  test "x$at_banner_text" = x && return 0
-  eval at_banner_text_$[1]=
-  AS_ECHO(["$as_nl$at_banner_text$as_nl"])
+  test "x$at_banner_text" = "x " && return 0
+  eval "at_banner_text_$[1]=\" \""
+  if test -z "$at_banner_text"; then
+    $at_first || echo
+  else
+    AS_ECHO(["$as_nl$at_banner_text$as_nl"])
+  fi
 } # at_fn_banner
 
 AS_FUNCTION_DESCRIBE([at_fn_check_prepare_notrace], [REASON LINE],
index fd3787a4e3f9accb1ed701cab9eb0d681c7727b5..c03c126d0d375cc8a52b0bec49f39e21149ae9dd 100644 (file)
@@ -956,15 +956,18 @@ AT_CHECK(:)
 AT_CLEANUP
 
 AT_BANNER()
-AT_SETUP(two)# 4
+AT_SETUP(two a)# 4
+AT_CHECK(:)
+AT_CLEANUP
+AT_SETUP(two b)# 5
 AT_CHECK(:)
 AT_CLEANUP
 
 AT_BANNER([second])
-AT_SETUP(three a)# 5
+AT_SETUP(three a)# 6
 AT_CHECK(:)
 AT_CLEANUP
-AT_SETUP(three b)# 6
+AT_SETUP(three b)# 7
 AT_CHECK(:)
 AT_CLEANUP
 ]])
@@ -983,8 +986,11 @@ 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], [0])
-AT_CHECK_BANNERS([3-5],                [first], [1], [second], [1])
-AT_CHECK_BANNERS([4-5],                [first], [0], [second], [1])
+dnl There should be an empty line separating the first category from the
+dnl unnamed one.
+AT_CHECK([sed -n '/one b/,/two a/p' stdout | grep '^$'], [0], [ignore])
+AT_CHECK_BANNERS([3-6],                [first], [1], [second], [1])
+AT_CHECK_BANNERS([4-6],                [first], [0], [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])