Script to filter gcc output for TeamCity


I want to share the script I'm using to filter gcc output for TeamCity. It can be run under Linux, and probably cygwin.


cat - | sed -r -e "s/\|/\|\|/g" \

      | sed -r -e "s/(^.*\.(h|cpp):[0-9]+: warning: (.*))/##teamcity[message text='\1' status='WARNING']/g" \

      | sed -r -e "s/(^.*\.(h|cpp):[0-9]+): error: (.*)/##teamcity[message text='\1' errorDetails='\3' status='ERROR']/g" \

               -e "s/‘/|'/g" \

               -e "s/’/|'/g"


Pass gcc output to this script. Hope this is useful!


Daniel Lidström

Please sign in to leave a comment.