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. > * tests/config-shell-tests.sh: New file, driver script to run > checks on the shell scripts in `lib/' using the $SHELL determined > at configure time instead of the default system shell /bin/sh. > * Makefile.am (TESTS_EXTENSIONS): Add `.shtst'. > (SHTST_LOG_COMPILER): Define, it calls `config-shell-tests.sh'. > (config_shell_tests): Define to a list of tests that wraps other > `*.test' tests using `config-shell-tests.sh'. > ($(config_shell_tests)): Dummy dependency declaration required > in order to have make actually produce expected log files from > the `.shtst.log' suffix rule. > (EXTRA_DIST): Distribute `config-shell-tests.sh'. > (TESTS): Add `$(config_shell_tests)'. > --- > ChangeLog | 26 +++++++++++++++++++++ > tests/Makefile.am | 29 +++++++++++++++++++++++ > tests/Makefile.in | 40 +++++++++++++++++++++++++++++--- > tests/config-shell-tests.sh | 53 > +++++++++++++++++++++++++++++++++++++++++++ > tests/defs-static.in | 4 ++- > 5 files changed, 147 insertions(+), 5 deletions(-) > create mode 100755 tests/config-shell-tests.sh > And I've sqashed in the following tiny addition to the self tests:
diff --git a/ChangeLog b/ChangeLog index 764916b..9c88d7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,8 @@ the `.shtst.log' suffix rule. (EXTRA_DIST): Distribute `config-shell-tests.sh'. (TESTS): Add `$(config_shell_tests)'. + * tests/self-check-env-sanitize.test: Update, by checking that + `test_prefer_config_shell' isn't exported in the environment. 2011-06-07 Stefano Lattarini <stefano.lattar...@gmail.com> diff --git a/tests/self-check-env-sanitize.test b/tests/self-check-env-sanitize.test index 169f003..9dc97be 100755 --- a/tests/self-check-env-sanitize.test +++ b/tests/self-check-env-sanitize.test @@ -23,7 +23,9 @@ set -x exec 5>&1 -for var in me parallel_tests required original_AUTOMAKE original_ACLOCAL; do +for var in me parallel_tests required original_AUTOMAKE original_ACLOCAL \ + test_prefer_config_shell +do env "$var=foo" $SHELL -c '. ./defs' foo.test && exit 1 env "$var=foo" $SHELL -c '. ./defs' foo.test 2>&1 1>&5 \ | grep "foo\.test:.* variable \`$var'.* in the environment.*unsafe" || exit 1 I'll push tomorrow if there is no objection. Regards, Stefano