]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Now that tests are running in their own private dir, there is no
authorAkim Demaille <akim@epita.fr>
Tue, 13 Nov 2001 11:41:08 +0000 (11:41 +0000)
committerAkim Demaille <akim@epita.fr>
Tue, 13 Nov 2001 11:41:08 +0000 (11:41 +0000)
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.

ChangeLog
lib/autotest/general.m4
tests/atspecific.m4

index 0e51242b24a31fe3b88cb95bcfc98cf4f11b5cd3..a0b097af6497a9767da7da1f5af06def609baaf4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+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
index 3a232a4be4fe320a525055ac22830fb3596008eb..40920b10a9223930028363ae8970ba8682de6af8 100644 (file)
@@ -94,7 +94,6 @@ m4_define([AT_TESTSUITE_NAME],
           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
 
@@ -151,9 +150,7 @@ at_last_test=AT_ordinal
 # 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
@@ -172,9 +169,7 @@ 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
         ;;
 
@@ -516,6 +511,11 @@ m4_divert([TAIL])[]dnl
     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-*) ;;
     *)
@@ -532,12 +532,17 @@ _ATEOF
       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
@@ -564,9 +569,6 @@ if test "$at_duration" != "h m s"; then
   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 $[@%:@]`
@@ -707,29 +709,11 @@ m4_define([AT_KEYWORDS],
 [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
@@ -767,8 +751,7 @@ _ATEOF
 # 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
 ])
 
index 13cab5e11da2e2b75650c93b1c9bf23de8066cab..8d1ade5d14fe1601e2321123c195ecfdd85eaa20 100644 (file)
@@ -36,8 +36,7 @@ m4_define([AT_DATA_M4SUGAR],
 # 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])])
 
 
@@ -60,8 +59,7 @@ m4_define([AT_DATA_M4SH],
 # 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])])
 
 
@@ -76,8 +74,7 @@ AT_CHECK([autom4te --language=m4sh script.as -o script $1],
 # 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)
@@ -91,8 +88,7 @@ AC_STATE_SAVE(after)
 # 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])])
 
 
@@ -100,8 +96,7 @@ AT_CHECK([autoconf --include=$srcdir $1],
 #                     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
 ]]))])
@@ -114,8 +109,7 @@ AT_CHECK([autoheader --localdir=$srcdir $1], [$2],
 # `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])])