lcov

Exclude the header files coverage while doing the unitests for .cpp files using lcov

我与影子孤独终老i 提交于 2021-02-09 07:35:45
问题 I have generated the html code coverage for unittest. The problem is that it generates the code coverage for everything that is defined in the include preprocessor. The codecoverage for the unittest is inside the unitTest link of the code coverage report. I only need the unitTest I also remove everything else and keep the gcda and gcno files of the test file before generating the code coverage but it still doesnot help. The code that does this is : find obj/ ! -name '*_unittests*' -type f

Exclude the header files coverage while doing the unitests for .cpp files using lcov

喜夏-厌秋 提交于 2021-02-09 07:31:37
问题 I have generated the html code coverage for unittest. The problem is that it generates the code coverage for everything that is defined in the include preprocessor. The codecoverage for the unittest is inside the unitTest link of the code coverage report. I only need the unitTest I also remove everything else and keep the gcda and gcno files of the test file before generating the code coverage but it still doesnot help. The code that does this is : find obj/ ! -name '*_unittests*' -type f

Understanding blocks in gcov files

自作多情 提交于 2021-01-29 05:34:44
问题 I'm trying to understand the output of the gcov tool. Running it with -a options makes sense, and want to understand the block coverage options. Unfortunately it's hard to make sense of what the blocks do and why they aren't taken. Below is the output. I have run add function in my calculator program once. I have no clue why it shows block0. -: 0:Source:calculator.c -: 0:Graph:calculator.gcno -: 0:Data:calculator.gcda -: 0:Runs:1 -: 0:Programs:1 -: 1:#include "calculator.h" -: 2:#include

单元测试 & 代码覆盖率 —— Automatic Unit Testing in .NET Core plus Code Coverage in Visual Studio Code

时光总嘲笑我的痴心妄想 提交于 2020-04-11 19:55:56
Automatic Unit Testing in .NET Core plus Code Coverage in Visual Studio Code https://github.com/shanselman/dotnetcoreunittestingwithcoverageinvscode I was talking to Toni Edward Solarin on Skype yesterday about his open source spike (early days) of Code Coverage for .NET Core called " coverlet ." There's a few options out there for cobbling together .NET Core Code Coverage but I wanted to see if I could use the lightest tools I could find and make a "complete" solution for Visual Studio Code that would work for .NET Core cross platform. I put my own living spike of a project up on GitHub . Now

Conditional Regular Expression to exclude certain directories

烈酒焚心 提交于 2019-12-24 08:35:01
问题 I'd like to exclude certain directories of code from getting analyzed for code coverage. I'm using the LCOV tool which has a --exclude parameter which I can include a regular expression to exclude files, packages, etc... What would be the regular expression to exclude all directions except for Src/High/SS/FormCalc: Src/High/SS/ATG_Help Src/High/SS/ConvCalc Src/High/SS/ConvX Src/High/SS/EFiling Src/High/SS/Edit Src/High/SS/FormCalc Src/High/SS/FormDisp Src/High/SS/Image Src/High/SS/Import Src

How to tell lcov to ignore lines in the source files

牧云@^-^@ 提交于 2019-12-18 19:28:29
问题 I am wondering if there is the possibility to tell lcov to ignore some lines in a source files, ie. do not report them as unvisited. I am looking for a solution that can be put in the code itself, like: int some_method(char some_var, char some_other_var) { if(some_var == 'A') { if(some_other_var == 'B') { /* do some real stuff here */ } else { LCOV_DO_NOT_REPORT_NEXT_LINE // **<-- this?? ** NOT_IMPLEMENTED("A*") } } else { NOT_IMPLEMENTED("*") } And the necessary background: A big piece of

Is there a way to focus lcov code coverage reports to just one or two directories?

痴心易碎 提交于 2019-12-18 10:33:39
问题 I recently started using lcov to visualize my code coverage. It's a great tool. One thing I'm noticing is that it generates code coverage reports for all the files that I'm using - including those that I'm not interested in. For example, it will give me code coverage reports for boost and mysql++ files. Is there an easy way to force lcov to only generate coverage reports for specific files? I have tried using the -k parameter like so: /usr/bin/lcov -q -c -i -b . -d .obj -k src/ -k include/ -o

Xcode5 Code Coverage (from cmd-line for CI builds)

我是研究僧i 提交于 2019-12-17 22:41:56
问题 How can I generate code coverage with Xcode 5 and iOS7? Prior to upgrading I was getting code coverage just fine. Now I can't see any *.gcda files being produced. The cmd-line that I'm using is: xcodebuild -workspace ${module.name}.xcworkspace test -scheme ${module.name} -destination OS=${module.sdk.version},name=iPad -configuration Debug Works with AppCode When I execute the tests via AppCode I can see *.gcda files being produced in ~/Library/Caches/appCode20/DerivedData. . . I need this to

How to merge multiple versions of gcda files?

隐身守侯 提交于 2019-12-12 19:46:38
问题 I'm using gcov for get coverage information of my application. However, there are 3 instances of my applications are running concurrently creating 3 versions of "gcda" files. Is there a way to merge different versions of same "gcda" files in my coverage information file. I want to take the coverage information as just one instance. 回答1: I have just been looking into the same problem, and here is what I found. TL;DR yes it is possible, in best case by just being careful with compilation order,

Cannot generate coverage report using lcov

ぃ、小莉子 提交于 2019-12-12 05:37:37
问题 I'm trying to use lcov to generate coverage reports for my unit test suite, but I cannot even capture a tracefile. The error messages indicate that the source files cannot be found. The code is compiled by a Jenkins job on a build machine and the unit test are executed as a downstream job on a target machine. The source code and gcno files are transfered to the downstream job, which then executes the call to lcov. Here follows all the details, a cup of coffee might be needed. On the build