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

Looking for a way to exclude files used by geninfo/genhtml

We are trying to use geninfo and genhtml (alternative to gcovr, see here) to produce an html page using coverage provided by gcov. geninfo creates lcov-tracefiles from gcov's *.gcda files genhtml generates html files from the above…
Sagar
  • 9,456
  • 6
  • 54
  • 96
13
votes
3 answers

LCOV branches at the end of a function

What are the branches at the end of this function. How could I cover them?
jsj
  • 9,019
  • 17
  • 58
  • 103
12
votes
0 answers

Vue cli 3 - NYC Istanbul code reports not including vue files

I have been trying for hours now to get the istanbul code coverage reports up and running for my new vue (typescript based) project, generated with the vue-cli v3. Whenever I run my tests: (nodemon --exec nyc vue-cli-service test:unit) only the .ts…
Stan Hurks
  • 1,844
  • 4
  • 14
  • 25
12
votes
1 answer

How do I tell lcov where to find my .cpp & .h files?

My source and build tree looks like this (see Makefile to put object files from source files different directories into a single, separate directory?) after a make (which builds and runs FooAndBarTests): src - Foo.cpp - Bar.cpp inc - Foo.h -…
Daryl Spitzer
  • 143,156
  • 76
  • 154
  • 173
12
votes
1 answer

Karma produces lcov report for angular project with invalid line numbers

I have an Angular project with some tests. My build is written in Gulp. I run the tests using Karma and produce an lcov report. I then use the gulp-sonar plugin to run Sonar. My sonar config looks like this: "sonar": { "host": { "url":…
wimnat
  • 1,129
  • 1
  • 13
  • 27
12
votes
2 answers

Lcov inconsistent coverage

I started using lcov about a month back. The coverage count seems inconsistent. The first run reported about 75% line coverage where as second run reported only 19%. The test suite used was some for both the runs. I see following warning during…
user3033456
  • 121
  • 5
11
votes
0 answers

genhtml doesn't generate coverage report after adding --no-external flag to lcov command

I wanted to exclude external lib's code from my coverage report, so I've added --no-external flag to lcov command. Unfortunately, after adding this flag genhtml is unable to generate coverage reports. Command used: lcov --directory . -c -o…
irky
  • 141
  • 2
  • 8
11
votes
1 answer

How to make lcov perform faster?

I'm having performance issues with lcov. I'm executing a program in seven different profiles, collecting the coverage for each of them and then merging the coverage profile with lcov: lcov --rc lcov_branch_coverage=1 -a coverage_1.dat -a…
Baptiste Wicht
  • 7,472
  • 7
  • 45
  • 110
11
votes
3 answers

Is there a way to call the "deleting destructor" of a pure virtual class?

I'm using C++11 and g++4.8 on Ubuntu Trusty. Consider this snippet class Parent { public: virtual ~Parent() = default; virtual void f() = 0; }; class Child: public Parent { public: void f(){} }; Called using { Child o; …
rcomblen
  • 4,579
  • 1
  • 27
  • 32
10
votes
1 answer

Understand control flow graph in lcov branch coverage output

I am trying to improve my unit tests by inspecting my current code coverage percentage. I am using gcov and lcov to produce a HTML report of the coverage results. However, I am having problems understanding some of the output. I know that a +…
sigy
  • 2,408
  • 1
  • 24
  • 55
10
votes
5 answers

Is there any actively supported lcov port for windows

I measure coverage for my code using gcov library and I would like to generate coverage report in user-friendly format. I've found lcov utility for that, but it's not compatibile with Windows environment (mainly because of the way the paths are…
chalup
  • 8,358
  • 3
  • 33
  • 38
9
votes
1 answer

C++ using GCOV/LCOV in a CMake project

I'm working in a C++ Project with a structure similiar to the following: --- /src |--comms |--utils |--interfaces … CMakeList.txt --- /test |---test1/ |--main.cpp …
Jupiter
  • 91
  • 1
  • 1
  • 4
9
votes
2 answers

Generating empty .gcda files

I use gcov for doing code coverage analysis with lcov for generating graphical output of coverage. This works well for code file where atleast some part of object file has been executed. I want to be able to track files which have not been executed…
mnair4
  • 93
  • 1
  • 4
8
votes
1 answer

CMake and lcov: gcno files not found

I am trying to get code coverage on my CMake based project (which consists of several targets). First I generate gcno files with: lcov -b . -d . -o coverage.output --capture --initial The *.gcno are generated…
Lars Bilke
  • 4,940
  • 6
  • 45
  • 63
8
votes
1 answer

Coverlet lcov.info file not generated for dotnet core project

I'm working on dotnet core project withd VS code inside a linux machine. following below blog to generate coverage report: https://www.hanselman.com/blog/AutomaticUnitTestingInNETCorePlusCodeCoverageInVisualStudioCode.aspx as mentioned there Im…
nari447
  • 834
  • 2
  • 11
  • 25
1
2
3
19 20