Skip to content
Snippets Groups Projects
Commit 175b4b033cc2 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

color output on test running

parent 9047872eac21
No related branches found
No related tags found
No related merge requests found
......@@ -29,8 +29,8 @@
loglevel="--log-level=test"
fi
logfile=$(tempfile --suffix=.log)
$here/start $update -d $dbname --test-enable $loglevel --max-cron=0 --stop-after-init $* | tee $logfile
$here/start $update -d $dbname --test-enable $loglevel --max-cron=0 --stop-after-init $* | tee $logfile | sed -e 's/\(.*\) \(INFO\) \(.*\)/\1 \o033[32m\o033[7m\2\o033[27m \3\o033[39m/' -e 's/\(.*\) \(DEBUG\) \(.*\)/\1 \o033[33m\o033[7m\2\o033[27m \2\o033[39m/' -e 's/\(.*\) \(WARNING\) \(.*\)/\1 \o033[33m\o033[7m\2\o033[27m \3\o033[39m/' -e 's/\(.*\) \(ERROR\) \(.*\)/\1 \o033[31m\o033[7m\2\o033[27m \3\o033[0m/' -e 's/\(.*\) \(TEST\) \(.*\)/\1 \o033[34m\o033[7m\2\o033[27m \3 \o033[0m/' -e 's/ FAILED/ \o033[41m\o033[1m\o033[21mFAILED\o033[0m/'
ok=$(grep ' OK' $logfile -c)
# TODO detect yaml tests failures
failed=$(grep ' FAILED' $logfile -c)
echo ''
......@@ -33,9 +33,9 @@
ok=$(grep ' OK' $logfile -c)
# TODO detect yaml tests failures
failed=$(grep ' FAILED' $logfile -c)
echo ''
echo '***** Test results *****'
echo '\e[2m*****\e[22m \e[1mTest results\e[21m \e[2m*****\e[22m'
echo "$ok modules passing, $failed modules failing"
echo ''
if [[ $ok -gt 0 ]];
then
......@@ -38,9 +38,9 @@
echo "$ok modules passing, $failed modules failing"
echo ''
if [[ $ok -gt 0 ]];
then
echo '\tOK:'
echo -e '\033[32mOK:\033[0m'
grep ' OK' $logfile || true
fi
if [[ $failed -gt 0 ]];
then
......@@ -43,8 +43,8 @@
grep ' OK' $logfile || true
fi
if [[ $failed -gt 0 ]];
then
echo '\tFAILED:'
echo -e '\033[31mFAILED\033[0m:'
grep FAILED $logfile
fi
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