Code coverage with Google Test

5,455 views
Skip to first unread message

Mf_Soul

unread,
Oct 17, 2013, 10:16:53 PM10/17/13
to googletes...@googlegroups.com
Hello All,
I am using Google test to test embedded application C code. I know google test does not provide any code coverage capability. Are there any tools available which works seemlessly with google test. Your help is greatly appreciated.
Thanks 

tom

unread,
Oct 18, 2013, 7:05:50 AM10/18/13
to googletes...@googlegroups.com
Hi,

I have done code coverage analysis with gtest, gcc and gcov. 
Message has been deleted

Ed of the Mountain

unread,
Oct 18, 2013, 10:19:30 AM10/18/13
to googletes...@googlegroups.com
I too would love to hear feedback on code coverage tools.  I saw someone mention Coverity the other day.  This tools seems very smart probably very expensive but could be worth it in some applications.  If using gnu tool set then gcov sounds good ( thanks Tom! ).  I may support for gnu, Microsoft, IAR, and TI embedded ARM compilers.

Question: Is it bad practice to target one compiler for release ( MSVC or an embedded compiler ), but use another for unit test and code coverage ( gcc, gtest, gcov ) ?  Has anyone done this?

-Ed

jmec...@gmail.com

unread,
Oct 18, 2013, 1:44:25 PM10/18/13
to Ed of the Mountain, googletes...@googlegroups.com
we are using gtest, bullseye and sonar with sonar cxx plugin to aglomerate everythig. we feed unit and integration coverage and then merge all to produce a overall coverage in sonar.. works nicely

Sent from my iPad
--
 
---
You received this message because you are subscribed to the Google Groups "Google C++ Testing Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to googletestframe...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ed Sutton

unread,
Oct 18, 2013, 2:26:47 PM10/18/13
to googletes...@googlegroups.com
Thank you for the feedback.

Bullseye keeps coming up when researching C++ code coverage.

I thought sonar was a java tool but it it looks like it has many language plugins.  I am unclear if SonarQube is an alternative to Jenkins or something that integrates with Jenkins.  I need to install SonarQube and try to do something with it.

Thanks again,

-Ed

jmec...@gmail.com

unread,
Oct 18, 2013, 4:46:53 PM10/18/13
to Ed Sutton, googletes...@googlegroups.com
altough jenkins can show some information its not meant to tackle technical debt as sonar is. normally you would use jenkins as your ci system and sonar as your continuos inspection engine. 

if you use msbuild you can use some of my msbuild tasks https://github.com/jmecosta/MSBuild-SonarQube-CXX you can try the samples. to get coverage you still need to produce the xml externally
Sent from my iPad
Reply all
Reply to author
Forward
0 new messages