From 942379cc3862ca20003ccea44edff90e6a13b314 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Tue, 19 Apr 2011 22:57:39 +0200 Subject: [PATCH] tests: in self-checks, use $SHELL, not /bin/sh * tests/self-check-me-in-env.test: Include `./defs-static' to get the definition of `$SHELL'. Use `$SHELL' instead of `/bin/sh' to execute the tests. --- ChangeLog | 7 +++++++ tests/self-check-me-in-env.test | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ea78a280..6aeafd510 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-04-19 Stefano Lattarini + + tests: in self-checks, use $SHELL, not /bin/sh + * tests/self-check-me-in-env.test: Include `./defs-static' to get + the definition of `$SHELL'. Use `$SHELL' instead of `/bin/sh' to + execute the tests. + 2011-04-19 Stefano Lattarini tests: prefer AM_TESTS_ENVIRONMENT to TESTS_ENVIRONMENT diff --git a/tests/self-check-me-in-env.test b/tests/self-check-me-in-env.test index 344a861b8..966088dcf 100755 --- a/tests/self-check-me-in-env.test +++ b/tests/self-check-me-in-env.test @@ -18,11 +18,13 @@ # Make sure that the testsuite initialization code complains when # $me is set in the environment. +. ./defs-static || exit 1 + set -x exec 5>&1 -env me=foo /bin/sh -c '. ./defs' foo.test && exit 1 -env me=foo /bin/sh -c '. ./defs' foo.test 2>&1 1>&5 \ +env me=foo $SHELL -c '. ./defs' foo.test && exit 1 +env me=foo $SHELL -c '. ./defs' foo.test 2>&1 1>&5 \ | grep "variable \`me' is set in the environment.*unsafe" || exit 1 : -- 2.47.2