I would like to run cppcheck on our code as part of our build. However, I cannot make it save the output to a file using the command line build step.
From a regular (windows) command prompt the following works fine:
"C:\Program Files\Cppcheck\CppCheck.exe" --enable=all --xml-version=2 "<full_path_with_spaces_to_source>" 2> cppcheck_result.xml
When runing the same from within TeamCity no output file is created! The check is performed and the normal output is seen in the build log, but somehow the 2> is lost. I am using TeamCity version 7.1.1.
I have searched everywhere I could think of,and the closest I could find was this:
But this did not work for me, so any help would be greatly appreciated.
Alternatively, I you know of a better way to run cppcheck and get the results, please let me know.