Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions tutorials/run_tutorial_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ status=()
RED="\033[31;1m" #bold red
GREEN="\033[32;1m" #bold green
BLUE="\033[34;1m" # bold blue
MAGENTA="\033[35;1m" # bold blue
BOLD="\033[1m"
CLEAR="\033[0m"
UNDERLINE="\033[4m"
Expand All @@ -71,7 +72,7 @@ for t in */tests.txt; do

test_result=0
for script in $(cat tests.txt); do
printf " ${script}: "
printf " ${script}: ${MAGENTA}"

if [ ! -e "scripts/${script}" ] ; then
echo "script '${script}' from ${t} is missing!"
Expand All @@ -90,15 +91,18 @@ for t in */tests.txt; do
)
${rb_exec} -b scripts/cp_$script &> "output/${script%.[Rr]ev}.errout"
script_result="$?"

printf "${CLEAR}"
if [ "${script_result}" = 139 ]; then
script_result="SEGFAULT"
elif [ "${script_result}" = 134 ]; then
script_result="Aborted"
elif [ "${script_result}" != 0 ]; then
script_result="error ${script_result}"
fi

if [ "${script_result}" != 0 ] ; then
script_result="${script}=${script_result}"
script_result="${script}: ${script_result}"
echo
tail -n 5 "output/${script%.[Rr]ev}.errout" | sed "s/^/ ${BLUE2}|${CLEAR2} /g"
printf "\n ${RED}FAIL${CLEAR}: ${script_result}\n"
echo
Expand All @@ -120,7 +124,7 @@ for t in */tests.txt; do

done

printf "\n\n#### Checking output from tests... \n"
printf "\n\n${BOLD}#### Checking output from tests... ${CLEAR}\n"
xfailed=0
failed=0
pass=0
Expand All @@ -132,25 +136,25 @@ while [ $i -lt ${#tests[@]} ]; do
if [ "${status[$i]}" != 0 ]; then
if [ -f XFAIL ] ; then
((xfailed++))
printf ">>>> Test ${RED}failed${CLEAR}: $t (expected)\n"
printf ">>>> Test ${RED}failed${CLEAR}: ${UNDERLINE}$t${CLEAR} (expected)\n"
else
((failed++))
printf ">>>> Test ${RED}failed${CLEAR}: $t\n"
printf ">>>> Test ${RED}failed${CLEAR}: ${UNDERLINE}$t${CLEAR}\n"
fi
printf "${status[$i]}"
else
((pass++))
printf "#### Test passed: $t\n"
printf "#### Test ${GREEN}passed${CLEAR}: ${UNDERLINE}$t${CLEAR}\n"
fi

((i++))
done


if [ $failed -gt 0 ]; then
printf "\n\n#### Warning! unexpected failures: $failed expected failures: $xfailed total tests: $i\n\n"
printf "${BOLD}\n\n#### ${MAGENTA}Warning!${CLEAR}${BOLD} unexpected failures: ${RED}$failed${CLEAR}${BOLD} expected failures: $xfailed total tests: $i\n\n${CLEAR}"
exit 113
else
printf "\n\n#### Success! unexpected failures: $failed expected failures: $xfailed total tests: $i\n\n"
printf "\n\n#### All tests passed.\n\n"
printf "${BOLD}\n\n#### ${GREEN}Success!${CLEAR}${BOLD} unexpected failures: $failed expected failures: $xfailed total tests: $i\n\n${CLEAR}"
printf "${BOLD}\n\n#### All tests passed.\n\n${CLEAR}"
fi
1 change: 0 additions & 1 deletion tutorials/sse/tests.txt

This file was deleted.