Wednesday, 15 January 2014

googletest - Google Test coverage for Visual Studio 2012 -



googletest - Google Test coverage for Visual Studio 2012 -

i have visual studio 2012 solution builds static library (.lib) (scons build available partially) , tests code written using google test framework (compiled .exe own main() function).

how can test coverage analysis solution from command line using visual studio 2012 built-in tools or free vs2012-unrelated software?

finally i've managed this.

first need instrument *.exe files used run google tests (use /exclude avoid generating coverage unwanted namespaces. investigation shows, '*' wildcard works in end of statements only):

vsinstr.exe" mygtests.exe" /coverage /exclude:std::*

note: need utilize vsinstr proper architecture. utilize total path in case not sure kind of vsinstr default

then need start tests execution monitoring (check architecture too):

vsperfcmd.exe" /start:coverage /output:tests.coverage /cs /user:everyone

after run *.exe file(s) usual.

in end of execution utilize next finish collecting of coverage:

vsperfcmd.exe" -shutdown

you can coverage results in tests.coverage file.

visual-studio-2012 googletest

No comments:

Post a Comment