代码覆盖率可与QT for C ++一起使用

时间:2016-02-08 07:23:17

标签: windows qt gcov

我想使用适当的工具进行与Windows QT兼容的代码覆盖。 我尝试使用GCOV和LCOV,但遇到了一些问题。

除gcov外,我可以免费安装哪些备用工具? 提前致谢

编辑:

我的lcov.bat包含

 @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%"

我通过cmd运行它,但它给了我这个错误:

.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!

1 个答案:

答案 0 :(得分:1)

我将OpenCppCoverage与基于MSVC的Qt一起使用。我不知道它是否适用于基于MinGW的Qt。