Commit 6e9e324f authored by Maximilien Colange's avatar Maximilien Colange

Fix test driver to report TeamCity messages in real-time.

This allows TeamCity to time tests individually.
parent d2de471c
......@@ -106,7 +106,7 @@ trap "st=141; $do_exit" 13
trap "st=143; $do_exit" 15
# Test script is run here.
TC_OUTPUT=`"$@" 2>&1 | awk -v mylog=$log_file '{if (/teamcity/) print ; else print > mylog; }'`
"$@" 2>&1 | tee $log_file
estatus=$?
# estatus should always be 0
......@@ -122,9 +122,9 @@ if test $estatus -ne 0; then
else
# the result of the test is determined by teamcity report messages
# detect them to properly set the status of the test in 'make check' report
if echo "$TC_OUTPUT" | grep "##teamcity\[testIgnored"; then
if grep "##teamcity\[testIgnored" $log_file; then
tweaked_estatus=77
elif echo "$TC_OUTPUT" | grep "##teamcity\[testFailed"; then
elif grep "##teamcity\[testFailed" $log_file; then
tweaked_estatus=1
else
tweaked_estatus=0
......@@ -147,8 +147,6 @@ esac
echo "$res $test_name (exit status: $estatus)" >>$log_file
# Report outcome to console.
# do not forget to report Teamcity service messages
echo "$TC_OUTPUT"
echo "${col}${res}${std}: $test_name"
# Register the test result, and other relevant metadata.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment