PDA

View Full Version : Which are the tools for calculating code coverage analysis?



anwar.qt
23rd October 2013, 08:56
Hello Guys,

We are developing a Qt desktop application. We are using QtTestlib to for unit testing of the application.
So we want to calculate the code coverage for the unit tests written.

Configuration is as follows -

1. Operating system - Windows 7
2. Qt Version - 4.8
3. Compiler - MSVC 2008


Which are the tools I can use for code coverage analysis?

wysota
31st October 2013, 09:48
You can use any code coverage tools for your compiler.

This seems to be a good place to start: http://blogs.msdn.com/b/jsocha/archive/2011/08/16/capturing-c-code-coverage-with-visual-c.aspx

AndyBrice
31st October 2013, 12:21
I like CoverageValidator. It gives real time coverage results. It isn't free though.
http://successfulsoftware.net/2008/03/10/coverage-validator/

amandaB
21st February 2014, 06:14
If you're still looking, Squish Coco is a great option. Also not free, but provides great coverage analysis using various types of coverage methods and reports, and also works with Squish GUI Tester, known for it's Qt support.
More about: http://www.froglogic.com/squish/coco/
Webinar on Feb 25th: http://www.froglogic.com/news-events/events/

takmohit9292
28th October 2015, 07:14
Hello Guys,

We are developing a Qt desktop application. We are using QtTestlib to for unit testing of the application.
So we want to calculate the code coverage for the unit tests written.

Configuration is as follows -

1. Operating system - Windows 7
2. Qt Version - 4.8
3. Compiler - MSVC 2008


Which are the tools I can use for code coverage analysis?


Hi,
I too have the same scenario where I need to display the code coverage or even if it generate any file with coverage data then also it is fine. I tried with below options in my pro file but it did not generate any file having code coverage.

QMAKE_CXXFLAGS+= -MP -fprofile-arcs -ftest-coverage -O0
QMAKE_LFLAGS += /MANIFESTUAC:NO

Can you please share the approach , like how did you resolve your issue.

In my case :
Configuration is as follows -

1. Operating system - Windows 7
2. Qt Version - 4.8
3. Compiler - Visual Studio 2010 Compiler (c1)

Note: I am writing my own pro file and after importing it to visual studio I am building it. (FYI)

Thanks in advance :)