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