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
5
votes
0 answers

Lcov Unit Coverage report upload into SonarQube

Our SonarQube Environment details as follows: SonarQube Version – 6.7.5(LTS). sonar-cxx-plugin-1.1.0.jar (Community Plugin). Using C++ language and coverage generated in both .info & .html(generated from genhtml command). Tried to upload the lcov…
user4948798
  • 1,924
  • 4
  • 43
  • 89
5
votes
1 answer

Why is codecov with lcov not working correctly on Travis but on my local Linux Mint?

I tried to add Codecov to my CI build system for my library. The travis script looks like this: lcov --directory . --capture --output-file coverage.info --gcov-tool gcov-8 # capture coverage info lcov --remove coverage.info '/usr/*' --output-file…
AMS
  • 51
  • 1
  • 5
5
votes
2 answers

How to improve branch coverage in C++

I have a fairly large test suite for a C++ library with close to 100% line coverage, but only 55.3% branch coverage. Skimming through the results of lcov, it seems as if most of the missed branches can be explained by C++'s many ways to throw…
Niels Lohmann
  • 2,054
  • 1
  • 24
  • 49
5
votes
1 answer

SONARQUBE lcov import error - Could not resolve 1 file paths

I am getting the below error whenever I try to import lcov report in to SONAR 15:00:17.230 WARN: Could not resolve 1 file paths in [/opt/app/workload/jenkins_25172/data/jobs/DEV02/workspace/coverage/lcov.info], first unresolved path:…
Learner
  • 2,303
  • 9
  • 46
  • 81
5
votes
0 answers

lcov doesn't match gcov coverage results for a googletest unit test

I'm trying to gather coverage results on a library file foobar.cpp by creating a googletest unit tests for the souce file and then using gcov for coverage results, finally using lcov to produce an html document. I've gotten unit testing and gcov…
user3407196
5
votes
1 answer

gcov generates empty coverage for c

I'm trying to collect code coverage for the project that has c++ and c code both on Ubuntu. I use '-fprofile-arcs' and '-ftest-coverage' values as CXXFLAGS and CFLAGS; '-lgcov' as LINKFLAGS. Common C project structure is: c_code\ src …
Evgeny
  • 159
  • 1
  • 10
5
votes
2 answers

Linux Kernel Code Coverage - GCOV

I'm trying to use some test scenarios from Linux test Project and get the Kernel source code coverage. I'm using GCOV/LCOV to do so. here are the things I have so far: GCOV flags in the build config GCOV-based kernel…
Shayan
  • 548
  • 6
  • 24
5
votes
1 answer

lcov woes: weird duplicate constructor marked as not covered & function not marked as covered, even though its lines have been executed

On my quest to learn more about automated testing by getting a small C++ test project up & running with 100% coverage, I've run into the following issue - even though all my actual lines of code and all the execution branches are covered by tests,…
DeducibleSteak
  • 1,398
  • 11
  • 23
5
votes
3 answers

lcov for multiple directories containing gcda files

I want to generate the coverage reports using gcov and lcov. What I have done till now:- 1. I compiled my code using --fprofile-arcs and -fprofile-coverage in g++. 2. I have linked using lcov. 3. I have .gcno files with th e.o location. 4. When I…
crazy_prog
  • 1,085
  • 5
  • 19
  • 34
4
votes
0 answers

genhtml: ERROR: cannot read path-to-file on Linux only

I generate lcov file and use genhtml to produce html report files using: genhtml out/cov.info -o out/temp On windows it works fine and the index.html is generated, while in Linux I get this error: Found 1 entries. Found common filename prefix…
Engineer
  • 75
  • 9
4
votes
1 answer

How to view coverage report in HTML format for flutter/dart on windows

I'm write a unit test for my flutter project. Next, i'm run test by command: flutter test --coverage This command run the test and create lcov.info file with coverage…
Sergio Belevskij
  • 2,478
  • 25
  • 24
4
votes
0 answers

How to install lcov tool in Windows machine

How to install lcov tool in Windows machine so that I can use the genhtml command to generate html files for my code coverage output files? I generated code coverage for my flutter app. The file type is lcov.info. I need to make this file readable…
Ashwin Kmr
  • 280
  • 1
  • 7
  • 20
4
votes
2 answers

How to merge coverage reports?

I have a C program which I compile with -fprofile-arcs -ftest-coverage flags.Then I run the program on 5 different inputs, this will override the .gcda file and give me a combined report.But I want to have the coverage report of individual tests and…
VVish
  • 251
  • 4
  • 11
4
votes
6 answers

DOS to UNIX path substitution within a file

I have a file that contains this kind of paths: C:\bad\foo.c C:\good\foo.c C:\good\bar\foo.c C:\good\bar\[variable subdir count]\foo.c And I would like to get the following file: C:\bad\foo.c C:/good/foo.c C:/good/bar/foo.c C:/good/bar/[variable…
calandoa
  • 5,668
  • 2
  • 28
  • 25
4
votes
2 answers

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

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…
Enjal Parajuli
  • 193
  • 1
  • 11