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

Change color output

parent 95640d167955
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@
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 | 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/'
$here/start $update -d $dbname --test-enable $loglevel --max-cron=0 --stop-after-init $* | tee $logfile | sed -e 's/\(.*\) \(INFO\) \(.*\)/\o033[2m\1\o033[22m \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[97m\o033[1mFAILED\o033[0m/' -e 's/ FAIL\(.*\)/ \o033[41m\o033[97m\o033[1mFAIL\o033[49m\o033[31m\1\o033[0m/'
ok=$(grep ' OK' $logfile -c)
# TODO detect yaml tests failures
failed=$(grep ' FAILED' $logfile -c)
......@@ -40,8 +40,8 @@
if [[ $ok -gt 0 ]];
then
echo -e '\033[32mOK:\033[0m'
grep ' OK' $logfile || true
grep--color=always ' OK' $logfile || true
fi
if [[ $failed -gt 0 ]];
then
echo -e '\033[31mFAILED\033[0m:'
......@@ -44,8 +44,8 @@
fi
if [[ $failed -gt 0 ]];
then
echo -e '\033[31mFAILED\033[0m:'
grep FAILED $logfile
grep --color=always "FAILED\|FAIL:" $logfile
fi
echo ''
rm $logfile
......
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