pass env variable better i think

This commit is contained in:
Thomas Levine 2016-02-29 02:13:40 +00:00
parent 1f26a67c9e
commit bf19f94c08
2 changed files with 8 additions and 11 deletions

View File

@ -5,4 +5,4 @@
# Test if $TEST_SHELL, when placed in urchin's environment, is passed through to the test scripts.
TEST_SHELL="$PWD/.special-shell" $TEST_SHELL \
../../urchin ./.test-TEST_SHELL-passed-through
../../urchin --disable-cycling ./.test-TEST_SHELL-passed-through

17
urchin
View File

@ -144,15 +144,6 @@ recurse() {
# Determine the environment variable to define for test scripts
# that reflects the specified or implied shell to use for shell-code tests.
while read the_test_shell; do
if test -z "$the_test_shell"; then
# Shell cycling is disabled with -n; use the present value of
# TEST_SHELL or default to /bin/sh
if [ -n "$TEST_SHELL" ]; then
the_test_shell="$TEST_SHELL"
else
the_test_shell=/bin/sh
fi
fi
(
if test -f setup; then . ./setup; fi
@ -165,7 +156,13 @@ recurse() {
TEST_SHELL="$the_test_shell" "$the_test_shell" \
"$potential_test"
else
TEST_SHELL="$the_test_shell" "$potential_test"
# Shell cycling is disabled with -n; use the present value of
# TEST_SHELL or default to /bin/sh
if [ -n "$TEST_SHELL" ]; then
"$potential_test"
else
TEST_SHELL=/bin/sh "$potential_test"
fi
fi
} > "$(stdout_file "$potential_test" "$the_test_shell")" 2>&1
exit_code="$?"