** Autotest testsuites do not attempt to write startup error messages
to the log file before that is opened (regression introduced in 2.63).
-** The following Autotest macros are new:
- AT_SKIP_IF AT_FAIL_IF
-
** Configure scripts now use shell functions. This feature leads to
smaller configure files and faster execution.
-e 's|@autom4te-name[@]|'`echo autom4te | sed '$(transform)'`'|g' \
-e 's|@M4[@]|$(M4)|g' \
-e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
- -e 's|@M4_GNU[@]|$(M4_GNU)|g' \
-e 's|@AWK[@]|$(AWK)|g' \
-e 's|@RELEASE_YEAR[@]|'$(RELEASE_YEAR)'|g' \
-e 's|@VERSION[@]|$(VERSION)|g' \
#
# We don't output directly to the cache files, to avoid problems
# when we are interrupted (that leaves corrupted files).
- xsystem ("$m4 @M4_GNU@"
+ xsystem ("$m4"
. join (' --include=', '', map { shell_quote ($_) } @include)
. ' --debug=aflq'
. (!exists $ENV{'AUTOM4TE_NO_FATAL'} ? ' --fatal-warning' : '')
])
AC_SUBST([ac_cv_sh_n_works])
-AC_MSG_CHECKING([for characters that cannot appear in file names])
-AC_CACHE_VAL( [ac_cv_unsupported_fs_chars],
-[ac_cv_unsupported_fs_chars=
-for c in '\\' '"' '<' '>' '*' '?' '|'
-do
- touch "t${c}t" 2>/dev/null
- test -f "t${c}t" && rm -f "t${c}t" && continue
- # $c cannot be used in a file name.
- ac_cv_unsupported_fs_chars=$ac_cv_unsupported_fs_chars$c
-done
-])
-if test -n "$ac_cv_unsupported_fs_chars"; then
- AC_MSG_RESULT([$ac_cv_unsupported_fs_chars])
-else
- AC_MSG_RESULT([none])
-fi
-
-AC_SUBST([ac_cv_unsupported_fs_chars])
-
-AC_CACHE_CHECK([whether directories can have trailing spaces],
- [ac_cv_dir_trailing_space],
-[rm -rf 'tdir ' && mkdir 'tdir ' && touch 'tdir /tfile' 2>/dev/null
-a=$?
-rm -rf 'tdir '
-case $a$? in #(
- 00) ac_cv_dir_trailing_space=yes ;; #(
- *) ac_cv_dir_trailing_space=no ;;
-esac
-])
-AC_SUBST([ac_cv_dir_trailing_space])
-
# Initialize the test suite.
AC_CONFIG_TESTDIR([tests])
AC_CONFIG_FILES([tests/Makefile tests/atlocal])
Several identical calls within one test group have no additional effect.
@end defmac
-@defmac AT_FAIL_IF (@var{shell-condition})
-@atindex{FAIL_IF}
-Make the test group fail, skipping the rest of its execution if
-@var{shell-condition} is true. @var{shell-condition} is a shell expression
-such as a @code{test} command. Tests before @command{AT_FAIL_IF}
-will be executed and may still cause the test group to be skipped.
-You can instantiate this macro many times from within the same test group.
-
-You should use this macro only for very simple failure conditions. If the
-@var{shell-condition} could emit any kind of output you should instead
-use @command{AT_CHECK} like
-@example
-AT_CHECK([@var{shell-condition}] || exit 99)
-@end example
-@noindent
-so that such output is properly recorded in the @file{testsuite.log}
-file.
-@end defmac
-
-@defmac AT_SKIP_IF (@var{shell-condition})
-@atindex{SKIP_IF}
-Determine whether the test should be skipped because it requires
-features that are unsupported on the machine under test.
-@var{shell-condition} is a shell expression such as a @code{test}
-command. Tests before @command{AT_SKIP_IF} will be executed
-and may still cause the test group to fail. You can instantiate this
-macro many times from within the same test group.
-
-You should use this macro only for very simple skip conditions. If the
-@var{shell-condition} could emit any kind of output you should instead
-use @command{AT_CHECK} like
-@example
-AT_CHECK([@var{shell-condition}] || exit 77)
-@end example
-so that such output is properly recorded in the @file{testsuite.log}
-file.
-@end defmac
-
@defmac AT_XFAIL_IF (@var{shell-condition})
@atindex{XFAIL_IF}
Determine whether the test is expected to fail because it is a known
m4_bregexp(/__file__, [/\([^/]*\)$], [[\1]]))])])dnl
m4_defn([_AT_LINE_base]):__line__])
-# _AT_LINE_ESCAPED
-# ----------------
-# Same as AT_LINE, but already escaped for the shell.
-m4_define([_AT_LINE_ESCAPED], ["AS_ESCAPE(m4_dquote(AT_LINE))"])
-
# _AT_NORMALIZE_TEST_GROUP_NUMBER(SHELL-VAR)
# ------------------------------------------
AS_ECHO(["$as_nl$at_banner_text$as_nl"])
} # at_fn_banner
-AS_FUNCTION_DESCRIBE([at_fn_check_prepare_notrace], [REASON LINE],
+AS_FUNCTION_DESCRIBE([at_fn_check_prepare_notrace], [LINE],
[Perform AT_CHECK preparations for the command at LINE for an
-untraceable command; REASON is the reason for disabling tracing.])
+untraceable command, or when tracing is disabled.])
at_fn_check_prepare_notrace ()
{
- $at_trace_echo "Not enabling shell tracing (command contains $1)"
- AS_ECHO(["$[2]"]) >"$at_check_line_file"
+ AS_ECHO(["$[1]"]) >"$at_check_line_file"
at_check_trace=: at_check_filter=:
: >"$at_stdout"; : >"$at_stderr"
}
command.])
at_fn_check_prepare_trace ()
{
- AS_ECHO(["$[1]"]) >"$at_check_line_file"
- at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
- : >"$at_stdout"; : >"$at_stderr"
+ if test -n "$at_traceon"; then
+ AS_ECHO(["$[1]"]) >"$at_check_line_file"
+ at_check_trace=$at_traceon at_check_filter=at_fn_filter_trace
+ : >"$at_stdout"; : >"$at_stderr"
+ else
+ at_fn_check_prepare_notrace "$[1]"
+ fi
}
AS_FUNCTION_DESCRIBE([at_fn_check_prepare_dynamic], [COMMAND LINE],
appropriate preparation function.])
at_fn_check_prepare_dynamic ()
{
- case $[1] in
+ case "$at_traceon:$[1]" in
+ :*$as_nl*)
+ at_fn_check_prepare_notrace "$[2]" ;;
*$as_nl*)
- at_fn_check_prepare_notrace 'an embedded newline' "$[2]" ;;
+ echo 'Not enabling shell tracing (command contains an embedded newline)'
+ at_fn_check_prepare_notrace "$[2]" ;;
*)
at_fn_check_prepare_trace "$[2]" ;;
esac
at_quiet=
# Running several jobs in parallel, 0 means as many as test groups.
at_jobs=1
-at_traceon=:
-at_trace_echo=:
-at_check_filter_trace=:
# Shall we keep the debug scripts? Must be `:' when the suite is
# run by a debug script, so that the script doesn't remove itself.
;;
--trace | -x )
- at_traceon='set -x'
- at_trace_echo=echo
- at_check_filter_trace=at_fn_filter_trace
+ at_traceon='set -x'; at_traceoff='set +x'
;;
[[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]])
])
-# AT_FAIL_IF(SHELL-EXPRESSION)
-# -----------------------------
-# Set up the test to be expected to fail if SHELL-EXPRESSION evaluates to
-# true (exitcode = 0).
-_AT_DEFINE_SETUP([AT_FAIL_IF],
-[dnl
-dnl Try to limit the amount of conditionals that we emit.
-m4_case([$1],
- [], [],
- [false], [],
- [:], [_AT_CHECK_EXIT([], [99])],
- [true], [_AT_CHECK_EXIT([], [99])],
- [_AT_CHECK_EXIT([$1], [99])])])
-
-
-# AT_SKIP_IF(SHELL-EXPRESSION)
-# -----------------------------
-# Set up the test to be expected to fail if SHELL-EXPRESSION evaluates to
-# true (exitcode = 0).
-_AT_DEFINE_SETUP([AT_SKIP_IF],
-[dnl
-dnl Try to limit the amount of conditionals that we emit.
-m4_case([$1],
- [], [],
- [false], [],
- [:], [_AT_CHECK_EXIT([], [77])],
- [true], [_AT_CHECK_EXIT([], [77])],
- [_AT_CHECK_EXIT([$1], [77])])])
-
-
# AT_XFAIL_IF(SHELL-EXPRESSION)
# -----------------------------
# Set up the test to be expected to fail if SHELL-EXPRESSION evaluates to
AS_ECHO(["AT_ordinal. m4_defn([AT_line]): testing $1..."])
$at_traceon
m4_undivert([TEST_SCRIPT])dnl Insert the code here
- set +x
+ $at_traceoff
$at_times_p && times >"$at_times_file"
) AS_MESSAGE_LOG_FD>&1 2>&1 | eval $at_tee_pipe
read at_status <"$at_status_file"
[]))]dnl No reason.
[m4_if(m4_index(_m4_defn([at_reason]), [a]), [0],]dnl
dnl We know at build time that tracing COMMANDS is never safe.
-[[at_fn_check_prepare_notrace 'm4_defn([at_reason])'],dnl
+[[echo 'Not enabling shell tracing (command contains ]m4_defn([at_reason])[)'
+at_fn_check_prepare_notrace],
m4_index([$1], [$]), [-1],]dnl
dnl We know at build time that tracing COMMANDS is always safe.
[[at_fn_check_prepare_trace],]dnl
# with parallel jobs.
m4_define([_AT_CHECK],
[m4_define([AT_ingroup])]dnl
-[{ set +x
+[{ $at_traceoff
AS_ECHO(["$at_srcdir/AT_LINE: AS_ESCAPE([[$1]])"])
-_AT_DECIDE_TRACEABLE([$1]) _AT_LINE_ESCAPED
+_AT_DECIDE_TRACEABLE([$1]) "AS_ESCAPE(m4_dquote(AT_LINE))"
( $at_check_trace; [$1]
) >>"$at_stdout" 2>>"$at_stderr"
at_status=$? at_failed=false
[$at_failed && at_fn_log_failure AT_capture_files
$at_traceon; }
])# _AT_CHECK
-
-# _AT_CHECK_EXIT(COMMANDS, [EXIT-STATUS-IF-PASS])
-# -----------------------------------------------
-# Minimal version of _AT_CHECK for AT_SKIP_IF and AT_FAIL_IF.
-m4_define([_AT_CHECK_EXIT],
-[m4_define([AT_ingroup])]dnl
-[AS_ECHO(_AT_LINE_ESCAPED) >"$at_check_line_file"
-m4_ifval([$1], [$1 && ])at_fn_check_skip $2])# _AT_CHECK_EXIT
[AC_MSG_ERROR([no acceptable m4 could be found in \$PATH.
GNU M4 1.4.5 or later is required; 1.4.11 is recommended])])])
M4=$ac_cv_path_M4
- AC_CACHE_CHECK([whether $ac_cv_path_M4 accepts -g], [ac_cv_prog_gnu_m4_gnu],
- [case `$M4 --help < /dev/null 2>&1` in
- *--gnu*) ac_cv_prog_gnu_m4_gnu=yes ;;
- *) ac_cv_prog_gnu_m4_gnu=no ;;
- esac])
- if test "$ac_cv_prog_gnu_m4_gnu" = yes; then
- M4_GNU=-g
- else
- M4_GNU=
- fi
- AC_SUBST([M4_GNU])
AC_CACHE_CHECK([how m4 supports trace files], [ac_cv_prog_gnu_m4_debugfile],
[case `$M4 --help < /dev/null 2>&1` in
*debugfile*) ac_cv_prog_gnu_m4_debugfile=--debugfile ;;
# Check whether the underlying system can manage some unusual
# symbols in file names.
-if test -z '@ac_cv_unsupported_fs_chars@'; then
+unsupported_fs_chars=
+for c in '\\' '"' '<' '>' '*' '?' '|'
+do
+ touch "t${c}t" 2>/dev/null
+ test -f "t${c}t" && rm -f "t${c}t" && continue
+ # $c cannot be used in a file name.
+ unsupported_fs_chars=$unsupported_fs_chars$c
+done
+if test -z "$unsupported_fs_chars"; then
func_sanitize_file_name () { echo "$@"; }
else
- func_sanitize_file_name () { echo "$@" | tr -d '@ac_cv_unsupported_fs_chars@'; }
+ func_sanitize_file_name () { echo "$@" | tr -d "$unsupported_fs_chars"; }
fi
# Can we create directories with trailing whitespaces in their name?
-ac_cv_dir_trailing_space='@ac_cv_dir_trailing_space@'
-if test "$ac_cv_dir_trailing_space" = yes; then
- func_sanitize_dir_name () { echo "$@"; }
-else
- func_sanitize_dir_name () { echo "$@" | sed 's/ *$//'; }
-fi
+rm -rf 'tdir ' && mkdir 'tdir ' && touch 'tdir /tfile' 2>/dev/null
+a=$?
+rm -rf 'tdir '
+case $a$? in #(
+00)
+ func_sanitize_dir_name () { echo "$@"; } ;; #(
+*)
+ func_sanitize_dir_name () { echo "$@" | sed 's/ *$//'; } ;;
+esac
AT_CHECK([:])
]], [missing AT@&t@_CLEANUP detected])
-AT_CHECK_AT_SYNTAX([AT@&t@_FAIL_IF without AT@&t@_SETUP],
-[[AT_INIT([incomplete test suite])
-AT_FAIL_IF([:])
-]], [AT@&t@_FAIL_IF: missing AT@&t@_SETUP detected])
-
-AT_CHECK_AT_SYNTAX([AT@&t@_SKIP_IF without AT@&t@_SETUP],
-[[AT_INIT([incomplete test suite])
-AT_SKIP_IF([:])
-]], [AT@&t@_SKIP_IF: missing AT@&t@_SETUP detected])
-
-AT_CHECK_AT_SYNTAX([AT@&t@_CHECK without AT@&t@_SETUP],
-[[AT_INIT([incomplete test suite])
-AT_CHECK([:])
-]], [AT@&t@_CHECK: missing AT@&t@_SETUP detected])
-
AT_CHECK_AT_SYNTAX([AT@&t@_CHECK without AT@&t@_SETUP],
[[AT_INIT([incomplete test suite])
AT_CHECK([:])
[AT_CHECK([grep '2 failed unexpectedly' micro-suite.log], [], [ignore])
AT_CHECK([grep ok micro-suite.log], [1])])
-AT_CHECK_AT_TEST([AT@&t@_FAIL_IF],
- [AT_FAIL_IF([:])
- AT_CLEANUP
- AT_SETUP
- AT_FAIL_IF([false])
- AT_CLEANUP
- AT_SETUP
- AT_FAIL_IF([test x = y])
- AT_CLEANUP
- AT_SETUP
- AT_FAIL_IF([bah])
- AT_CLEANUP
- AT_SETUP
- AT_FAIL_IF([test x = x])
- AT_CLEANUP
- AT_SETUP
- AT_FAIL_IF([test $foo = x])],
- [], [1], [stdout], [ignore], [],
- [AT_CHECK([grep '1 5 failed' stdout], [], [ignore], [ignore])])
-
-AT_CHECK_AT_TEST([AT@&t@_SKIP_IF],
- [AT_SKIP_IF([:])
- AT_CLEANUP
- AT_SETUP
- AT_SKIP_IF([false])
- AT_CLEANUP
- AT_SETUP
- AT_SKIP_IF([test x = y])
- AT_CLEANUP
- AT_SETUP
- AT_SKIP_IF([bah])
- AT_CLEANUP
- AT_SETUP
- AT_SKIP_IF([test x = x])
- AT_CLEANUP
- AT_SETUP
- AT_SKIP_IF([test $foo = x])],
- [], [], [], [], [],
- [AT_CHECK([grep '2.*skipped' micro-suite.log], [], [ignore], [ignore])])
-
AT_CHECK_AT_TEST([Syntax error],
[AT_CHECK([:])
AT_CLEANUP
[# Per BUGS, we have not yet figured out how to run parallel tests cleanly
# under dash and some ksh variants. For now, only run this test under
# limited conditions; help is appreciated in widening this test base.
-AT_SKIP_IF([${CONFIG_SHELL-$SHELL} -c 'test -z "${BASH_VERSION+set}]]dnl
-[[${ZSH_VERSION+set}${TEST_PARALLEL_AUTOTEST+set}"'])
+AT_CHECK([${CONFIG_SHELL-$SHELL} -c 'test -n "${BASH_VERSION+set}]]dnl
+[[${ZSH_VERSION+set}${TEST_PARALLEL_AUTOTEST+set}"' || exit 77])
# The parallel scheduler requires mkfifo and job control to work.
AT_CHECK([mkfifo fifo || exit 77])
AT_CHECK([${CONFIG_SHELL-$SHELL} -c '(set -m && set +m) || exit 77'],
# If the shell handles `-n' well, use it to check the syntax of PROGRAM;
# otherwise, do nothing.
m4_define([AT_CHECK_SHELL_SYNTAX],
-[AT_SKIP_IF([test "$ac_cv_sh_n_works" != yes])
-AT_CHECK([/bin/sh -n $1])])
+[AS_IF([test "$ac_cv_sh_n_works" = yes],
+ [AT_CHECK([/bin/sh -n $1])])])
m4_define([AT_CHECK_PERL_SYNTAX],
[AT_CHECK([autom4te_perllibdir=$abs_top_srcdir/lib $PERL -c "$abs_top_builddir"/bin/$1],