pass TEST_SHELL and stuff

This commit is contained in:
Thomas Levine 2016-02-28 16:32:06 +00:00
parent e71ac885b4
commit ad3c6b901e

103
urchin
View File

@ -144,61 +144,60 @@ recurse() {
# Determine the environment variable to define for test scripts
# that reflects the specified or implied shell to use for shell-code tests.
if $cycle_shell && has_sh_or_no_shebang_line "$potential_test"; then
# Set it to the shell specified via -s.
while read the_test_shell; do
(
urchin_source setup
# Run the test
start=$(date +%s)
set +e
TEST_SHELL="$the_test_shell" "$the_test_shell" \
"$potential_test" >> \
"$(stdout_file "$potential_test")" 2>&1
exit_code="$?"
set -e
finish=$(date +%s)
urchin_source teardown
if [ $exit_code -eq 0 ]; then
result=ok
elif [ $exit_code -eq 3 ]; then
result=skip
else
result=not_ok
fi
elapsed=$(($finish - $start))
printf "${potential_test}\t${the_test_shell}\t${result}\t${elapsed}\n" \
>> $tmp/log
exit "$exit_code"
) &
if $run_in_series; then
wait $!
exit_code=$?
if $exit_on_not_ok && test $exit_code -ne 0; then
urchin_source teardown_dir
return 1
fi
while read the_test_shell; do
if test -n "$the_test_shell"; then
if has_sh_or_no_shebang_line "$potential_test"; then
the_exec=$the_test_shell
else
the_exec=exec
fi
done < $shell_list
wait
else
echo 'The -n flag is not implemented' > /dev/stderr
exit 1
# 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'
# 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
TEST_SHELL="$the_test_shell" "$the_test_shell" > \
"$(stdout_file "$potential_test")" 2>&1
fi
(
urchin_source setup
# Run the test
start=$(date +%s)
set +e
TEST_SHELL="$the_test_shell" "$the_exec" "$potential_test" >> \
"$(stdout_file "$potential_test")" 2>&1
exit_code="$?"
set -e
finish=$(date +%s)
urchin_source teardown
if [ $exit_code -eq 0 ]; then
result=ok
elif [ $exit_code -eq 3 ]; then
result=skip
else
result=not_ok
fi
elapsed=$(($finish - $start))
printf "${potential_test}\t${the_test_shell}\t${result}\t${elapsed}\n" \
>> $tmp/log
exit "$exit_code"
) &
if $run_in_series; then
wait $!
exit_code=$?
if $exit_on_not_ok && test $exit_code -ne 0; then
urchin_source teardown_dir
return 1
fi
fi
done < $shell_list
wait
else
# Shell is ''
printf "${potential_test}\t\tskip\t0\n" >> $tmp/log