autoconf-patches
[Top][All Lists]
Advanced

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

53-at-banner.patch


From: Akim Demaille
Subject: 53-at-banner.patch
Date: Tue, 28 Nov 2000 09:04:58 +0100

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        
        Provide a means to display banners in the test suite.
        
        * tests/atgeneral.m4 (AT_INIT): Initialize AT_banner_ordinal.
        Execute the epilogue of the tests only if a test was run.
        Don't built the value of `at_tests_all' by a for loop: expand
        AT_TESTS_ALL.
        (AT_SETUP): Build AT_TESTS_ALL.
        (AT_BANNER): New.
        Adjust all the former banners to use it.
        (AT_CHECK): Don't trace the decoding of $?.
        
Index: m4sugar.m4
--- m4sugar.m4 Sun, 26 Nov 2000 18:04:11 +0100 akim (ace/b/27_libm4.m4 1.41 644)
+++ m4sugar.m4 Mon, 27 Nov 2000 21:27:32 +0100 akim (ace/b/27_libm4.m4 1.41 644)
@@ -1,7 +1,7 @@
 divert(-1)#                                                  -*- Autoconf -*-
 # This file is part of Autoconf.
-# Base m4 layer.
-# Requires GNU m4.
+# Base M4 layer.
+# Requires GNU M4.
 # Copyright 1999, 2000 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -57,7 +57,7 @@
 # equivalent functionality by core dumping because of the
 # long macros we define.
 ifdef([__gnu__], ,
-[errprint(Autoconf requires GNU m4. Install it before installing Autoconf or
+[errprint(M4sugar requires GNU M4. Install it before installing M4sugar or
 set the M4 environment variable to its path name.)
 m4exit(2)])
 
Index: tests/atgeneral.m4
--- tests/atgeneral.m4 Sun, 26 Nov 2000 18:04:11 +0100 akim 
(ace/b/19_atgeneral. 1.35 644)
+++ tests/atgeneral.m4 Mon, 27 Nov 2000 22:04:27 +0100 akim 
(ace/b/19_atgeneral. 1.35 644)
@@ -93,6 +93,7 @@ m4_define([AT_LINE],
 # should be already preset so the proper executable will be selected.
 m4_define([AT_INIT],
 [m4_define([AT_ordinal], 0)
+m4_define([AT_banner_ordinal], 0)
 m4_divert_push([DEFAULT])dnl
 #! /bin/sh
 
@@ -225,20 +226,25 @@ m4_define([AT_INIT],
 dnl Tests inserted here (TESTS).
 m4_divert([TAIL])[]dnl
   esac
-  at_test_count=`expr 1 + $at_test_count`
-  $at_verbose $at_n "     $at_test. $srcdir/`cat at-setup-line`: $at_c"
-  case $at_status in
-    0) echo ok
-       ;;
-    77) echo "ignored near \``cat at-check-line`'"
-        at_ignore_count=`expr $at_ignore_count + 1`
-        ;;
-    *) echo "FAILED near \``cat at-check-line`'"
-       at_failed_list="$at_failed_list $at_test"
-       $at_stop_on_error && break
-       ;;
+  case $at_test in
+    banner-*) ;;
+    *)
+      at_test_count=`expr 1 + $at_test_count`
+      $at_verbose $at_n "     $at_test. $srcdir/`cat at-setup-line`: $at_c"
+      case $at_status in
+        0) echo ok
+           ;;
+        77) echo "ignored near \``cat at-check-line`'"
+            at_ignore_count=`expr $at_ignore_count + 1`
+            ;;
+        *) echo "FAILED near \``cat at-check-line`'"
+           at_failed_list="$at_failed_list $at_test"
+           $at_stop_on_error && break
+           ;;
+      esac
+      $at_debug || rm -rf $at_data_files
+      ;;
   esac
-  $at_debug || rm -rf $at_data_files
 done
 
 # Wrap up the testing suite with summary statistics.
@@ -296,7 +302,7 @@ m4_define([AT_INIT],
 m4_divert_pop()dnl
 m4_wrap([m4_divert_text([DEFAULT],
                         [# List of the tests.
-at_tests_all="m4_for([i], 1, AT_ordinal, 1, [i ])"])])dnl
+at_tests_all="AT_TESTS_ALL "])])dnl
 ])# AT_INIT
 
 
@@ -307,11 +313,12 @@ m4_define([AT_INIT],
 # The group is testing what DESCRIPTION says.
 m4_define([AT_SETUP],
 [m4_define([AT_ordinal], m4_incr(AT_ordinal))
+m4_append([AT_TESTS_ALL], [ ]m4_defn([AT_ordinal]))
 m4_divert_text([HELP],
                [m4_format([ %3d: %-15s %s], AT_ordinal, AT_LINE, [$1])])
 m4_pushdef([AT_data_files], [stdout stderr ])
 m4_divert_push([TESTS])dnl
-  AT_ordinal )
+  AT_ordinal ) [#] AT_ordinal. AT_LINE: $1
 dnl Here will be inserted the definition of at_data_files.
 m4_divert([TEST])[]dnl
     rm -rf $at_data_files
@@ -371,6 +378,24 @@ m4_define([AT_CLEANUP],
 ])# AT_CLEANUP
 
 
+# AT_BANNER(TEXT)
+# ---------------
+# Output TEXT without any shell expansion.
+m4_define([AT_BANNER],
+[m4_define([AT_banner_ordinal], m4_incr(AT_banner_ordinal))
+m4_append([AT_TESTS_ALL], [ banner-]m4_defn([AT_banner_ordinal]))
+m4_divert_push([TESTS])dnl
+  banner-AT_banner_ordinal ) [#] Banner AT_banner_ordinal. AT_LINE
+    cat <<\_ATEOF
+
+$1
+
+_ATEOF
+    ;;
+m4_divert_pop()dnl
+])# AT_BANNER
+
+
 # AT_DATA(FILE, CONTENTS)
 # -----------------------
 # Initialize an input data FILE with given CONTENTS, which should end with
@@ -403,7 +428,8 @@ m4_define([AT_CHECK],
 $at_traceon
 $1
 m4_ifval([$2],
-[at_status=$?
+         [at_status=$?
+$at_traceoff
 if test $at_status != $2; then
   $at_verbose "Exit code was $at_status, expected $2" >&6
 dnl Maybe there was an important message to read before it died.
@@ -412,8 +438,8 @@ m4_define([AT_CHECK],
   test $at_status = 77 && exit 77
   exit 1
 fi
-])dnl
-$at_traceoff
+],
+         [$at_traceoff])dnl
 if $at_check_stds; then
 dnl Restore stdout to fd1 and stderr to fd2.
   exec 1>&5 2>&6
Index: tests/base.at
--- tests/base.at Sat, 18 Nov 2000 19:19:30 +0100 akim (ace/b/29_base.m4 1.14 
644)
+++ tests/base.at Mon, 27 Nov 2000 21:19:39 +0100 akim (ace/b/29_base.m4 1.14 
644)
@@ -1,10 +1,6 @@
 #                                                      -*- autoconf -*-
 
-cat <<EOF
-
-Autoconf base layer.
-
-EOF
+AT_BANNER([Autoconf base layer.])
 
 
 ## ------------------------------- ##
Index: tests/compile.at
--- tests/compile.at Sat, 18 Nov 2000 12:03:30 +0100 akim (ace/b/50_compile.at 
1.1 644)
+++ tests/compile.at Mon, 27 Nov 2000 21:19:51 +0100 akim (ace/b/50_compile.at 
1.1 644)
@@ -1,10 +1,6 @@
 #                                                      -*- autoconf -*-
 
-cat <<EOF
-
-Low level compiling/preprocessing macros.
-
-EOF
+AT_BANNER([Low level compiling/preprocessing macros.])
 
 # Since the macros which compile are required by most tests, check
 # them first.  But remember that looking for a compiler is even more
Index: tests/m4sh.at
--- tests/m4sh.at Sat, 18 Nov 2000 19:19:30 +0100 akim (ace/b/44_m4sh.at 1.6 
644)
+++ tests/m4sh.at Mon, 27 Nov 2000 21:18:40 +0100 akim (ace/b/44_m4sh.at 1.6 
644)
@@ -1,10 +1,6 @@
 #                                                      -*- Autoconf -*-
 
-cat <<EOF
-
-M4sh.
-
-EOF
+AT_BANNER([M4sh.])
 
 
 ## ----------------------------- ##
Index: tests/m4sugar.at
--- tests/m4sugar.at Sat, 18 Nov 2000 15:03:42 +0100 akim (ace/b/45_m4sugar.at 
1.5 644)
+++ tests/m4sugar.at Mon, 27 Nov 2000 21:18:29 +0100 akim (ace/b/45_m4sugar.at 
1.5 644)
@@ -1,10 +1,6 @@
 #                                                      -*- Autoconf -*-
 
-cat <<EOF
-
-M4sugar.
-
-EOF
+AT_BANNER([M4sugar.])
 
 ## -------------- ##
 ## m4_text_wrap.  ##
Index: tests/mktests.sh
--- tests/mktests.sh Sat, 11 Nov 2000 16:02:51 +0100 akim (ace/b/46_mktests.sh 
1.2 755)
+++ tests/mktests.sh Mon, 27 Nov 2000 21:19:16 +0100 akim (ace/b/46_mktests.sh 
1.2 755)
@@ -124,12 +124,7 @@
 sed 's/^ *//' >syntax.tat <<MK_EOF
 # Generated by mktests.sh, do not edit by hand.                -*- autoconf -*-
 
-cat <<\EOF
-
-Syntax of macros and completeness of header templates.
-
-EOF
-
+AT_BANNER([Syntax of macros and completeness of header templates.])
 
 MK_EOF
 
@@ -186,12 +181,7 @@
 sed 's/^ *//' >update.tat <<MK_EOF
 # Generated by mktests.sh, do not edit by hand.                -*- autoconf -*-
 
-cat <<EOF
-
-Checking that autoupdated configure.in are sane.
-
-EOF
-
+AT_BANNER([Checking that autoupdated configure.in are sane.])
 
 MK_EOF
 
Index: tests/suite.at
--- tests/suite.at Sun, 26 Nov 2000 18:04:11 +0100 akim (ace/b/20_suite.m4 1.16 
644)
+++ tests/suite.at Mon, 27 Nov 2000 21:20:15 +0100 akim (ace/b/20_suite.m4 1.16 
644)
@@ -8,10 +8,9 @@
 
 AT_INIT([autoconf])
 
-cat <<EOF
-Some tests might be ignored if you don't have the software which the
-macros are supposed to test (e.g., a Fortran compiler).
-EOF
+AT_BANNER(
+[Some tests might be ignored if you don't have the software which the
+macros are supposed to test (e.g., a Fortran compiler).])
 
 # Run the tests from the lowest level to the highest level, and from
 # the most selective to the easiest.
Index: tests/tools.at
--- tests/tools.at Sat, 18 Nov 2000 19:19:30 +0100 akim (ace/b/30_tools.m4 1.24 
644)
+++ tests/tools.at Mon, 27 Nov 2000 21:20:51 +0100 akim (ace/b/30_tools.m4 1.24 
644)
@@ -1,11 +1,6 @@
 #                                                      -*- autoconf -*-
 
-cat <<EOF
-
-Executables (autoheader, autoupdate...)
-
-EOF
-
+AT_BANNER([Executables (autoheader, autoupdate...).])
 
 ## -------------------------------------------------------- ##
 ## Check that the shell scripts are syntactically correct.  ##
Index: tests/torture.at
--- tests/torture.at Sat, 18 Nov 2000 19:19:30 +0100 akim (ace/b/26_torture.m4 
1.19 644)
+++ tests/torture.at Mon, 27 Nov 2000 21:23:29 +0100 akim (ace/b/26_torture.m4 
1.19 644)
@@ -1,23 +1,19 @@
 #                                                      -*- autoconf -*-
 
-cat <<\EOF
-
-Testing config.status.
+AT_BANNER([[Testing config.status.
 
 ## ---------------------------------------------------------------- ##
 ## This section of torture tests is trying to make Autoconf produce ##
 ## failing `configure' scripts, which must never happen.  If one of ##
 ## these tests ever fails, it is extremely important that you       ##
 ## report the failure to address@hidden                      ##
-## ---------------------------------------------------------------- ##
+## ---------------------------------------------------------------- ##]])
 
-EOF
 
 ## ---------------------------------------------- ##
 ## AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS.  ##
 ## ---------------------------------------------- ##
 
-
 AT_SETUP([AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS])
 
 AT_DATA(configure.in,
@@ -59,11 +55,12 @@
 
 
 
-## ------------------------------------------------------ ##
-## Check that config.status detects missing input files.  ##
-## ------------------------------------------------------ ##
+## ------------------- ##
+## Missing templates.  ##
+## ------------------- ##
 
-AT_SETUP([missing templates])
+# Check that config.status detects missing input files
+AT_SETUP([Missing templates])
 
 AT_DATA(configure.in,
 [[AC_INIT
@@ -83,17 +80,18 @@
 
 
 
-## ------------------------------------------------------ ##
-## Check that `configure' and `config.status' honor their ##
-## interface.                                             ##
-## ------------------------------------------------------ ##
+## ---------------------- ##
+## configure invocation.  ##
+## ---------------------- ##
 
+# Check that `configure' and `config.status' honor their interface.
+#
 # We run `./configure one=val1 --enable-two=val2 --with-three=val3'
 # and verify that (i) `configure' correctly receives the arguments and
 # (ii) correctly passes them to `config.status', which we check by
 # running `config.status --recheck'.
 
-AT_SETUP([command line interface])
+AT_SETUP([configure invocation])
 
 AT_DATA(configure.in,
 [[AC_INIT



reply via email to

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