Questions tagged [lcov]

LCOV is a graphical front-end for GCC's coverage testing tool gcov

LCOV is a graphical front-end for GCC's coverage testing tool gcov. It collects gcov data for multiple source files and creates HTML pages containing the source code annotated with coverage information. It also adds overview pages for easy navigation within the file structure. LCOV supports statement, function and branch coverage measurement.

The homepage of the project is here.

286 questions
1
vote
1 answer

lcov + gcov-9 performance regression because of json usage

I have updated my build environment compiler from gcc 5.5.0 to gcc 9.3.0 and noticed coverage calculation performance regression. It became 10 times slower (5 hours vs 48 hours for whole project). My investigation shows that in gcov-9 they started…
tenta4
  • 304
  • 2
  • 16
1
vote
1 answer

os.system working with lcov --remove but subprocess.call is not

I'm using lcov, I want to exclude some files/directories from my coverage reports. When I use os.system(): os.system("lcov --remove build/unit_test_coverage.info \'*test*\' \'*mock*\' -o build/unit_test_coverage.info") It excludes the…
SuperHanz98
  • 2,090
  • 2
  • 16
  • 33
1
vote
1 answer

How to improve the branch coverage using gcovr tool

I have written a sample program using C++. I have written corresponding unit tests using GUNIT framework. I was successfully able to generate.gcda and .gcno files for every source file. I used (gcov -b -l -p -c *.gcno) command in the folder where…
1
vote
0 answers

Parsing lcov total.info

I'm parsing the total.info file which is the result of running a few lcov commands on my source code in order to build a service that provides coverage information when needed. lcov also provides a nice html ui to browse code coverage. The problem…
1
vote
1 answer

How to use lcov with `--gcov-tool` flag?

I want to use a different gcc than my system defaults to to build a project. Therefore I need to provide lcov with the correct gcov-tool version. Unfortunately the --gcov-tool flag does not work for me. Not even with the version lcov should default…
1
vote
2 answers

Cannot install gcov without version suffix

I try to install gcov to be able to generate coverage reports. I'm on machine Ubuntu 19.04 and have installed gcov-8, which is working pretty well. The problem is (as I can understand) that lcov tries to use gcov instead gcov-8. If I install gcc-9,…
arsdever
  • 1,111
  • 1
  • 11
  • 32
1
vote
2 answers

CMake: How to check if lcov is installed

I need to modify CMake scenario in order to have code coverage reporting in place. For this purpose 2 checks should be done: 1. GCC should be available: CMAKE_COMPILER_IS_GNUCXX 2. lcov should be installed (lcov is a graphical front-end for GCC's…
olpo.graphy
  • 405
  • 8
  • 17
1
vote
1 answer

lcov code coverage --remove command with input variable does not work

Problem Description I am trying to filter directories that we don't want to ignore for the test coverage. For this purpose we are using Lcov. When I try to put the directories that are to be ignore in a variable __ignoreinput the command #${__lcov}…
Hani Gotc
  • 840
  • 11
  • 24
1
vote
1 answer

Understanding blocks in gcov files

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…
jay
  • 13
  • 4
1
vote
1 answer

Verify low coverage of an Angular application in a Jenkins pipeline

When we want to verify the code coverage of a Java application we use jacoco to generate a .exec file and run a Jenkins jacoco step to enforce the validatio thresholds, e.g: def classPattern = '**/target/classes' def execPattern =…
codependent
  • 23,193
  • 31
  • 166
  • 308
1
vote
1 answer

How to generate cpp coverage from bazel py_test

I wrote a few python tests that run cpp binaries as subprocess. Python code is in charge of performing tests on that process. I run these python tests in py_test bazel rule. Problem is that this doesn't count as if our cpp code is covered with tests…
1
vote
0 answers

Class member initialization in header files generated wrong lcov coverage report

I have created a simple example to illustrate the issue: test.h #ifndef TEST_H #define TEST_H class TestCoverage{ public: /* * * * */ int a = 5; int b = 10; void testfunc(); explicit TestCoverage(); }; #endif //…
ymochurad
  • 941
  • 7
  • 15
1
vote
1 answer

Keep Gcov Test name in GCDA files

After having performed my test coverage on my product using lcov (for C++ dev), i'd like to draw a matrix to have the correspondence between the test name and the files it covers. The idea is to have a quick view of the code covered by 1 test…
Totoc1001
  • 338
  • 2
  • 11
1
vote
2 answers

How to add LCOV_EXCL_LINE marker for code coverage in C or C++ code?

I tried two ways to add LCOV_EXCL_LINE in my code. I add it as comment, compile and generate lcov report but lcov binary takes it as a comment and showing the coverage of excluded line. Image showing coverage of excluded line: After compilation…
1
vote
0 answers

Generate native code coverage report from 2 sets of .gcda files and one set of .gcno files

I'm using lcov to generate code coverage report for native part of the product. Using the command lcov --capture --directory --output-file coverage.info (path_to_obj - path to dir with all .gcno and .gcda files are) it's not a problem…