autoconf-patches
[Top][All Lists]
Advanced

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

/floppy/acp/86-fyi-standalone-autotest-1.patch


From: Akim Demaille
Subject: /floppy/acp/86-fyi-standalone-autotest-1.patch
Date: Fri, 07 Sep 2001 09:26:01 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        
        Move toward possibly stand-alone test suites.
        
        * lib/autotest/general.m4: Stop displaying srcdir everywhere as,
        in addition, it introduces useless differences in logs.
        (AT_INIT): Let atconfig and atlocal be both optional.
        Adjust PATH computation.
        * lib/m4sugar/m4sh.m4 (AS_UNAME): More readable display of PATH.
        
Index: lib/autotest/general.m4
--- lib/autotest/general.m4 Tue, 04 Sep 2001 17:14:25 +0200 akim
+++ lib/autotest/general.m4 Thu, 06 Sep 2001 21:36:34 +0200 akim
@@ -110,7 +110,12 @@ m4_define([AT_data_files], [stdout expou
 at_cli_args=${1+"address@hidden"}
 at_debug_args=
 
-. ./atconfig
+# Load the config file.
+for at_file in atconfig atlocal
+do
+  test -r $at_file || continue
+  . ./$at_file || AS_ERROR([invalid content: $at_file])
+done
 
 # Use absolute file notations, as the test might change directories.
 at_srcdir=`cd "$srcdir" && pwd`
@@ -232,6 +237,56 @@ Tests:
 # Tests to run.
 test -z "$at_tests" && at_tests=$at_tests_all
 
+# Don't take risks: use only absolute directories in PATH.
+#
+# For stand-alone test suites, AUTOTEST_PATH is relative to `.'.
+#
+# For embedded test suites, AUTOTEST_PATH is relative to the top level
+# of the package.  Then expand it into build/src parts, since users
+# may create executables in both places.
+#
+# There might be directories that don't exist, but don't redirect
+# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
+at_IFS_save=$IFS
+IFS=$PATH_SEPARATOR
+at_path=
+for at_dir in $AUTOTEST_PATH $PATH
+do
+  case $at_dir in
+    [[\\/]]* | ?:[[\\/]]* )
+      at_path=$at_path$PATH_SEPARATOR$at_dir
+      ;;
+    * )
+      if test -z "$top_builddir"; then
+        # Stand-alone test suite.
+        at_path=$at_path$PATH_SEPARATOR$at_dir
+      else
+        # Embbeded test suite.
+        at_path=$at_path$PATH_SEPARATOR$top_builddir/$at_dir
+        at_path=$at_path$PATH_SEPARATOR$top_srcdir/$at_dir
+      fi
+      ;;
+  esac
+done
+# Now build and simplify PATH.
+at_sep=
+PATH=
+for at_dir in $at_path
+do
+  at_dir=`(cd "$at_dir" && pwd) 2>/dev/null`
+  test -d "$at_dir" || continue
+  case $PATH in
+                    $at_dir                 | \
+                    $at_dir$PATH_SEPARATOR* | \
+    *$PATH_SEPARATOR$at_dir                 | \
+    *$PATH_SEPARATOR$at_dir$PATH_SEPARATOR* ) ;;
+    *) PATH=$PATH$at_sep$at_dir
+       at_sep=$PATH_SEPARATOR;;
+  esac
+done
+IFS=$at_IFS_save
+export PATH
+
 # Can we diff with `/dev/null'?  DU 5.0 refuses.
 if diff /dev/null /dev/null >/dev/null 2>&1; then
   at_devnull=/dev/null
@@ -262,46 +317,6 @@ Tests:
   exec 6>$as_me.log
 fi
 
-# Load the user config file before checking the PATH.
-test -r ./atlocal && . ./atlocal
-
-# Don't take risks: use only absolute directories in PATH.
-# AUTOTEST_PATH is expanded into build/src parts, since users
-# may create executables in both places.
-#
-# There might be directories that don't exist, but don't redirect
-# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
-at_IFS_save=$IFS
-IFS=$PATH_SEPARATOR
-at_sep=
-at_path=
-for at_dir in $AUTOTEST_PATH $PATH
-do
-  case $at_dir in
-    [[\\/]]* | ?:[[\\/]]* )
-      if test -d "$at_dir"; then
-        at_path="$at_path$at_sep$at_dir"
-        at_sep=$PATH_SEPARATOR
-      fi
-      ;;
-    * )
-      at_build_dir=`(cd "$top_builddir/$at_dir" && pwd) 2>/dev/null`
-      if test -d "$at_build_dir"; then
-        at_path="$at_path$at_sep$at_build_dir"
-        at_sep=$PATH_SEPARATOR
-      fi
-      at_src_dir=`(cd "$top_srcdir/$at_dir" && pwd) 2>/dev/null`
-      if test -d "$at_src_dir"; then
-        at_path="$at_path$at_sep$at_src_dir"
-        at_sep=$PATH_SEPARATOR
-      fi
-      ;;
-  esac
-done
-IFS=$at_IFS_save
-PATH=$at_path
-export PATH
-
 # Tester and tested.
 if $1 --version | grep "$at_package.*$at_version" >/dev/null; then
   AS_BOX([Test suite for $at_package $at_version])
@@ -336,13 +351,13 @@ Tests:
       -exec echo ';'
 
     # Inform about the contents of the config files.
-    echo "$as_me: atconfig:" >&6
-    sed 's/^/| /' atconfig >&6
-    if test -r ./atlocal; then
-      echo "$as_me: atlocal:" >&6
-      sed 's/^/| /' atlocal >&6
-    fi
-    echo
+    for at_file in atconfig atlocal
+    do
+      test -r $at_file || continue
+      echo "$as_me: $at_file:" >&6
+      sed 's/^/| /' $at_file >&6
+      echo
+    done
 
     AS_BOX([Silently running the tests])
   } >&6
@@ -386,7 +401,7 @@ Tests:
        echo "$at_setup_line" >at-check-line
       fi
       at_test_count=`expr 1 + $at_test_count`
-      $at_verbose $at_n "$at_test. $srcdir/$at_setup_line: $at_c"
+      $at_verbose $at_n "$at_test. $at_setup_line: $at_c"
       case $at_status in
         0) at_msg="ok"
            ;;
@@ -398,7 +413,7 @@ Tests:
            ;;
       esac
       echo $at_msg
-      at_log_msg="$at_test. $srcdir/$at_setup_line: $at_msg"
+      at_log_msg="$at_test. $at_setup_line: $at_msg"
       # If the test failed, at-times is not available.
       test -f at-times && at_log_msg="$at_log_msg      (`sed 1d at-times`)"
       echo "$at_log_msg" >&6
@@ -514,7 +529,7 @@ m4_define([AT_SETUP],
 m4_divert_push([TESTS])dnl
   AT_ordinal ) @%:@ AT_ordinal. AT_LINE: $1
     at_setup_line='AT_LINE'
-    $at_verbose "AT_ordinal. $srcdir/AT_LINE: testing $1..."
+    $at_verbose "AT_ordinal. AT_LINE: testing $1..."
     $at_quiet $at_n "m4_format([[%3d: %-18s]], AT_ordinal, AT_LINE)[]$at_c"
     (
       $at_traceon
@@ -677,7 +692,7 @@ m4_define([AT_DATA],
 #
 m4_define([AT_CHECK],
 [$at_traceoff
-$at_verbose "$srcdir/AT_LINE: AS_ESCAPE([$1])"
+$at_verbose "AT_LINE: AS_ESCAPE([$1])"
 echo AT_LINE >at-check-line
 ( $at_traceon; $1 ) >at-stdout 2>at-stder1
 at_status=$?
@@ -709,7 +724,7 @@ m4_define([AT_CHECK],
   [ignore],
     [   *);;],
     [   m4_default([$2], [0])) ;;
-   *) $at_verbose "$srcdir/AT_LINE: exit code was $at_status, expected 
m4_default([$2], [0])" >&2
+   *) $at_verbose "AT_LINE: exit code was $at_status, expected 
m4_default([$2], [0])" >&2
       at_failed=:;;])
 esac
 AS_IF($at_failed, [$5], [$6])
Index: lib/m4sugar/m4sh.m4
--- lib/m4sugar/m4sh.m4 Thu, 23 Aug 2001 21:34:53 +0200 akim
+++ lib/m4sugar/m4sh.m4 Thu, 06 Sep 2001 21:07:51 +0200 akim
@@ -570,9 +570,15 @@ m4_define([AS_UNAME],
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
 
-PATH = $PATH
-
 _ASUNAME
+
+as_save_IFS=$IFS
+IFS=:
+for as_dir in $PATH
+do
+  echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
 }])
 
 



reply via email to

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