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
3
votes
2 answers

dlopen not working with code-coverage tools (lcov/gcov)

Structure of the entire application: Shared Library say - low_level.so. Static Library say - high_level.a. This static library uses the 'low_level.so' by calling the dlopen function (for loading the low_level.so) and dlsym function (for getting the…
Rajen
  • 931
  • 6
  • 8
2
votes
1 answer

lcov : coverage of source for several executions

I've created simple hello word cpp app. Compiled it by passing gcc --coverage flag Executed the executable Generated coverage by invoking lcov --directory . --capture --output-file ic.info Generated html based report by genhtml genhtml -o html/…
deimus
  • 9,565
  • 12
  • 63
  • 107
2
votes
0 answers

bazel coverage skips source files with no tests in coverage.dat report

Team, I have two sources files in a directory and one sourcefile has is completely skipped from being included in bazel-out/_coverage/_coverage_report.dat and i have no clue so far. I looked up online. when I uploaded the same coverage to sonarqube…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
2
votes
0 answers

format no valid records found in tracefile using genHTML on coverage.dat generated by bazel in lcov

Team, I am able to successfully generated the coverage.dat file but I cannot generate htlm to view the report. anything that am missing? am new to this. ./bazel coverage --combined_report=lcov //src/teams/test/... output Command> ./bazel coverage…
AhmFM
  • 1,552
  • 3
  • 23
  • 53
2
votes
1 answer

How to generate HTML from a lcov file on Windows via WSL?

I am using Flutter to generate the lcov file and now I want to use WSL to generate the HTML file for reading the data. How can I achieve this?
Daniel Oliveira
  • 8,053
  • 11
  • 40
  • 76
2
votes
2 answers

Jest v28 sharding, merge coverage report to single file missing branch data

Using Jest v28 --shard flag significantly speeds up tests in our CI/CD pipeline, but it creates the issue of having to merge multiple coverage reports into a single file (required for our code quality report on PRs). I am forced to use lcov format…
Flash
  • 543
  • 2
  • 7
  • 21
2
votes
0 answers

Github Actions Sonar Scanner can't resolve file paths in lcov.info

First off, I am aware, that there are resolved issues that are similar to mine, but I've tried every possible answer 50 times, so I think my case might be unique. I'm trying to upload the lcov.info coverage data, generated with nyc of my mocha…
2
votes
0 answers

Why is lcov including system header files in my coverage report?

I'm generating a line/branch coverage report for a simple c++ app. I expect only one file, test.cpp, to be including in the report, but lcov adds about two dozen system header files to the coverage report. Here are just a few of the header…
Epsilon
  • 1,016
  • 1
  • 6
  • 15
2
votes
1 answer

GCOV/LCOV ignores `used functions` declared before an `unused function`

The question may seem weird. I tried to use GCOV/LCOV for my small project and practiced with simple code before applying it. While practicing it, I encountered an error that I had no idea how to solve. The report created by LCOV showed that the…
2
votes
1 answer

How to get gcov .gcda / coverage if test run was terminated?

How to get .gcda (gcov)/ coverage if the test run is infinitive or the test run is long and I would like to get temporary results? For example, I am interested in test coverage after 1 minute of execution. gcc -I${PWD} -fprofile-arcs -O0 --coverage…
2
votes
0 answers

Jest coverage missing branches on import statement inside lcov report

I am trying to figure out why I am having missing branches on import files when checking the Jest Coverage lcov report. I have 100% line coverage, but other types of coverage (statement, branch, and functions) are pretty low. I wasn't sure about the…
agustin37
  • 121
  • 6
2
votes
1 answer

Code coverage for source files using lcov

I am using lcov and genhtml to generate code coverage reports. With the following directory structure, I am able to get the code coverage for the source files located in the tests/ directory, but am unable to get code coverage for the my_file.c file…
Trevor
  • 6,659
  • 5
  • 35
  • 68
2
votes
1 answer

Merge lcov results in one report, and keep the test ids testing each line

I have lcov report of my c++ code on each of my integration tests. I would like to merge it in one global report, I know it is possible but it only adds up hit lines count. I wish to have the information about which test hit each line. I dunno if…
amestin
  • 31
  • 1
  • 3
2
votes
1 answer

make lcov only capture part of codes (based on last N commits)

I can use gcov/lcov/genhtml to generate test coverage report for all the files, now I want to only get the report for the last 10 commits. how can I get there? What I have tried is: 1. compile and run the program. 2. lcov --directory . --capture…
zhihuifan
  • 1,093
  • 2
  • 16
  • 30
2
votes
1 answer

coverage with gcc9 and lcov

A recent OS upgrade made my coverage script fail miserably. lcov 1.13 gcov (GCC) 9.1.1 The part of my CMake that is used to generate coverage data: if ($ENV{COVERAGE}) message("Setting up for coverage") enable_testing() …
Leśny Rumcajs
  • 2,259
  • 2
  • 17
  • 33