[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] {testsuite-work} tests: `lib/' shell scripts transparent
From: |
Stefano Lattarini |
Subject: |
Re: [PATCH 3/3] {testsuite-work} tests: `lib/' shell scripts transparently tested also with $SHELL |
Date: |
Tue, 7 Jun 2011 23:16:49 +0200 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
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 <address@hidden>
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
- Re: [PATCH] {testsuite-work} tests: new test dedicated to `--add-missing' and `--copy' (was: Re: [PATCH 2/3] {testsuite-work} tests: can use also $SHELL to check shell scripts from `lib/'), (continued)
- Re: [PATCH] {testsuite-work} tests: new test dedicated to `--add-missing' and `--copy' (was: Re: [PATCH 2/3] {testsuite-work} tests: can use also $SHELL to check shell scripts from `lib/'), Stefano Lattarini, 2011/06/08
- Re: [PATCH] {testsuite-work} tests: new test dedicated to `--add-missing' and `--copy' (was: Re: [PATCH 2/3] {testsuite-work} tests: can use also $SHELL to check shell scripts from `lib/'), Stefano Lattarini, 2011/06/10
- Re: [PATCH] {testsuite-work} tests: new test dedicated to `--add-missing' and `--copy' (was: Re: [PATCH 2/3] {testsuite-work} tests: can use also $SHELL to check shell scripts from `lib/'), Stefano Lattarini, 2011/06/12
- [PATCH] {testsuite-work} tests: extend tests on `--add-missing' and `--copy' a bit, Stefano Lattarini, 2011/06/13
- Re: [PATCH] {testsuite-work} tests: extend tests on `--add-missing' and `--copy' a bit, Stefano Lattarini, 2011/06/16
[PATCH 3/3] {testsuite-work} tests: `lib/' shell scripts transparently tested also with $SHELL, Stefano Lattarini, 2011/06/06
Re: [PATCH 3/3] {testsuite-work} tests: `lib/' shell scripts transparently tested also with $SHELL,
Stefano Lattarini <=
[PATCH] {testsuite-work} tests: remove 'test_prefer_config_shell' from the environment (was: Re: [PATCH 3/3] {testsuite-work} tests: `lib/' shell scripts transparently tested also with $SHELL), Stefano Lattarini, 2011/06/13
Re: [PATCH 0/3] {testsuite-work} Test automake-provided shell scripts (those in `lib/') also with $SHELL, not only with /bin/sh, Stefano Lattarini, 2011/06/08