Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to fail build in TeamCity by result of cppcheck analysis

I use cppcheck for static code analysis in my project and TeamCity for continuous integration. It would be nice if build server didn't build the project when cppcheck finds some errors or warnings. Is there any way to make build fail by result of cppcheck analysis?

like image 339
Alex Avatar asked Sep 06 '13 14:09

Alex


2 Answers

I'm a cppcheck dev. The cppcheck command line flag --error-exitcode might help.

like image 164
Daniel Marjamäki Avatar answered Oct 20 '22 12:10

Daniel Marjamäki


The latest version of cppcheck requires that you pass an actual return code to --error-exitcode; otherwise, it fails by telling you no such flag exists.

cppcheck --error-exitcode=1 ...

The above will exit with code 1 in the event something is found.

like image 22
Qix - MONICA WAS MISTREATED Avatar answered Oct 20 '22 14:10

Qix - MONICA WAS MISTREATED