autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: Revamping Autotest, take 2


From: Akim Demaille
Subject: FYI: Revamping Autotest, take 2
Date: 13 Nov 2001 12:32:54 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        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.

Index: lib/autotest/general.m4
===================================================================
RCS file: /cvs/autoconf/lib/autotest/general.m4,v
retrieving revision 1.117
diff -u -u -r1.117 general.m4
--- lib/autotest/general.m4 2001/11/13 11:39:14 1.117
+++ lib/autotest/general.m4 2001/11/13 11:40:26
@@ -94,7 +94,6 @@
           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 @@
 # 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 address@hidden:@] -gt 0; do
@@ -172,9 +169,7 @@
         ;;
 
     --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 @@
     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 @@
       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 @@
   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 address@hidden:@]`
 at_fail_count=`set dummy $at_fail_list; shift; echo address@hidden:@]`
@@ -706,30 +708,12 @@
 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 @@
 # 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: tests/atspecific.m4
===================================================================
RCS file: /cvs/autoconf/tests/atspecific.m4,v
retrieving revision 1.62
diff -u -u -r1.62 atspecific.m4
--- tests/atspecific.m4 2001/10/08 08:22:49 1.62
+++ tests/atspecific.m4 2001/11/13 11:40:26
@@ -36,8 +36,7 @@
 # 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 @@
 # 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 @@
 # 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 @@
 # 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 @@
 #                     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 @@
 # `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])])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]