* tests/base.at, tests/compile.at, tests/foreign.at,
* tests/m4sh.at, tests/m4sugar.at, tests/mktests.sh,
* tests/semantics.at, tests/suite.at, tests/tools.at,
* tests/torture.at: Ask Autotest mode, not Autoconf mode.
2001-08-20 22:44:38 +08:00
|
|
|
# -*- Autotest -*-
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
|
2000-11-29 18:12:05 +08:00
|
|
|
AT_BANNER([M4sugar.])
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
|
2006-02-21 05:43:05 +08:00
|
|
|
# Copyright (C) 2000, 2001, 2002, 2005, 2006 Free Software Foundation, Inc.
|
* AUTHORS, BUGS, ChangeLog, ChangeLog.0, ChangeLog.1,
ChangeLog.2, GNUmakefile, Makefile.maint, NEWS, README,
README-alpha, TODO, configure.ac, lib/autoconf/Makefile.am,
m4/atconfig.m4, m4/init.m4, m4/m4.m4, m4/missing.m4,
m4/sanity.m4, tests/README, tests/aclocal.m4,
tests/atspecific.m4, tests/base.at, tests/compile.at,
tests/foreign.at, tests/m4sh.at, tests/m4sugar.at,
tests/semantics.at, tests/suite.at, tests/tools.at,
tests/torture.at: Add copyright notice.
* tests/mktests.sh: Update year in copyright notice.
2001-08-12 21:05:11 +08:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
2005-05-14 15:00:38 +08:00
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
# 02110-1301, USA.
|
* AUTHORS, BUGS, ChangeLog, ChangeLog.0, ChangeLog.1,
ChangeLog.2, GNUmakefile, Makefile.maint, NEWS, README,
README-alpha, TODO, configure.ac, lib/autoconf/Makefile.am,
m4/atconfig.m4, m4/init.m4, m4/m4.m4, m4/missing.m4,
m4/sanity.m4, tests/README, tests/aclocal.m4,
tests/atspecific.m4, tests/base.at, tests/compile.at,
tests/foreign.at, tests/m4sh.at, tests/m4sugar.at,
tests/semantics.at, tests/suite.at, tests/tools.at,
tests/torture.at: Add copyright notice.
* tests/mktests.sh: Update year in copyright notice.
2001-08-12 21:05:11 +08:00
|
|
|
|
2001-01-17 23:26:42 +08:00
|
|
|
|
2006-02-21 05:43:05 +08:00
|
|
|
# AT_CHECK_M4SUGAR_TEXT(CODE, STDOUT, STDERR)
|
|
|
|
# -------------------------------------------
|
2005-02-05 12:55:08 +08:00
|
|
|
# Check that m4sugar CODE expands to STDOUT and emits STDERR.
|
|
|
|
m4_define([AT_CHECK_M4SUGAR_TEXT],
|
|
|
|
[
|
|
|
|
AT_DATA_M4SUGAR([script.4s],
|
|
|
|
[[m4_init
|
|
|
|
m4_divert_push(0)[]dnl
|
|
|
|
]$1[[]dnl
|
|
|
|
m4_divert_pop(0)
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_M4SUGAR([-o-],, [$2], [$3])
|
|
|
|
])# AT_CHECK_M4SUGAR_TEXT
|
|
|
|
|
|
|
|
|
2001-01-17 23:26:42 +08:00
|
|
|
# Order of the tests:
|
|
|
|
# - m4_warn
|
|
|
|
#
|
|
|
|
# - m4_require
|
|
|
|
# uses warn/error code.
|
|
|
|
#
|
|
|
|
# - m4_text_wrap
|
|
|
|
|
|
|
|
## --------- ##
|
|
|
|
## m4_warn. ##
|
|
|
|
## --------- ##
|
|
|
|
|
2005-02-05 12:55:08 +08:00
|
|
|
AT_SETUP([m4@&t@_warn])
|
2001-01-17 23:26:42 +08:00
|
|
|
|
|
|
|
# m4_text_wrap is used to display the help strings. Also, check that
|
|
|
|
# commas are not swallowed. This can easily happen because of
|
|
|
|
# m4-listification.
|
|
|
|
|
2001-08-15 15:49:59 +08:00
|
|
|
# FIXME: For the time being we use -f to make sure we do issue the
|
|
|
|
# warnings. But maybe autom4te should handle that by itself?
|
|
|
|
|
2001-10-08 16:21:54 +08:00
|
|
|
AT_DATA_M4SUGAR([script.4s],
|
2003-08-22 21:38:33 +08:00
|
|
|
[[m4_init
|
|
|
|
m4_defun([cross_warning],
|
2003-08-27 23:14:03 +08:00
|
|
|
[m4_warn([cross], [cross])])
|
2003-08-22 21:38:33 +08:00
|
|
|
|
2003-08-27 23:14:03 +08:00
|
|
|
m4_divert_push([0])m4_wrap([m4_divert_pop([0])[]])dnl
|
|
|
|
m4_warn([obsolete], [obsolete])dnl
|
|
|
|
cross_warning[]dnl
|
|
|
|
m4_warn([syntax], [syntax])dnl
|
2001-01-17 23:26:42 +08:00
|
|
|
]])
|
|
|
|
|
The use of `dumpstat' revealed that `len' was used although it
should not. m4_text_wrap was using it, but in the Autoconf world
where it is legal. Hence (i) test M4sh in its own world, not
Autoconf's, and (ii), ahem, fix the bug :)
* lib/autotest/general.m4: Be sure the set good quotes, as tracing
does not like `' instead of [].
(AT_INIT): Forbid `^_?AT_'.
And don't output such tokens.
* tests/Makefile.am (CLEANFILES): Add `script', `script.s4g',
`script.as', and `autom4te.cache'.
Remove `empty' and `macro' which are no longer used.
* tests/atspecific.m4 (AT_CHECK_M4SUGAR, AT_CHECK_M4SH): New.
* tests/m4sugar.at: Use it.
* lib/m4sugar/m4sugar.m4: Use `m4_len' not `len'.
2001-08-07 15:56:40 +08:00
|
|
|
AT_CHECK_M4SUGAR([-o-], 0, [],
|
2003-08-22 21:38:33 +08:00
|
|
|
[script.4s:8: warning: syntax
|
2001-01-17 23:26:42 +08:00
|
|
|
])
|
|
|
|
|
2001-08-15 15:49:59 +08:00
|
|
|
AT_CHECK_M4SUGAR([-o- -Wall -f], 0, [],
|
2003-08-22 21:38:33 +08:00
|
|
|
[script.4s:6: warning: obsolete
|
|
|
|
script.4s:7: warning: cross
|
2003-08-27 23:14:03 +08:00
|
|
|
script.4s:3: cross_warning is expanded from...
|
2003-08-22 21:38:33 +08:00
|
|
|
script.4s:7: the top level
|
|
|
|
script.4s:8: warning: syntax
|
2001-01-17 23:26:42 +08:00
|
|
|
])
|
|
|
|
|
First stab at preserving warnings between calls to autom4te,
including when the cache is used.
There are still several issues: (i) there are too many runs of m4
(one for include, one for warnings, and some more), (ii) warnings
spreading on several lines are not handled gracefully, (iii) the
code meant to have the call stack display for errors does not work
(its handling should move from m4 to autom4te).
* bin/autom4te.in Autom4te::Channels, Autom4te::ChannelDefs):
Use them.
(@preselect): Add m4_warn.
($exit_status): Remove, use $exit_code.
($help): Use Autom4te::ChannelDefs::usage.
(&handle_m4): No longer define the m4_warnings.
At each run, extract and report the warnings.
Always cache the result, including if the exit status is on
failure, since if nothing changes, we should result in the same
failure, hence we can use the cache.
* lib/m4sugar/m4sugar.m4 (m4_warning_ifelse, _m4_warning_ifelse)
(_m4_warning_error_ifelse, __m4_warning_error_ifelse, _m4_warn):
Remove.
(m4_warn): Redefine as a do-nothing: it is its invocation that
matters, as warnings are now reported via traces.
* lib/autoconf/general.m4 (AC_DIAGNOSE): Don't make it a copy of
the contents of m4_warn: make it _call_ m4_warn, so that tracing
the latter reveals calls to the former.
Adjust the tests.
* tests/m4sugar.at (m4@&t@_warn): Use existing warning categories.
2003-08-22 01:25:28 +08:00
|
|
|
AT_CHECK_M4SUGAR([-o- -Wnone,cross -f], 0, [],
|
2003-08-22 21:38:33 +08:00
|
|
|
[script.4s:7: warning: cross
|
2003-08-27 23:14:03 +08:00
|
|
|
script.4s:3: cross_warning is expanded from...
|
2003-08-22 21:38:33 +08:00
|
|
|
script.4s:7: the top level
|
2001-01-17 23:26:42 +08:00
|
|
|
])
|
|
|
|
|
First stab at preserving warnings between calls to autom4te,
including when the cache is used.
There are still several issues: (i) there are too many runs of m4
(one for include, one for warnings, and some more), (ii) warnings
spreading on several lines are not handled gracefully, (iii) the
code meant to have the call stack display for errors does not work
(its handling should move from m4 to autom4te).
* bin/autom4te.in Autom4te::Channels, Autom4te::ChannelDefs):
Use them.
(@preselect): Add m4_warn.
($exit_status): Remove, use $exit_code.
($help): Use Autom4te::ChannelDefs::usage.
(&handle_m4): No longer define the m4_warnings.
At each run, extract and report the warnings.
Always cache the result, including if the exit status is on
failure, since if nothing changes, we should result in the same
failure, hence we can use the cache.
* lib/m4sugar/m4sugar.m4 (m4_warning_ifelse, _m4_warning_ifelse)
(_m4_warning_error_ifelse, __m4_warning_error_ifelse, _m4_warn):
Remove.
(m4_warn): Redefine as a do-nothing: it is its invocation that
matters, as warnings are now reported via traces.
* lib/autoconf/general.m4 (AC_DIAGNOSE): Don't make it a copy of
the contents of m4_warn: make it _call_ m4_warn, so that tracing
the latter reveals calls to the former.
Adjust the tests.
* tests/m4sugar.at (m4@&t@_warn): Use existing warning categories.
2003-08-22 01:25:28 +08:00
|
|
|
AT_CHECK_M4SUGAR([-o- -Wnone,cross,error -f], 1, [],
|
2003-08-22 21:38:33 +08:00
|
|
|
[[script.4s:7: warning: cross
|
2003-08-27 23:14:03 +08:00
|
|
|
script.4s:3: cross_warning is expanded from...
|
2003-08-22 21:38:33 +08:00
|
|
|
script.4s:7: the top level
|
2002-08-29 16:03:10 +08:00
|
|
|
]])
|
2001-01-17 23:26:42 +08:00
|
|
|
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
|
|
|
## ----------------------------------- ##
|
|
|
|
## m4_require: circular dependencies. ##
|
|
|
|
## ----------------------------------- ##
|
|
|
|
|
2005-02-05 12:55:08 +08:00
|
|
|
AT_SETUP([m4@&t@_require: circular dependencies])
|
2001-01-17 23:26:42 +08:00
|
|
|
|
|
|
|
# m4_text_wrap is used to display the help strings. Also, check that
|
|
|
|
# commas are not swallowed. This can easily happen because of
|
|
|
|
# m4-listification.
|
|
|
|
|
2001-10-08 16:21:54 +08:00
|
|
|
AT_DATA_M4SUGAR([script.4s],
|
2001-01-17 23:26:42 +08:00
|
|
|
[[m4_defun([foo],
|
|
|
|
[m4_require([bar])])
|
|
|
|
|
|
|
|
m4_defun([bar],
|
|
|
|
[m4_require([foo])])
|
|
|
|
|
|
|
|
m4_defun([baz],
|
|
|
|
[m4_require([foo])])
|
|
|
|
|
2001-01-18 17:16:08 +08:00
|
|
|
m4_init
|
2003-08-27 23:14:03 +08:00
|
|
|
m4_divert_push([0])m4_wrap([m4_divert_pop([0])[]])dnl
|
2001-01-17 23:26:42 +08:00
|
|
|
baz
|
|
|
|
]])
|
|
|
|
|
2002-10-18 23:20:46 +08:00
|
|
|
AT_CHECK_M4SUGAR([], 1, [],
|
2003-08-27 23:14:03 +08:00
|
|
|
[[script.4s:12: error: m4@&t@_require: circular dependency of foo
|
2001-10-08 16:21:54 +08:00
|
|
|
script.4s:5: bar is expanded from...
|
|
|
|
script.4s:2: foo is expanded from...
|
|
|
|
script.4s:8: baz is expanded from...
|
2003-08-27 23:14:03 +08:00
|
|
|
script.4s:12: the top level
|
2002-08-29 16:03:10 +08:00
|
|
|
autom4te: m4 failed with exit status: 1
|
2001-01-17 23:26:42 +08:00
|
|
|
]])
|
|
|
|
AT_CLEANUP
|
|
|
|
|
|
|
|
|
* m4sugar.m4 (m4_rename_m4, m4_copy_unm4): New macros.
Use them.
(debugfile, debugmode, m4exit, m4wrap, maketemp, patsubst, regexp)
(substr, translit, m4_wrap): Rename as...
(m4_debugfile, m4_debugmode, m4_exit, m4_wrap, m4_maketemp)
(m4_patsubst, m4_regexp, m4_substr, m4_translit, m4_text_wrap): these.
Adjust all dependencies.
* acgeneral.m4: Adjust.
* tests/m4sugar.at: Adjust.
* autoconf.m4 (m4exit, patsubst, regexp, substr, translit):
Reestablish them.
2000-11-03 16:53:26 +08:00
|
|
|
## -------------- ##
|
|
|
|
## m4_text_wrap. ##
|
|
|
|
## -------------- ##
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
|
2005-02-05 12:55:08 +08:00
|
|
|
AT_SETUP([m4@&t@_text_wrap])
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
|
* m4sugar.m4 (m4_rename_m4, m4_copy_unm4): New macros.
Use them.
(debugfile, debugmode, m4exit, m4wrap, maketemp, patsubst, regexp)
(substr, translit, m4_wrap): Rename as...
(m4_debugfile, m4_debugmode, m4_exit, m4_wrap, m4_maketemp)
(m4_patsubst, m4_regexp, m4_substr, m4_translit, m4_text_wrap): these.
Adjust all dependencies.
* acgeneral.m4: Adjust.
* tests/m4sugar.at: Adjust.
* autoconf.m4 (m4exit, patsubst, regexp, substr, translit):
Reestablish them.
2000-11-03 16:53:26 +08:00
|
|
|
# m4_text_wrap is used to display the help strings. Also, check that
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
# commas are not swallowed. This can easily happen because of
|
|
|
|
# m4-listification.
|
|
|
|
|
2001-10-08 16:21:54 +08:00
|
|
|
AT_DATA_M4SUGAR([script.4s],
|
|
|
|
[[m4_divert_push([0])m4_wrap([m4_divert_pop([0])])dnl
|
* m4sugar.m4 (m4_rename_m4, m4_copy_unm4): New macros.
Use them.
(debugfile, debugmode, m4exit, m4wrap, maketemp, patsubst, regexp)
(substr, translit, m4_wrap): Rename as...
(m4_debugfile, m4_debugmode, m4_exit, m4_wrap, m4_maketemp)
(m4_patsubst, m4_regexp, m4_substr, m4_translit, m4_text_wrap): these.
Adjust all dependencies.
* acgeneral.m4: Adjust.
* tests/m4sugar.at: Adjust.
* autoconf.m4 (m4exit, patsubst, regexp, substr, translit):
Reestablish them.
2000-11-03 16:53:26 +08:00
|
|
|
m4_text_wrap([Short string */], [ ], [/* ], 20)
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
|
* m4sugar.m4 (m4_rename_m4, m4_copy_unm4): New macros.
Use them.
(debugfile, debugmode, m4exit, m4wrap, maketemp, patsubst, regexp)
(substr, translit, m4_wrap): Rename as...
(m4_debugfile, m4_debugmode, m4_exit, m4_wrap, m4_maketemp)
(m4_patsubst, m4_regexp, m4_substr, m4_translit, m4_text_wrap): these.
Adjust all dependencies.
* acgeneral.m4: Adjust.
* tests/m4sugar.at: Adjust.
* autoconf.m4 (m4exit, patsubst, regexp, substr, translit):
Reestablish them.
2000-11-03 16:53:26 +08:00
|
|
|
m4_text_wrap([Much longer string */], [ ], [/* ], 20)
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
|
* m4sugar.m4 (m4_rename_m4, m4_copy_unm4): New macros.
Use them.
(debugfile, debugmode, m4exit, m4wrap, maketemp, patsubst, regexp)
(substr, translit, m4_wrap): Rename as...
(m4_debugfile, m4_debugmode, m4_exit, m4_wrap, m4_maketemp)
(m4_patsubst, m4_regexp, m4_substr, m4_translit, m4_text_wrap): these.
Adjust all dependencies.
* acgeneral.m4: Adjust.
* tests/m4sugar.at: Adjust.
* autoconf.m4 (m4exit, patsubst, regexp, substr, translit):
Reestablish them.
2000-11-03 16:53:26 +08:00
|
|
|
m4_text_wrap([Short doc.], [ ], [ --short ], 30)
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
|
* m4sugar.m4 (m4_rename_m4, m4_copy_unm4): New macros.
Use them.
(debugfile, debugmode, m4exit, m4wrap, maketemp, patsubst, regexp)
(substr, translit, m4_wrap): Rename as...
(m4_debugfile, m4_debugmode, m4_exit, m4_wrap, m4_maketemp)
(m4_patsubst, m4_regexp, m4_substr, m4_translit, m4_text_wrap): these.
Adjust all dependencies.
* acgeneral.m4: Adjust.
* tests/m4sugar.at: Adjust.
* autoconf.m4 (m4exit, patsubst, regexp, substr, translit):
Reestablish them.
2000-11-03 16:53:26 +08:00
|
|
|
m4_text_wrap([Short doc.], [ ], [ --too-wide], 30)
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
|
* m4sugar.m4 (m4_rename_m4, m4_copy_unm4): New macros.
Use them.
(debugfile, debugmode, m4exit, m4wrap, maketemp, patsubst, regexp)
(substr, translit, m4_wrap): Rename as...
(m4_debugfile, m4_debugmode, m4_exit, m4_wrap, m4_maketemp)
(m4_patsubst, m4_regexp, m4_substr, m4_translit, m4_text_wrap): these.
Adjust all dependencies.
* acgeneral.m4: Adjust.
* tests/m4sugar.at: Adjust.
* autoconf.m4 (m4exit, patsubst, regexp, substr, translit):
Reestablish them.
2000-11-03 16:53:26 +08:00
|
|
|
m4_text_wrap([Super long documentation.], [ ], [ --too-wide], 30)
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
|
* m4sugar.m4 (m4_rename_m4, m4_copy_unm4): New macros.
Use them.
(debugfile, debugmode, m4exit, m4wrap, maketemp, patsubst, regexp)
(substr, translit, m4_wrap): Rename as...
(m4_debugfile, m4_debugmode, m4_exit, m4_wrap, m4_maketemp)
(m4_patsubst, m4_regexp, m4_substr, m4_translit, m4_text_wrap): these.
Adjust all dependencies.
* acgeneral.m4: Adjust.
* tests/m4sugar.at: Adjust.
* autoconf.m4 (m4exit, patsubst, regexp, substr, translit):
Reestablish them.
2000-11-03 16:53:26 +08:00
|
|
|
m4_text_wrap([First, second , third, [,quoted]])
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
]])
|
|
|
|
|
2001-08-20 22:45:09 +08:00
|
|
|
AT_DATA([expout],
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
[[/* Short string */
|
|
|
|
|
|
|
|
/* Much longer
|
|
|
|
string */
|
|
|
|
|
|
|
|
--short Short doc.
|
|
|
|
|
|
|
|
--too-wide
|
|
|
|
Short doc.
|
|
|
|
|
|
|
|
--too-wide
|
|
|
|
Super long
|
|
|
|
documentation.
|
|
|
|
|
|
|
|
First, second , third, [,quoted]
|
|
|
|
]])
|
|
|
|
|
The use of `dumpstat' revealed that `len' was used although it
should not. m4_text_wrap was using it, but in the Autoconf world
where it is legal. Hence (i) test M4sh in its own world, not
Autoconf's, and (ii), ahem, fix the bug :)
* lib/autotest/general.m4: Be sure the set good quotes, as tracing
does not like `' instead of [].
(AT_INIT): Forbid `^_?AT_'.
And don't output such tokens.
* tests/Makefile.am (CLEANFILES): Add `script', `script.s4g',
`script.as', and `autom4te.cache'.
Remove `empty' and `macro' which are no longer used.
* tests/atspecific.m4 (AT_CHECK_M4SUGAR, AT_CHECK_M4SH): New.
* tests/m4sugar.at: Use it.
* lib/m4sugar/m4sugar.m4: Use `m4_len' not `len'.
2001-08-07 15:56:40 +08:00
|
|
|
AT_CHECK_M4SUGAR([-o-], 0, [expout])
|
Move the Autoconf independent shell macros into the file
`shell.m4' and the name space `AS_*'.
* acgeneral.m4 (AC_SHELL_IFELSE, _AC_SHELL_TMPDIR, AC_SHELL_UNSET)
(AC_SHELL_MKDIR_P, AC_SHELL_DIRNAME): Rename and move to...
* shell.m4 (AS_IFELSE, AS_TMPDIR, AS_UNSET, AS_MKDIR_P)
(AS_DIRNAME): here, a new file.
Adjust all dependencies.
* tests/base.m4 (m4_wrap): Eve out into...
* tests/shell.m4: here, new file.
* tests/base.m4 (AC_SHELL_MKDIR_P)
(AC_SHELL_DIRNAME & AC_SHELL_DIRNAME_SED): Eve out into...
* tests/m4sugar.m4 (AS_MKDIR_P, AS_DIRNAME & AS_DIRNAME_SED):
here, new file.
Adjust the test suite.
2000-10-26 01:51:10 +08:00
|
|
|
|
2000-12-19 16:15:48 +08:00
|
|
|
AT_CLEANUP
|
2005-02-05 12:55:08 +08:00
|
|
|
|
|
|
|
## ------------------------------ ##
|
|
|
|
## Standard regular expressions. ##
|
|
|
|
## ------------------------------ ##
|
|
|
|
|
|
|
|
AT_SETUP([Standard regular expressions])
|
|
|
|
|
|
|
|
# AT_CHECK_M4RE(RE-NAME, TEXT, INTENT = `ok' | `')
|
|
|
|
# ------------------------------------------------
|
|
|
|
# Check whether RE-NAME (a macro whose definition is a regular expression)
|
|
|
|
# matches TEXT. INTENT = `ok' if the match should succeed or else empty.
|
|
|
|
m4_define([AT_CHECK_M4RE],
|
|
|
|
[AT_CHECK_M4SUGAR_TEXT(
|
|
|
|
[[m4_bregexp([$2], ^m4_defn([$1])$, [ok])
|
|
|
|
]], [$3
|
|
|
|
])])
|
|
|
|
|
|
|
|
AT_CHECK_M4RE([m4_re_word], [ab9_c], [ok])
|
|
|
|
AT_CHECK_M4RE([m4_re_word], [_9abc], [ok])
|
|
|
|
AT_CHECK_M4RE([m4_re_word], [9ab_c])
|
|
|
|
|
|
|
|
AT_CHECK_M4RE([m4_re_string], [ab9_c], [ok])
|
|
|
|
AT_CHECK_M4RE([m4_re_string], [_9abc], [ok])
|
|
|
|
AT_CHECK_M4RE([m4_re_string], [9ab_c], [ok])
|
|
|
|
AT_CHECK_M4RE([m4_re_string], [9a@_c])
|
|
|
|
|
|
|
|
AT_CLEANUP
|
2006-02-21 05:43:05 +08:00
|
|
|
|
|
|
|
## ---------- ##
|
|
|
|
## M4 Loops. ##
|
|
|
|
## ---------- ##
|
|
|
|
|
|
|
|
AT_SETUP([M4 loops])
|
|
|
|
|
|
|
|
AT_CHECK_M4SUGAR_TEXT([[dnl
|
|
|
|
m4_define([myvar], [outer value])dnl
|
|
|
|
m4_for([myvar], 1, 3, 1, [ myvar])
|
|
|
|
m4_for([myvar], 1, 3, , [ myvar])
|
|
|
|
m4_for([myvar], 3, 1,-1, [ myvar])
|
|
|
|
m4_for([myvar], 3, 1, , [ myvar])
|
|
|
|
m4_for([myvar], 1, 3, 2, [ myvar])
|
|
|
|
m4_for([myvar], 3, 1,-2, [ myvar])
|
|
|
|
m4_for([myvar],-1,-3,-2, [ myvar])
|
|
|
|
m4_for([myvar],-3,-1, 2, [ myvar])
|
|
|
|
dnl Make sure we recalculate the bounds correctly:
|
|
|
|
m4_for([myvar], 1, 3, 3, [ myvar])
|
|
|
|
m4_for([myvar], 1, 6, 3, [ myvar])
|
|
|
|
m4_for([myvar],22,-7,-5, [ myvar])
|
|
|
|
m4_for([myvar],-2,-7,-4, [ myvar])
|
|
|
|
m4_for([myvar],-7,-2, 4, [ myvar])
|
|
|
|
dnl Make sure we are not exposed to division truncation:
|
|
|
|
m4_for([myvar], 2, 5, 2, [ myvar])
|
|
|
|
m4_for([myvar],-5,-2, 2, [ myvar])
|
|
|
|
m4_for([myvar], 5, 2,-2, [ myvar])
|
|
|
|
m4_for([myvar],-2,-5,-2, [ myvar])
|
|
|
|
dnl Make sure we do not divide by zero:
|
|
|
|
m4_for([myvar], 1, 1, , [ myvar])
|
|
|
|
m4_for([myvar], 1, 1,+2, [ myvar])
|
|
|
|
m4_for([myvar], 1, 1,-2, [ myvar])
|
|
|
|
dnl Make sure we do not loop endlessly
|
|
|
|
m4_for([myval], 1, 1, 0, [ myval])
|
|
|
|
dnl Make sure to properly parenthesize
|
|
|
|
m4_for([myvar], 3-5, -2+8, , [ myvar])
|
|
|
|
m4_for([myvar], -2+8, 3-5, , [ myvar])
|
|
|
|
m4_for([myvar], 8, 16, 3 * 2, [ myvar])
|
|
|
|
m4_for([myvar], 8, 16, -3 * -2, [ myvar])
|
|
|
|
m4_for([myvar], [2<<2], [2<<3], [-3 * (-2)], [ myvar])
|
|
|
|
m4_foreach([myvar], [[a], [b, c], [d], [e
|
|
|
|
],[f]], [ myvar|])
|
|
|
|
m4_foreach_w([myvar], [a b c, d,e f
|
|
|
|
g], [ myvar|])
|
|
|
|
myvar
|
|
|
|
]],
|
|
|
|
[[ 1 2 3
|
|
|
|
1 2 3
|
|
|
|
3 2 1
|
|
|
|
3 2 1
|
|
|
|
1 3
|
|
|
|
3 1
|
|
|
|
-1 -3
|
|
|
|
-3 -1
|
|
|
|
1
|
|
|
|
1 4
|
|
|
|
22 17 12 7 2 -3
|
|
|
|
-2 -6
|
|
|
|
-7 -3
|
|
|
|
2 4
|
|
|
|
-5 -3
|
|
|
|
5 3
|
|
|
|
-2 -4
|
|
|
|
1
|
|
|
|
1
|
|
|
|
1
|
|
|
|
1
|
|
|
|
-2 -1 0 1 2 3 4 5 6
|
|
|
|
6 5 4 3 2 1 0 -1 -2
|
|
|
|
8 14
|
|
|
|
8 14
|
|
|
|
8 14
|
|
|
|
a| b, c| d| e
|
|
|
|
| f|
|
|
|
|
a| b| c,| d,e| f| g|
|
|
|
|
outer value
|
|
|
|
]], [])
|
|
|
|
|
|
|
|
AT_DATA_M4SUGAR([script.4s],
|
|
|
|
[[m4_init
|
|
|
|
m4_divert_push([0])m4_wrap([m4_divert_pop([0])[]])dnl
|
|
|
|
m4_for([myvar], 1, 3,-1, [ myvar])
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_M4SUGAR([], 1, [],
|
|
|
|
[[script.4s:3: error: assert failed: -1 > 0
|
|
|
|
script.4s:3: the top level
|
|
|
|
autom4te: m4 failed with exit status: 1
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA_M4SUGAR([script.4s],
|
|
|
|
[[m4_init
|
|
|
|
m4_divert_push([0])m4_wrap([m4_divert_pop([0])[]])dnl
|
|
|
|
m4_for([myvar], 1, 2, 0, [ myvar])
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_M4SUGAR([], 1, [],
|
|
|
|
[[script.4s:3: error: assert failed: 0 > 0
|
|
|
|
script.4s:3: the top level
|
|
|
|
autom4te: m4 failed with exit status: 1
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_DATA_M4SUGAR([script.4s],
|
|
|
|
[[m4_init
|
|
|
|
m4_divert_push([0])m4_wrap([m4_divert_pop([0])[]])dnl
|
|
|
|
m4_for([myvar], 2, 1, 0, [ myvar])
|
|
|
|
]])
|
|
|
|
|
|
|
|
AT_CHECK_M4SUGAR([], 1, [],
|
|
|
|
[[script.4s:3: error: assert failed: 0 < 0
|
|
|
|
script.4s:3: the top level
|
|
|
|
autom4te: m4 failed with exit status: 1
|
|
|
|
]])
|
|
|
|
AT_CLEANUP
|