On Monday 06 June 2011, Stefano Lattarini wrote:
> With the previous commit, the user could prefer the use of $SHELL
> over /bin/sh in some tests checking the Automake-provided shell
> scripts by manually exporting `test_prefer_config_shell' to "yes"
> in the environment.  With this commit, we ensure that such tests
> *always* and *transparently* run using both $SHELL and /bin/sh
> to execute the checked scripts.  The `test_prefer_config_shell'
> variable becomes an internal detail, and is no more meant to be
> manually defined or overridden.
> 
> * tests/defs-static.in: Check that `test_prefer_config_shell' is
> not exported in the environment.  Error out if this is the case.
>
[HUGE SNIP]

> diff --git a/tests/defs-static.in b/tests/defs-static.in
> index 53d9f93..17ed284 100644
> --- a/tests/defs-static.in
> +++ b/tests/defs-static.in
> @@ -70,7 +70,9 @@ fi
>  # Check that the environment is properly sanitized.
>  # Having variables exported to the empty string is OK, since our code
>  # treats such variables as if they were unset.
> -for var in me required parallel_tests original_AUTOMAKE original_ACLOCAL; do
> +for var in me required parallel_tests test_prefer_config_shell \
> +           original_AUTOMAKE original_ACLOCAL
> +do
>    if eval "test x\"\$$var\" != x" && env | grep "^$var=" >/dev/null; then
>      echo "$argv0: variable \`$var' is set in the environment:" \
>           "this is unsafe" >&2
> 
Hmpf, this should have been complemented by a proper addition to
AM_TEST_ENVIRONMENT in tests/Makefile.am.  I will sooninsh apply
the attached follow-up patch if there is no objection.

Regards,
  Stefano
From 8dbdca111d25761a350c598f7a702c7dc5d3b24b Mon Sep 17 00:00:00 2001
Message-Id: <8dbdca111d25761a350c598f7a702c7dc5d3b24b.1307982004.git.stefano.lattar...@gmail.com>
From: Stefano Lattarini <stefano.lattar...@gmail.com>
Date: Mon, 13 Jun 2011 18:19:53 +0200
Subject: [PATCH] tests: remove 'test_prefer_config_shell' from the environment

Since commit `v1.11-910-g7df1a9b', the once user-overridable
variable `$test_prefer_config_shell' has become an internal
detail, and the test scripts now complain and bail out if it is
set in the environment.

* tests/Makefile.am (AM_TESTS_ENVIRONMENT): Unset the variable
`test_prefer_config_shell' if it is set in the environment.
---
 ChangeLog         |   10 ++++++++++
 tests/Makefile.am |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d8ca3bc..f72eaac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-06-13  Stefano Lattarini  <stefano.lattar...@gmail.com>
 
+	tests: remove 'test_prefer_config_shell' from the environment
+	Since commit `v1.11-910-g7df1a9b', the once user-overridable
+	variable `$test_prefer_config_shell' has become an internal
+	detail, and the test scripts now complain and bail out if it is
+	set in the environment.
+	* tests/Makefile.am (AM_TESTS_ENVIRONMENT): Unset the variable
+	`test_prefer_config_shell' if it is set in the environment.
+
+2011-06-13  Stefano Lattarini  <stefano.lattar...@gmail.com>
+
 	tests: autogenerate list of wrapped tests for `lib/' shell scripts
 	* tests/gen-config-shell-tests: New script, generates distributed
 	makefile snippet `tests/config-shell-tests.am' to list all tests
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f66a093..f0c4e6a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -122,6 +122,7 @@ AM_TESTS_ENVIRONMENT = \
   test x"$$me" = x || unset me; \
   test x"$$required" = x || unset required; \
   test x"$$parallel_tests" = x || unset parallel_tests; \
+  test x"$$test_prefer_config_shell" || unset test_prefer_config_shell; \
   test x"$$original_AUTOMAKE" = x || unset original_AUTOMAKE; \
   test x"$$original_ACLOCAL" = x || unset original_ACLOCAL; \
   AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC; \
-- 
1.7.2.3

Reply via email to