* 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 $?.
+2000-11-29 Akim Demaille <akim@epita.fr>
+
+ 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 $?.
+
2000-11-29 Akim Demaille <akim@epita.fr>
* tests/atgeneral.m4 (AT_DEFINE, AT_UNDEFINE, AT_SHIFT)
# 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
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.
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
# 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
])# 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
$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.
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
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
# 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)])
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
# 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)])
# 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
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.
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
# 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
])# 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
$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.
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
# -*- autoconf -*-
-cat <<EOF
-
-Autoconf base layer.
-
-EOF
+AT_BANNER([Autoconf base layer.])
## ------------------------------- ##
# -*- 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
# -*- Autoconf -*-
-cat <<EOF
-
-M4sh.
-
-EOF
+AT_BANNER([M4sh.])
## ----------------------------- ##
# -*- Autoconf -*-
-cat <<EOF
-
-M4sugar.
-
-EOF
+AT_BANNER([M4sugar.])
## -------------- ##
## m4_text_wrap. ##
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
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
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.
# -*- autoconf -*-
-cat <<EOF
-
-Executables (autoheader, autoupdate...)
-
-EOF
-
+AT_BANNER([Executables (autoheader, autoupdate...).])
## -------------------------------------------------------- ##
## Check that the shell scripts are syntactically correct. ##
# -*- 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 bug-autoconf@gnu.org. ##
-## ---------------------------------------------------------------- ##
+## ---------------------------------------------------------------- ##]])
-EOF
## ---------------------------------------------- ##
## AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS. ##
## ---------------------------------------------- ##
-
AT_SETUP([AC_CONFIG_FILES, HEADERS, LINKS and COMMANDS])
AT_DATA(configure.in,
-## ------------------------------------------------------ ##
-## 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
-## ------------------------------------------------------ ##
-## 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