Automatic commit with j
This commit is contained in:
parent
3d3d277954
commit
aaf4dc9367
19
urchin
19
urchin
@ -39,6 +39,8 @@ indent() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Recurse prints its exit code to stdout so that we don't have to
|
||||||
|
# set +e to read it.
|
||||||
recurse() {
|
recurse() {
|
||||||
potential_test="$1"
|
potential_test="$1"
|
||||||
shell_for_sh_tests="$2"
|
shell_for_sh_tests="$2"
|
||||||
@ -51,7 +53,7 @@ recurse() {
|
|||||||
|
|
||||||
if [ -d "$potential_test" ]; then
|
if [ -d "$potential_test" ]; then
|
||||||
(
|
(
|
||||||
cd -- "$potential_test"
|
cd -- "$potential_test" > /dev/null
|
||||||
[ -f setup_dir ] && . ./setup_dir > /dev/null
|
[ -f setup_dir ] && . ./setup_dir > /dev/null
|
||||||
|
|
||||||
if [ -n "$ZSH_VERSION" ]; then
|
if [ -n "$ZSH_VERSION" ]; then
|
||||||
@ -62,10 +64,7 @@ recurse() {
|
|||||||
for test in *; do
|
for test in *; do
|
||||||
[ -f setup ] && . ./setup > /dev/null
|
[ -f setup ] && . ./setup > /dev/null
|
||||||
|
|
||||||
set +e
|
exit_code=$(recurse "${test}" "$shell_for_sh_tests" "$TEST_SHELL")
|
||||||
recurse "${test}" "$shell_for_sh_tests" "$TEST_SHELL"
|
|
||||||
exit_code=$?
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if $exit_on_fail && test $exit_code -ne 0; then
|
if $exit_on_fail && test $exit_code -ne 0; then
|
||||||
[ -f teardown ] && . ./teardown > /dev/null
|
[ -f teardown ] && . ./teardown > /dev/null
|
||||||
@ -76,7 +75,7 @@ recurse() {
|
|||||||
[ -f teardown ] && . ./teardown > /dev/null
|
[ -f teardown ] && . ./teardown > /dev/null
|
||||||
done
|
done
|
||||||
[ -f teardown_dir ] && . ./teardown_dir > /dev/null
|
[ -f teardown_dir ] && . ./teardown_dir > /dev/null
|
||||||
)
|
) || ( echo 1 && return; )
|
||||||
else
|
else
|
||||||
stdout_file="$tmp/stdout$(urchin_path "$potential_test")"
|
stdout_file="$tmp/stdout$(urchin_path "$potential_test")"
|
||||||
mkdir -p "$(dirname "$stdout_file")"
|
mkdir -p "$(dirname "$stdout_file")"
|
||||||
@ -108,9 +107,10 @@ recurse() {
|
|||||||
|
|
||||||
printf "${potential_test}\t${result}\n" >> "$tmp"/log
|
printf "${potential_test}\t${result}\n" >> "$tmp"/log
|
||||||
if $exit_on_fail && test 0 -ne $exit_code; then
|
if $exit_on_fail && test 0 -ne $exit_code; then
|
||||||
return 1
|
echo 1 && return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
echo 0
|
||||||
}
|
}
|
||||||
|
|
||||||
report_outcome() {
|
report_outcome() {
|
||||||
@ -327,9 +327,8 @@ if fullpath "$1" | grep -Fi 'test' > /dev/null || $force
|
|||||||
# 1 test folder
|
# 1 test folder
|
||||||
# 2 shell to invoke test scripts with
|
# 2 shell to invoke test scripts with
|
||||||
# 3 TEST_SHELL
|
# 3 TEST_SHELL
|
||||||
recurse "$1" "$shell_for_sh_tests" "$TEST_SHELL" || :
|
exit_code=$(recurse "$1" "$shell_for_sh_tests" "$TEST_SHELL")
|
||||||
|
urchin_exit $exit_code
|
||||||
else
|
else
|
||||||
urchin_molly_guard
|
urchin_molly_guard
|
||||||
fi
|
fi
|
||||||
urchin_exit
|
|
||||||
|
Loading…
Reference in New Issue
Block a user