autoconf-patches
[Top][All Lists]
Advanced

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

FYI: Revamping Autotest, take 4


From: Akim Demaille
Subject: FYI: Revamping Autotest, take 4
Date: 13 Nov 2001 14:06:52 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * lib/autotest/general.m4 (AT_INIT): Be sure to put `.', relative,
        in PATH.
        Create `testsuite.dir/003/run' instead of `testsuite.003'.
        Do it as soon as a test fails, don't wait till the end of the test
        suite.
        Don't remove $as_me.[0-9]*, since these files no longer exist.

Index: lib/autotest/general.m4
===================================================================
RCS file: /cvs/autoconf/lib/autotest/general.m4,v
retrieving revision 1.118
diff -u -u -r1.118 general.m4
--- lib/autotest/general.m4 2001/11/13 11:41:08 1.118
+++ lib/autotest/general.m4 2001/11/13 13:15:12
@@ -124,9 +124,11 @@
 # Shall we be verbose?
 at_verbose=:
 at_quiet=echo
+# The directory we are in.
+at_dir=`pwd`
 # The directory the whole test suite works in.
 # Should be absolutely to let the user `cd' at will.
-at_tests_dir=`pwd`/$as_me.dir
+at_tests_dir=$at_dir/$as_me.dir
 # The file containing the location of the last AT_CHECK.
 at_check_line_file=$at_tests_dir/at-check-line
 # Shall we keep the debug scripts?  Must be `:' when test suite is
@@ -352,8 +354,9 @@
 esac])
 
 # Now build and simplify PATH.
-at_sep=
-PATH=
+# Be sure to put `.' in front too: we will `cd', and we must be
+# run to run what is in the current directory (e.g., in a group directory).
+PATH=.
 _AS_PATH_WALK([$at_path],
 [as_dir=`(cd "$as_dir" && pwd) 2>/dev/null`
 test -d "$as_dir" || continue
@@ -362,8 +365,7 @@
                   $as_dir$PATH_SEPARATOR* | \
   *$PATH_SEPARATOR$as_dir                 | \
   *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR* ) ;;
-  *) PATH=$PATH$at_sep$as_dir
-     at_sep=$PATH_SEPARATOR;;
+  *) PATH=$PATH$PATH_SEPARATOR$as_dir ;;
 esac])
 export PATH
 
@@ -543,6 +545,15 @@
         *)  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.
+            # Create the debugging script.
+            {
+              echo "#! /bin/sh"
+              echo "cd $at_dir"
+              echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$[0]" \
+                   '-v -d' "$at_debug_args" "$at_test" '${1+"address@hidden"}'
+              echo 'exit 1'
+            } >$at_group_dir/run
+            chmod +x $at_group_dir/run
             ;;
       esac
       echo $at_msg
@@ -556,6 +567,10 @@
   esac
 done
 
+# Back to the top test directory.
+cd $at_tests_dir
+
+# Compute the duration of the suite.
 at_stop_date=`date`
 at_stop_time=`(date +%s) 2>/dev/null`
 echo "$as_me: ending at: $at_stop_date" >&AS_MESSAGE_LOG_FD
@@ -585,27 +600,7 @@
     AS_BOX([ERROR: Suite unsuccessful, $at_fail_count of $at_test_count tests 
failed.])
   fi
 
-  # Remove any debugging script resulting from a previous run.
-  rm -f $as_me.[[0-9]] $as_me.[[0-9][0-9]] $as_me.[[0-9][0-9][0-9]]
-
   # Normalize the names so that `ls' lists them in order.
-  at_NNN=`expr "NNN$at_group" : ".*\($at_format\)"`
-  echo
-  echo $ECHO_N "Writing \`$as_me.$at_NNN' scripts, with $at_NNN =$ECHO_C"
-  for at_group in $at_fail_list
-  do
-    at_number=`expr "000$at_group" : ".*\($at_format\)"`
-    echo $ECHO_N " $at_number$ECHO_C"
-    {
-      echo "#! /bin/sh"
-      echo 'exec ${CONFIG_SHELL-'"$SHELL"'}' "$[0]" \
-           '-v -d' "$at_debug_args" "$at_group" '${1+"address@hidden"}'
-      echo 'exit 1'
-    } >$as_me.$at_number
-    chmod +x $as_me.$at_number
-  done
-  echo ', done.'
-  echo
   echo 'You may investigate any problem if you feel able to do so, in which'
   echo 'case the test suite provides a good starting point.'
   echo



reply via email to

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