need to list the files to remove at the end of tests groups.
* lib/autotest/general.m4 (_AT_CLEANUP_FILE, AT_CLEANUP_FILES):
(AT_data_files, at_data_files): Remove.
(AT_CLEANUP, AT_DATA): Simplify.
(AT_INIT): Adjust.
Remove the group dir if !debug && !failed.
* tests/atspecific.m4: Adjust.
+2001-11-13 Akim Demaille <akim@epita.fr>
+
+ Now that tests are running in their own private dir, there is no
+ need to list the files to remove at the end of tests groups.
+
+ * lib/autotest/general.m4 (_AT_CLEANUP_FILE, AT_CLEANUP_FILES):
+ (AT_data_files, at_data_files): Remove.
+ (AT_CLEANUP, AT_DATA): Simplify.
+ (AT_INIT): Adjust.
+ Remove the group dir if !debug && !failed.
+ * tests/atspecific.m4: Adjust.
+
2001-11-13 Akim Demaille <akim@epita.fr>
Start a new layout for Autotest: `testsuite' creates
m4_defn([PACKAGE_STRING])[ test suite]m4_ifval([$1], [: $1]))
m4_define([AT_ordinal], 0)
m4_define([AT_banner_ordinal], 0)
-m4_define([AT_data_files], [stdout expout at-* stderr experr])
AS_INIT
m4_divert_push([DEFAULT])dnl
# numerical order.
at_format=`echo $at_last_test | sed 's/././g'`
# Description of all the tests.
-at_help_all='AT_help'
-# List of the output files.
-at_data_files='AT_data_files'])])dnl
+at_help_all='AT_help'])])dnl
m4_divert([OPTIONS])
while test $[@%:@] -gt 0; do
;;
--clean | -c )
- rm -rf $at_data_files \
- $as_me.[[0-9]] $as_me.[[0-9][0-9]] $as_me.[[0-9][0-9][0-9]] \
- $as_me.log devnull
+ rm -rf $at_tests_dir $as_me.log devnull
exit 0
;;
continue
;;
esac
+
+ # Be sure to come back to the top test directory, in particular
+ # since below we might `rm' the directory we are in currently.
+ cd $at_tests_dir
+
case $at_test in
banner-*) ;;
*)
case $at_status in
0) at_msg="ok"
at_pass_list="$at_pass_list $at_test"
+ # Cleanup the group directory, unless the user wants the files.
+ $at_debug_p || rm -rf $at_group_dir
;;
77) at_msg="ok (skipped near \``cat $at_check_line_file`')"
at_skip_list="$at_skip_list $at_test"
+ # Cleanup the group directory, unless the user wants the files.
+ $at_debug_p || rm -rf $at_group_dir
;;
*) at_msg="FAILED near \``cat $at_check_line_file`'"
at_fail_list="$at_fail_list $at_test"
+ # Up failure, keep the group directory for autopsy.
;;
esac
echo $at_msg
echo "$as_me: test suite duration: $at_duration" >&AS_MESSAGE_LOG_FD
fi
-# Cleanup everything unless the user wants the files.
-$at_debug_p || rm -rf $at_data_files
-
# Wrap up the test suite with summary statistics.
at_skip_count=`set dummy $at_skip_list; shift; echo $[@%:@]`
at_fail_count=`set dummy $at_fail_list; shift; echo $[@%:@]`
[m4_append_uniq([AT_keywords], [$1], [,])])
-# _AT_CLEANUP_FILE(FILE)
-# ----------------------
-# Register FILE for AT_CLEANUP.
-m4_define([_AT_CLEANUP_FILE],
-[m4_append_uniq([AT_data_files], [$1], [ ])])
-
-
-# AT_CLEANUP_FILES(FILES)
-# -----------------------
-# Declare a list of FILES to clean.
-m4_define([AT_CLEANUP_FILES],
-[m4_foreach([AT_File], m4_quote(m4_bpatsubst([$1], [ *], [,])),
- [_AT_CLEANUP_FILE(AT_File)])])
-
-
-# AT_CLEANUP(FILES)
-# -----------------
-# Complete a group of related tests, recursively remove those FILES
-# created within the test. There is no need to list files created with
-# AT_DATA.
+# AT_CLEANUP
+# ----------
+# Complete a group of related tests.
m4_define([AT_CLEANUP],
-[AT_CLEANUP_FILES([$1])dnl
-m4_append([AT_help],
+[m4_append([AT_help],
m4_defn([AT_ordinal]);m4_defn([AT_line]);m4_defn([AT_description]);m4_ifdef([AT_keywords], [m4_defn([AT_keywords])])
)dnl
$at_times >$at_tests_dir/at-times
# This macro is not robust to active symbols in CONTENTS *on purpose*.
# If you don't want CONTENT to be evaluated, quote it twice.
m4_define([AT_DATA],
-[AT_CLEANUP_FILES([$1])dnl
-cat >$1 <<'_ATEOF'
+[cat >$1 <<'_ATEOF'
$2[]_ATEOF
])
# AT_CHECK_M4SUGAR(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
# ----------------------------------------------------------
m4_define([AT_CHECK_M4SUGAR],
-[AT_CLEANUP_FILES([script.4s script autom4te.cache])dnl
-AT_CHECK([autom4te --language=m4sugar script.4s -o script $1],
+[AT_CHECK([autom4te --language=m4sugar script.4s -o script $1],
m4_default([$2], [0]), [$3], [$4])])
# AT_CHECK_M4SH(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
# -------------------------------------------------------
m4_define([AT_CHECK_M4SH],
-[AT_CLEANUP_FILES([script.as script autom4te.cache])dnl
-AT_CHECK([autom4te --language=m4sh script.as -o script $1],
+[AT_CHECK([autom4te --language=m4sh script.as -o script $1],
m4_default([$2], [0]), [$3], [$4])])
# Create a full configure.ac running BODY, with a config header set up,
# AC_OUTPUT, and environement checking hooks.
m4_define([AT_CONFIGURE_AC],
-[AT_CLEANUP_FILES(env-after state*)dnl
-AT_DATA([configure.ac],
+[AT_DATA([configure.ac],
[[AC_INIT
AC_CONFIG_AUX_DIR($top_srcdir/config)
AC_CONFIG_HEADER(config.h:config.hin)
# AT_CHECK_AUTOCONF(ARGS, [EXIT-STATUS = 0], STDOUT, STDERR)
# ----------------------------------------------------------
m4_define([AT_CHECK_AUTOCONF],
-[AT_CLEANUP_FILES(configure.in configure autom4te.cache)dnl
-AT_CHECK([autoconf --include=$srcdir $1],
+[AT_CHECK([autoconf --include=$srcdir $1],
[$2], [$3], [$4])])
# STDOUT, [STDERR = `autoheader: `config.hin' is created'])
# -----------------------------------------------------------------------------
m4_define([AT_CHECK_AUTOHEADER],
-[AT_CLEANUP_FILES(config.hin config.hin~)dnl
-AT_CHECK([autoheader --localdir=$srcdir $1], [$2],
+[AT_CHECK([autoheader --localdir=$srcdir $1], [$2],
[$3],
m4_default([$4], [[autoheader: `config.hin' is created
]]))])
# `top_srcdir' is needed so that `./configure' finds install-sh.
# Using --srcdir is more expensive.
m4_define([AT_CHECK_CONFIGURE],
-[AT_CLEANUP_FILES(config.h defs config.log config.status config.cache)dnl
-AT_CHECK([top_srcdir=$top_srcdir ./configure $1],
+[AT_CHECK([top_srcdir=$top_srcdir ./configure $1],
[$2],
m4_default([$3], [ignore]), [$4],
[test $at_verbose = echo && echo "$srcdir/AT_LINE: config.log" && cat config.log])])