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

CodeCoverage Module for CMake does not Include Functions Defined in Header Files

I have a CMake project in which I am trying to enable code coverage (Using Gcov, Lcov, and Geninfo). In order to do this, I am using a module CodeCoverage.cmake to set this up for my target. Here is the code that sets this up. if (ENABLE_COVERAGE…
Arnav Borborah
  • 11,357
  • 8
  • 43
  • 88
1
vote
1 answer

Gitlab test coverage parsing fails

I am trying to get gitlab code coverage parsing working. The server is a local instance of Gitlab 10.4.1-ee. The code coverage tool is lcov via a slightly modified version of this cmake file. I've entered the regex into the CI Settings as well…
Chuck Claunch
  • 1,624
  • 1
  • 17
  • 29
1
vote
0 answers

lcov mis-interpretation of directories

I'm developing a software project with source code spread across different directories, some parts being project-specific, other parts are shared across projects. I want to measure the test coverage for all source code in question, however, I fail…
M.Schnick
  • 39
  • 1
  • 8
1
vote
0 answers

Can I run GCOV on the same c file multiple times with different defines?

Can I test the same C file multiple times with different defines? Let's say one time with: #define url google.de and one time with: #define url google.de/
QuesterDesura
  • 385
  • 2
  • 18
1
vote
0 answers

Is there any way to merge coverage data?

I have multiple copies of my cpp program (on different physical machines) that will be tested by people-testers. I compiled program with gcc coverage flags (-ftest-coverage -fprofile-arcs -O0 etc.) and want to analyze gcov coverage. So the question:…
Juriy
  • 565
  • 1
  • 5
  • 17
1
vote
1 answer

Different branch coverage generated by GCC/GCOV for function using throw() / noexcept

I would like to understand the branches generated by GCC compiler when using noexcept or throw() for marking non-throwing function. I know the differences between noexcept and throw(), but cannot figure out what are the additional branches defined…
pstanisz
  • 181
  • 9
1
vote
1 answer

Cannot generate a cobertura.xml file from lcov.info or coverage.json file in Jenkins VirtualEnv

I have a ready javascript file that run all unit tests and coverage. And the script is generating coverage.json file. I favor using the cobertura plugin (https://wiki.jenkins-ci.org/display/JENKINS/Cobertura+Plugin) so I was looking for a solution…
Crystalzord
  • 135
  • 2
  • 16
1
vote
1 answer

lcov reports that line in static member variables destructor is not executed

I have a struct which contains a static member variable. One of the lines in the destructor of this member variable is allegedly never executed, this is reported by lcov. This one line should only be executed when the program terminates. So I guess…
Jonas
  • 6,915
  • 8
  • 35
  • 53
1
vote
0 answers

Merging gcov files : Add the line counters from multiple gcov files

I have gcov files created for 2 versions of the same file (old & latest). Need to add the coverage counters for the lines that are present in both the files and generate a new gcov file with cumulative coverage. I tried to use the diff tool to…
MSK
  • 175
  • 1
  • 10
1
vote
1 answer

Cannot generate coverage report using lcov

I'm trying to use lcov to generate coverage reports for my unit test suite, but I cannot even capture a tracefile. The error messages indicate that the source files cannot be found. The code is compiled by a Jenkins job on a build machine and the…
joaerl
  • 1,012
  • 1
  • 10
  • 21
1
vote
1 answer

how to change the path of source file which was referred gcda?

When i build my project for coverage testing with "--coverage -fprofile-arcs -ftest-coverage", and then move the build and source to the other user directory to execute testing. I will get so many problems such as "xxx/cc/cc/getopt_log.c:cannot open…
Colin
  • 75
  • 1
  • 2
  • 9
1
vote
1 answer

Conditional Regular Expression to exclude certain directories

I'd like to exclude certain directories of code from getting analyzed for code coverage. I'm using the LCOV tool which has a --exclude parameter which I can include a regular expression to exclude files, packages, etc... What would be the regular…
Moonie Asemani
  • 375
  • 1
  • 4
  • 13
1
vote
2 answers

LCOV_EXCL_START/STOP has no effect when using gcovr

When I add LCOV_EXCL_START/STOP tags to my C++ code, it does not seem to have any effect on my gcovr report. Does someone know why this occurs? I have the following: $ tree . ├── build ├── include │   └── a.h └── tests └── test_a.cpp and $ cat…
jsp
  • 1,225
  • 11
  • 21
1
vote
1 answer

lcov/gcov not outputting coverage for header files

I am able to use gcov properly (at least I think I am), however in some of my directories, I am not able to output coverage for some of the header files. For example, myfile.cpp shows coverage however myfile.h (or myfile.hpp) doesn't. Any help would…
bsquared82
  • 13
  • 3
1
vote
1 answer

Is there a method lcov in ignoring some directories from the report

I have the line lcov -c -i -d . -o cov_init.infowhich captures the coverage data from an initial point of zero from a directory but I want it to ignore some directories. I was thinking of using a conditional statement but I'm new to using linux and…
newbie_at_linux
  • 35
  • 1
  • 2
  • 8