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
66
votes
1 answer

Get multiple coverage reports in coveralls for a single repository

Is it possible to get separate coverage reports for front-end and back-end tests for a single repository? It seems one possible way is to concatenate the lcov reports into one and then ship to coveralls, as mentioned in this question. However, I…
prasun
  • 7,073
  • 9
  • 41
  • 59
41
votes
1 answer

How to change the format of the LCOV report executed by Karma?

I've configured Karma to report the coverage of my JavaScript code. Here is the part of the configuration in the karma.conf.js file: coverageReporter: { reporters: [ { type: 'html', dir: 'build/karma/coverage' }, { …
Romain Linsolas
  • 79,475
  • 49
  • 202
  • 273
32
votes
3 answers

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

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…
Runcible
  • 7,006
  • 12
  • 42
  • 62
28
votes
1 answer

In SonarQube what is the difference in meaning between the "Lines to Cover" and "Uncovered Lines" metrics?

I am looking at the Coverage report within the Measures tab of a SonarQube analysed C++ project. On that page my summary information is as follows: What are the differences between the "Lines to Cover" and "Uncovered Lines" metrics? I have looked…
TafT
  • 2,764
  • 6
  • 33
  • 51
28
votes
6 answers

LCOV/GCOV branch coverage with C++ producing branches all over the place

We are using LCOV/GCOV to produce test coverage of our projects. Recently we tried to enable branch-coverage additionally. But it looks like, this just doesn't yield the results we expected from a high-level developer view. Using branch-coverage…
Sven Eppler
  • 1,646
  • 1
  • 15
  • 26
25
votes
4 answers

XCode 5.1 Unit Test Coverage Analysis Fails On Files Using Blocks

Today I was tasked with adding unit test coverage analysis to our code base. Today is also the day iOS 7.1 is released along with XCode 5.1. From the release notes: The gcov tool for code coverage testing has been reimplemented. The new version…
LeffelMania
  • 12,765
  • 4
  • 32
  • 34
25
votes
2 answers

Lcov: can not collect branch coverage statistics

I used the lcov to create coverage information in my project. But I only can get line coverage and function coverage statistics information. lcov version:1.10, gcov version:4.4.5 The commands I used is: lcov -d $OSPL_HOME/src -d…
user1823629
  • 251
  • 1
  • 3
  • 5
23
votes
4 answers

generating branch coverage data for lcov

i'm trying to use lcov for code coverage metrics, but I cannot get branches coverage to work. Here's how i'm using it: g++ -ggdb3 --coverage src/read.c tests/test.cpp -o bin/test lcov --zerocounters --directory $PWD lcov --capture --initial…
Hugo
  • 2,139
  • 4
  • 22
  • 30
22
votes
1 answer

How to remove certain directories from lcov code coverage report?

I'm not too strong with using lcov and shell scripting so it's a learning process for me. I understand the basics of making a code coverage report but I don't know the line of code to exclude certain directories. In a shell executable file I wrote…
I_love_coding_93
  • 251
  • 1
  • 2
  • 7
15
votes
5 answers

With gcov, is it possible to merge to .gcda files?

I have the same source files (C and Obj-C) being compiled into two targets: the unit test executable and the actual product (which then gets integration tested). The two targets build into different places, so the object files, .gcno and .gcda files…
Joe
  • 46,419
  • 33
  • 155
  • 245
15
votes
3 answers

How to generate LCOV report based on Jasmine's SpecRunner.html?

We are using Jasmine for our JavaScript unit tests. We have a SpecRunner.html file to run the tests. Does there exist a tool to which I can pass the path to SpecRunner.html and the path to the directory of JavaScript (not the specs) files and it…
SBel
  • 3,315
  • 6
  • 29
  • 47
14
votes
1 answer

Excluding certain functions from gcov/lcov coverage results

Is it possible to exclude certain functions or lines of code from the gcov coverage analysis. My code contains certain functions that are used for debugging, and are not exercised as part of my test suite. Such functions reduce the coverage…
Buğra Gedik
  • 714
  • 8
  • 16
14
votes
1 answer

How to tell lcov to ignore lines in the source files

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…
Ferenc Deak
  • 34,348
  • 17
  • 99
  • 167
14
votes
6 answers

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

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…
Jasper Blues
  • 28,258
  • 22
  • 102
  • 185
13
votes
1 answer

gcov produces different results on Clang and GCC

I'm trying to understand how to properly structure a C++ project by using CMake, googletest, and gcov for test coverage. I would like to build a general CMakeLists.txt that would work for any platform/compiler. This is my first attempt. However, if…
1
2 3
19 20