refactor
This commit is contained in:
parent
7dc70982e5
commit
f4b66881f6
32
urchin
32
urchin
|
@ -315,6 +315,12 @@ format_tap() {
|
||||||
$(verbosity v 2 print_not_ok_stdout)
|
$(verbosity v 2 print_not_ok_stdout)
|
||||||
$(verbosity v 3 print_ok_stdout)
|
$(verbosity v 3 print_ok_stdout)
|
||||||
|
|
||||||
|
print_stdout() {
|
||||||
|
echo '# ------------ Begin output ------------'
|
||||||
|
sed 's/^/# /' "$(stdout_file "${path}" "${the_shell}")"
|
||||||
|
echo '# ------------ End output ------------'
|
||||||
|
}
|
||||||
|
|
||||||
while IFS="${HT}" read remote the_shell path result file_elapsed; do
|
while IFS="${HT}" read remote the_shell path result file_elapsed; do
|
||||||
# Number of files that have run, including this one
|
# Number of files that have run, including this one
|
||||||
n=$(( ${n:-0} + 1))
|
n=$(( ${n:-0} + 1))
|
||||||
|
@ -323,23 +329,17 @@ format_tap() {
|
||||||
the_shell='File is not executable.'
|
the_shell='File is not executable.'
|
||||||
fi
|
fi
|
||||||
case "${result}" in
|
case "${result}" in
|
||||||
ok) "ok $n - ${path} (${the_shell}${remote})" ;;
|
ok) echo "ok $n - ${path} (${the_shell}${remote})"
|
||||||
not_ok) "not_ok $n - ${path} (${the_shell}${remote})" ;;
|
if "${print_ok_stdout}"; then print_stdout; fi ;;
|
||||||
|
not_ok) echo "not_ok $n - ${path} (${the_shell}${remote})"
|
||||||
|
if "${print_not_ok_stdout}"; then print_stdout; fi ;;
|
||||||
skip) "ok $n - ${path} (${the_shell}${remote}) # SKIP" ;;
|
skip) "ok $n - ${path} (${the_shell}${remote}) # SKIP" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if { test "${result}" = not_ok && "${print_not_ok_stdout}"; } ||
|
|
||||||
{ test "${result}" = ok && "${print_ok_stdout}"; }; then
|
|
||||||
echo '# ------------ Begin output ------------'
|
|
||||||
sed 's/^/# /' "$(stdout_file "${path}" "${the_shell}")"
|
|
||||||
echo '# ------------ End output ------------'
|
|
||||||
fi
|
|
||||||
echo "# Previous test took ${file_elapsed} seconds."
|
echo "# Previous test took ${file_elapsed} seconds."
|
||||||
|
|
||||||
# Number of files that have been ok, not ok, and skipped
|
# Number of files that have been ok, not ok, and skipped
|
||||||
eval "old_count=${result}s"
|
eval "old_count=${result}s"
|
||||||
eval "${result}s=$(($old_count+1))"
|
eval "${result}s=$(($old_count+1))"
|
||||||
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,6 +372,10 @@ format_urchin() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_stdout() {
|
||||||
|
sed 's/^/ | /' "$(stdout_file "${path}" "${the_shell}")"
|
||||||
|
}
|
||||||
|
|
||||||
while IFS="${HT}" read remote the_shell path result file_elapsed; do
|
while IFS="${HT}" read remote the_shell path result file_elapsed; do
|
||||||
abspath=${urchin_tmp}/${path}
|
abspath=${urchin_tmp}/${path}
|
||||||
|
|
||||||
|
@ -390,17 +394,13 @@ format_urchin() {
|
||||||
fi ;;
|
fi ;;
|
||||||
not_ok) if "${print_not_ok}"; then
|
not_ok) if "${print_not_ok}"; then
|
||||||
header && echo "${fail_mark} ${message}"
|
header && echo "${fail_mark} ${message}"
|
||||||
|
if "${print_not_ok_stdout}"; then print_stdout; fi
|
||||||
fi ;;
|
fi ;;
|
||||||
skip) if "${print_ok}"; then
|
skip) if "${print_ok}"; then
|
||||||
header && echo "${skip_mark} ${message}"
|
header && echo "${skip_mark} ${message}"
|
||||||
|
if "${print_ok_stdout}"; then print_stdout; fi
|
||||||
fi ;;
|
fi ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if { test "${result}" = not_ok && "${print_not_ok_stdout}"; } ||
|
|
||||||
{ test "${result}" = ok && "${print_ok_stdout}"; }; then
|
|
||||||
sed 's/^/ | /' "$(stdout_file "${path}" "${the_shell}")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
prevpath="${path}"
|
prevpath="${path}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue