Skip to content
Snippets Groups Projects
Commit e527f0ce authored by Nguyen Anh Quynh's avatar Nguyen Anh Quynh
Browse files

Merge pull request #119 from practicalswift/add-test-status-script

Add test status script.
parents 0398b8db 32947a45
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
readonly COLOR_RED="\e[31m"
readonly COLOR_GREEN="\e[32m"
readonly COLOR_BOLD="\e[1m"
readonly COLOR_NORMAL_DISPLAY="\e[0m"
echo
printf "== %b ==\n" "${COLOR_BOLD}keystone engine crashers${COLOR_NORMAL_DISPLAY}"
echo
num_crashed=0
num_tests=0
for crash_case in $(find . -name "crash-??-*" -not -name "*.sh" -type f | sort -n); do
if [[ ! -x ${crash_case} ]]; then
continue
fi
num_tests=$((num_tests + 1))
{ $crash_case; } > /dev/null 2> /dev/null
if [[ $? == 0 ]]; then
printf " %b %b\n" "${COLOR_GREEN}${COLOR_NORMAL_DISPLAY}" "${crash_case}"
else
num_crashed=$((num_crashed + 1))
printf " %b %b\n" "${COLOR_RED}${COLOR_NORMAL_DISPLAY}" "${crash_case}"
fi
done
if [[ ${num_tests} == 0 ]]; then
echo "No tests to process. Please run 'make' to build the tests."
echo
exit
fi
echo
printf "** Results: %b of %b tests resulted in a crash **\n" "${COLOR_BOLD}${num_crashed}${COLOR_NORMAL_DISPLAY}" "${COLOR_BOLD}${num_tests}${COLOR_NORMAL_DISPLAY}"
echo
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment