Rays February 2016

code coverage that can be along along with QT for C++

I want to use a proper tool for code coverage that is compatible with QT for windows. I tried using GCOV and LCOV but faced some issues.

What are the alternate tools that I can install for free apart from gcov? Thanks in advance

Edit:

My lcov.bat contains

 @echo off
:: Full dirname of current executable
set idir=%~dp0
set perl=C:\Perl\bin\Perl.exe

md "%CD%\gcov"
echo Creating gcov\lcov.info ...
%perl% %idir%lcov.perl -b . -d . -c -o gcov/lcov.info
:: echo Cleaning up ...
:: %perl% %idir%lcov.perl --remove gcov/lcov.info "*_unneeded_*" -o gcov/lcov.info

echo Fixing back slashes ...
type "gcov\lcov.info"|%~dp0repl.bat "\\" "/" >"gcov\lcov.info.tmp"
move /y "gcov\lcov.info.tmp" "gcov\lcov.info" >nul

echo Generating html ...
%perl% %idir%genhtml.perl -o gcov/html/ gcov/lcov.info -p "%CD%"

I am running this through the cmd, but its giving me this error:

.gcda:version '409*', prefer version '501*'
Finished .info-file creation
Fixing back slashes ...
Generating html ...
Reading data file gcov/lcov.info
Found 89 entries.
Using user-specified filename prefix "D:\Pos\build-Tests-Desktop_Qt_5_5_1_M
inGW_32bit-Debug\debug"
Writing .css and .png files.
Generating output.
Skipping mingw!
Skipping mingw!
Skipping mingw!
Skipping mingw!
The syntax of the command is incorrect.
genhtml.perl: ERROR: cannot create directory Pos/build-Tests-Desktop_Qt_5_5
_1_MinGW_32bit-Debug/../Desktop!

Answers


hmuelner February 2016

I use OpenCppCoverage with a MSVC-based Qt. I don't know if it also works for a MinGW-based Qt.

Post Status

Asked in February 2016
Viewed 1,876 times
Voted 4
Answered 1 times

Search




Leave an answer