separate stdout files by shell

This commit is contained in:
Thomas Levine 2016-02-28 20:31:17 +00:00
parent 2ce27acf95
commit 7ab322923a

15
urchin
View File

@ -24,9 +24,12 @@ urchin_exit() {
} }
stdout_file() { stdout_file() {
x="$urchin_tmp/stdout$(fullpath "$1")" the_test="$1"
mkdir -p "$(dirname -- "$x")" the_shell="$2"
echo "$x"
x="$urchin_tmp/stdout$(fullpath "$the_test")"
mkdir -p "$x"
echo "$x/$(echo "$the_shell" | md5sum | cut -d\ -f1)"
} }
# Expand relative paths # Expand relative paths
@ -161,7 +164,7 @@ recurse() {
else else
TEST_SHELL="$the_test_shell" "$potential_test" TEST_SHELL="$the_test_shell" "$potential_test"
fi fi
} > "$(stdout_file "$potential_test")" 2>&1 } > "$(stdout_file "$potential_test" "$the_test_shell")" 2>&1
exit_code="$?" exit_code="$?"
set -e set -e
finish=$(date +%s) finish=$(date +%s)
@ -257,7 +260,7 @@ report_outcome() {
echo "${not}ok $n - ${path} ($the_shell) ${skip}" echo "${not}ok $n - ${path} ($the_shell) ${skip}"
if [ "$result" = not_ok ]; then if [ "$result" = not_ok ]; then
echo '# ------------ Begin output ------------' echo '# ------------ Begin output ------------'
sed 's/^/# /' "$(stdout_file "$abspath")" sed 's/^/# /' "$(stdout_file "$abspath" "$the_shell")"
echo '# ------------ End output ------------' echo '# ------------ End output ------------'
fi fi
echo "# Previous test took $file_elapsed seconds." echo "# Previous test took $file_elapsed seconds."
@ -282,7 +285,7 @@ report_outcome() {
# Print output captured from not_ok test in red. # Print output captured from not_ok test in red.
printf '\033[31m' printf '\033[31m'
sed 's/^/ # /' "$(stdout_file "$abspath")" sed 's/^/ # /' "$(stdout_file "$abspath" "$the_shell")"
printf '\033[0m' printf '\033[0m'
;; ;;
skip) skip)