autoconf-commit
[Top][All Lists]
Advanced

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

[SCM] GNU Autoconf source repository branch, master, updated. v2.61a-350


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.61a-350-g372769c
Date: Tue, 29 Jan 2008 05:54:56 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=372769ca9eb0c5db10aac8173906116b5a260356

The branch, master has been updated
       via  372769ca9eb0c5db10aac8173906116b5a260356 (commit)
      from  a0d6f350fee9d91382295e89d7cc50dc2a2cfadc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 372769ca9eb0c5db10aac8173906116b5a260356
Author: Eric Blake <address@hidden>
Date:   Mon Jan 28 22:42:17 2008 -0700

    Fix regression in handling VAR=VALUE arguments to testsuite.
    
    * lib/autotest/general.m4 (AT_INIT) <PARSE_ARGS_END>: Detect
    leading = as invalid.  Defer use of command-line variable
    assignments...
    <PREPARE_TESTS>: ...here, after atconfig has been sourced.  Fix
    regression in sourcing files.
    * tests/autotest.at (Using atlocal): New test to catch this.
    (Debugging a successful test, Choosing where testsuite is run):
    Use correct shell.
    Reported by Ralf Wildenhues.
    
    Signed-off-by: Eric Blake <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog               |   11 ++++++++++
 lib/autotest/general.m4 |   13 +++++++----
 tests/autotest.at       |   51 +++++++++++++++++++++++++++++++++++++++-------
 3 files changed, 62 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a3f52fe..42da03c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2008-01-28  Eric Blake  <address@hidden>
 
+       Fix regression in handling VAR=VALUE arguments to testsuite.
+       * lib/autotest/general.m4 (AT_INIT) <PARSE_ARGS_END>: Detect
+       leading = as invalid.  Defer use of command-line variable
+       assignments...
+       <PREPARE_TESTS>: ...here, after atconfig has been sourced.  Fix
+       regression in sourcing files.
+       * tests/autotest.at (Using atlocal): New test to catch this.
+       (Debugging a successful test, Choosing where testsuite is run):
+       Use correct shell.
+       Reported by Ralf Wildenhues.
+
        Document grep peculiarity.
        * doc/autoconf.texi (Limitations of Usual Tools) <grep>: Document
        BSD behavior on binary input.
diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
index 662f2cb..25b2d36 100644
--- a/lib/autotest/general.m4
+++ b/lib/autotest/general.m4
@@ -569,12 +569,12 @@ m4_divert_push([PARSE_ARGS_END])dnl
     *=*)
        at_envvar=`expr "x$at_option" : 'x\([[^=]]*\)='`
        # Reject names that are not valid shell variable names.
-       expr "x$at_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
+       test "x$at_envvar" = "x" ||
+         expr "x$at_envvar" : "[.*[^_$as_cr_alnum]]" >/dev/null &&
          AS_ERROR([invalid variable name: $at_envvar])
        at_value=`AS_ECHO(["$at_optarg"]) | sed "s/'/'\\\\\\\\''/g"`
-       eval "$at_envvar='$at_value'"
+       # Export now, but save eval for later and for debug scripts.
        export $at_envvar
-       # Propagate to debug scripts.
        at_debug_args="$at_debug_args $at_envvar='$at_value'"
        ;;
 
@@ -708,16 +708,19 @@ if $at_change_dir ; then
   at_dir=`pwd`
 fi
 
-# Load the config file.
+# Load the config files for any default variable assignments.
 for at_file in atconfig atlocal
 do
   test -r $at_file || continue
-  . $at_file || AS_ERROR([invalid content: $at_file])
+  . ./$at_file || AS_ERROR([invalid content: $at_file])
 done
 
 # Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
 : ${at_top_build_prefix=$at_top_builddir}
 
+# Perform any assignments requested during argument parsing.
+eval $at_debug_args
+
 # atconfig delivers names relative to the directory the test suite is
 # in, but the groups themselves are run in testsuite-dir/group-dir.
 if test -n "$at_top_srcdir"; then
diff --git a/tests/autotest.at b/tests/autotest.at
index 4fbdba2..2fb36e5 100644
--- a/tests/autotest.at
+++ b/tests/autotest.at
@@ -359,7 +359,7 @@ AT_CHECK_AT_TEST([Debugging a successful test],
   [AT_CHECK([:])], [], [], [], [ignore],
 [# Without options, when all tests pass, no test directory should exist.
 AT_CHECK([test -d micro-suite.dir/1 && exit 42
-          ./micro-suite -d 1], [], [ignore], [ignore])
+          $CONFIG_SHELL ./micro-suite -d 1], [], [ignore], [ignore])
 # Running with -d should leave a reproducible test group.
 # Also, running the test script from the test group locks the
 # directory from removal on some platforms; the script should still be
@@ -396,26 +396,61 @@ AT_CHECK([(cd micro-suite.dir/1 && ./run MY_VAR='one 
space')],
 ])
 
 
+# Setting default variable values via atlocal.
+AT_CHECK_AT_TEST([Using atlocal],
+  [AT_CHECK([test "x$MY_VAR" = xset || exit 42])],
+  [], [1], [ignore], [ignore], [
+dnl check that command line can set variable
+AT_CHECK([$CONFIG_SHELL ./micro-suite MY_VAR=set], [0], [ignore])
+dnl check that command line overrides environment
+AT_CHECK([MY_VAR=set $CONFIG_SHELL ./micro-suite MY_VAR=unset],
+         [1], [ignore], [ignore])
+dnl check that atlocal can give it a default
+AT_CHECK([cat <<EOF >atlocal
+MY_VAR=set
+export MY_VAR
+dnl Also populate enough of atlocal to do what atconfig normally does.
+at_testdir=.
+abs_builddir=`pwd`
+at_srcdir=.
+abs_srcdir=`pwd`
+at_top_srcdir=.
+abs_top_srcdir=`pwd`
+at_top_build_prefix=
+abs_top_builddir=`pwd`
+EOF
+])
+AT_CHECK([$CONFIG_SHELL ./micro-suite], [0], [ignore])
+dnl check that atlocal overrides environment
+AT_CHECK([MY_VAR=unset $CONFIG_SHELL ./micro-suite], [0], [ignore])
+dnl check that command line overrides atlocal
+AT_CHECK([$CONFIG_SHELL ./micro-suite MY_VAR=], [1], [ignore], [ignore])
+dnl check that syntax error is detected
+AT_CHECK([$CONFIG_SHELL ./micro-suite =], [1], [], [ignore], [ignore])
+])
+
+
 # Controlling where the testsuite is run.
 AT_CHECK_AT_TEST([Choosing where testsuite is run],
   [AT_CHECK([:])], [], [], [], [], [
 dnl AT_CHECK_AT_TEST tests the default of running in `.'.
 AT_CHECK([rm micro-suite.log && mkdir sub1 sub2])
 dnl check specifying a different relative path to run in.
-AT_CHECK([./micro-suite -C sub1], [0], [ignore], [])
+AT_CHECK([$CONFIG_SHELL ./micro-suite -C sub1], [0], [ignore], [])
 AT_CHECK([test -f micro-suite.log], [1])
 AT_CHECK([test -f sub1/micro-suite.log], [0])
 dnl check specifying an absolute path to run in.
-AT_CHECK([./micro-suite --directory="`pwd`/sub2"], [0], [ignore], [])
+AT_CHECK([$CONFIG_SHELL ./micro-suite --directory="`pwd`/sub2"],
+         [0], [ignore], [])
 AT_CHECK([test -f micro-suite.log], [1])
 AT_CHECK([test -f sub2/micro-suite.log], [0])
 dnl check for failure detection with bad, missing, or empty directory.
-AT_CHECK([./micro-suite -C nonesuch], [1], [ignore], [ignore])
-AT_CHECK([./micro-suite -C ''], [1], [ignore], [ignore])
-AT_CHECK([./micro-suite -C -], [1], [ignore], [ignore])
-AT_CHECK([./micro-suite -C], [1], [ignore], [ignore])
+AT_CHECK([$CONFIG_SHELL ./micro-suite -C nonesuch], [1], [ignore], [ignore])
+AT_CHECK([$CONFIG_SHELL ./micro-suite -C ''], [1], [ignore], [ignore])
+AT_CHECK([$CONFIG_SHELL ./micro-suite -C -], [1], [ignore], [ignore])
+AT_CHECK([$CONFIG_SHELL ./micro-suite -C], [1], [ignore], [ignore])
 dnl check that --help overrides bad directory selection.
-AT_CHECK([./micro-suite -C nonesuch --help], [0], [ignore], [])
+AT_CHECK([$CONFIG_SHELL ./micro-suite -C nonesuch --help], [0], [ignore], [])
 ])
 
 


hooks/post-receive
--
GNU Autoconf source repository




reply via email to

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