+2003-09-26 Akim Demaille <akim@epita.fr>
+
+ The test suite are sometimes assigning timings incorrectly.
+ Reported by Paivio Pollari.
+ Diagnosed by Nicolas Joly.
+
+ * lib/autotest/general.m4 (AT_CLEANUP): Rename AT_help as
+ AT_help_all.
+ Instead of making AT_help a sequence of assignments to grow
+ $at_help_all, just make AT_help_all be the growing contents of
+ $at_help_all, and make a single assignment in...
+ (AT_INIT): here.
+ (at_times_skip): Flip the meaning and rename as...
+ (at_times_p): this.
+ (AT_INIT): When summarizing the test that ran, remove
+ $at_times_file after use, and check it is present before trying to
+ use it.
+
2003-09-25 Akim Demaille <akim@epita.fr>
Version 2.57d.
# Not all shells have the 'times' builtin; the subshell is needed to make
# sure we discard the 'times: not found' message from the shell.
-at_times_skip=:
-(times) >/dev/null 2>&1 && at_times_skip=false
+at_times_p=false
+(times) >/dev/null 2>&1 && at_times_p=:
# CLI Arguments to pass to the debugging scripts.
at_debug_args=
# numerical order.
at_format='m4_bpatsubst(m4_defn([AT_ordinal]), [.], [.])'
# Description of all the test groups.
-at_help_all=
-AT_help])])dnl
+at_help_all='AT_help_all'])])dnl
m4_divert_push([PARSE_ARGS])dnl
at_keywords=
at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
case $at_status in
0|77)
- # $at_times_file is only available if the group succeeded or
- # was skipped. We're not including the group log, so the
- # success message is written in the global log separately.
- # But we also write to the group log in case they're using
- # -d.
- $at_times_skip ||
+ # $at_times_file is only available if the group succeeded.
+ # We're not including the group log, so the success message
+ # is written in the global log separately. But we also
+ # write to the group log in case they're using -d.
+ if test -f $at_times_file; then
at_log_msg="$at_log_msg (`sed 1d $at_times_file`)"
+ rm -f $at_times_file
+ fi
echo "$at_log_msg" >> $at_group_log
echo "$at_log_msg" >&AS_MESSAGE_LOG_FD
*) at_result="$at_result
$at_skip_count tests were skipped." ;;
esac
-
+
if test $at_unexpected_count = 0; then
echo "$at_result"
echo "$at_result" >&AS_MESSAGE_LOG_FD
# $at_arg_OPTION will be set to `:' if this option is received, `false' if
# if --noOPTION is received, and `false' by default.
#
-# Run ACTION-IF-GIVEN each time an option in OPTIONS is encountered with
+# Run ACTION-IF-GIVEN each time an option in OPTIONS is encountered with
# $at_optarg set to `:' or `false' as appropriate. $opt_arg is actually
# just a copy of $at_arg_OPTION.
#
# variable $at_arg_OPTION, where OPTION is the first option in OPTIONS with
# any `-' characters replaced with `_'.
#
-# Run ACTION-IF-GIVEN each time an option in OPTIONS is encountered with
+# Run ACTION-IF-GIVEN each time an option in OPTIONS is encountered with
# $at_optarg set. $at_optarg is actually just a copy of $at_arg_OPTION.
#
# ACTION-IF-NOT-GIVEN will be run once after option parsing is complete
m4_define([AT_XFAIL_IF],
[dnl
dnl Try to limit the amount of conditionals that we emit.
-m4_case([$1],
+m4_case([$1],
[], [],
[false], [],
[:], [m4_define([AT_xfail], [at_xfail=yes])],
# ----------
# Complete a group of related tests.
m4_define([AT_CLEANUP],
-[m4_append([AT_help],
-at_help_all=$at_help_all'm4_defn([AT_ordinal]);m4_defn([AT_line]);m4_defn([AT_description]);m4_ifdef([AT_keywords], [m4_defn([AT_keywords])]);
-'
+[m4_append([AT_help_all],
+m4_defn([AT_ordinal]);m4_defn([AT_line]);m4_defn([AT_description]);m4_ifdef([AT_keywords], [m4_defn([AT_keywords])]);
)dnl
m4_divert_pop([TEST_SCRIPT])dnl Back to TESTS
AT_xfail
$at_traceon
m4_undivert([TEST_SCRIPT])dnl Insert the code here
$at_traceoff
- $at_times_skip || times >$at_times_file
+ $at_times_p && times >$at_times_file
) AS_MESSAGE_LOG_FD>&1 2>&1 | eval $at_tee_pipe
at_status=`cat $at_status_file`
;;