This project is read-only.

OpenCppCoverage start up

Mar 1, 2016 at 12:33 PM
I am new to OpenCppCoverage. I have a qt c++ project in windows, for that I need to check code coverage. So I downloaded the OpenCppCoverage(64-bit) and installed successfully. When I tried to do C:\Program Files\OpenCppCoverage\OpenCppCoverage.exe which returns all usage options. Then I tried : OpenCppCoverage.exe --sources --D:\TESTING_CODE_COVERAG\test_vs --D:\TESTING_CODE_COVERAGE\build-test_vs-Desktop_Qt_5_1_0_MSVC2012_OpenGL_64bit-Debug\debugtest_vs.exe. This time also OpenCppCoverage returns all usage options. Need some clarification, what is doing wrong step am following?
Mar 6, 2016 at 10:54 AM

I think your problem is the "--" between --sources and D:\TESTING_CODE_COVERAG\test_vs.
Note that --sources does not take a path, but a pattern that source's paths should match (mostly a sub part of your path).

Your line should be something like:
OpenCppCoverage.exe --sources D:\TESTING_CODE_COVERAG\test_vs -- D:\TESTING_CODE_COVERAGE\build-test_vs-Desktop_Qt_5_1_0_MSVC2012_OpenGL_64bit-Debug\debugtest_vs.exe
OpenCppCoverage.exe --sources test_vs -- D:\TESTING_CODE_COVERAGE\build-test_vs-Desktop_Qt_5_1_0_MSVC2012_OpenGL_64bit-Debug\debugtest_vs.exe
Hope that help

Mar 29, 2016 at 1:35 PM


I am using OpenCppCoverage tool for line coverage it works fine.
So I tried invoking the tool from qt application and to get the line coverage of desired project.
But there is some problem in report details.

OpenCppCoverage.exe was stored in E: drive
Created QtGUI application was stored in D: drive
And invoking the OpenCppCoverage CLI from Qt application.

I gave command as ..opp//OpenCppCoverage//OpenCppCoverage.exe --sources SourceCode -- ...//Debug//debug//test.exe.

Report generated in build directory of the project location.
Not able to check the modules or source that how many lines are executed. And Also
link are disabled in the html report page.

When I tried externally through windows command prompt. Ther is no problem.

Is there is any solution for this ?

Thanks & regards

Mar 30, 2016 at 12:28 PM

If you are able to run OpenCppCoverage from the command line but not from your qt application, it probably means that you do not use correctly the QT API.
I suggest comparing the log files generated by OpenCppCoverage between the 2 methods and try to have exactly the same values for the argument (and use the same working directory).

Hope that help,

Marked as answer by OpenCppCoverage on 4/19/2016 at 4:39 AM