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

llvm-cov shows braces as uncovered

Our project migrated from gcc to clang so we changed coverage tool from gcov to llvm-cov. It's led to many false-positives of this type: While with gcc it worked as expected I tried clang-12, 15, 16 and results are equal Capturing coverage data…
tenta4
  • 304
  • 2
  • 16
1
vote
1 answer

Error: gcov: error: missing argument to '-x'

I try to find coverage with lcov. But I am stuck in this error. I use this command to find coverage. lcov --capture --directory . --output-file main2.info Capturing coverage data from . Subroutine read_intermediate_text redefined at…
somiha
  • 11
  • 1
1
vote
0 answers

llvm-cov gcov: for the -b option: may only occur zero or one times

I'm trying to call llvm-cov gcov -b "$@" but getting the error: "llvm-cov gcov: for the -b option: may only occur zero or one times!" and cannot find any explanation for it... Does anybody know what it means? context: an attempt to get code coverage…
Dmitrii
  • 98
  • 6
1
vote
1 answer

code coverage - which run covers which code?

The POC: https://gist.github.com/1197309 I would like to determine which of the three runs ./prime, ./prime 0 and ./prime 1 have covered which code and have it nicely displayed in the HTML report. Is this possible in a straightforward fashion? How…
Flavius
  • 13,566
  • 13
  • 80
  • 126
1
vote
0 answers

Setting threshold for Coverage in Bazel Java Project

I am using following command for running coverage for complete Java project module. bazel coverage ... --compilation_mode=dbg --subcommands --announce_rc --verbose_failures --jobs=auto --sandbox_debug --build_runfile_links --combined_report=lcov…
rishi007bansod
  • 1,283
  • 2
  • 19
  • 45
1
vote
0 answers

All tests fail but ~100% line coverage. Why?

I have a function-under-test file and a tester file as below: Line data Source code 1 : #include 2 : using namespace std; 3 3 : int GreatestOfThree(int a,int b,int c){ 4 …
jacky
  • 11
  • 1
1
vote
1 answer

cannot find an entry for .cpp.gcov in .gcno file, skipping file

g++ (Ubuntu 9.4.0-1ubuntu1~18.04) 9.4.0 gcov (Ubuntu 9.4.0-1ubuntu1~18.04) 9.4.0 lcov: LCOV version 1.13 g++ -g -O0 --coverage main.cpp -o main ./main lcov -t "main" -o main.info -c -d . --gcov-tool gcov-9 The output: Capturing coverage data from…
vamirio-chan
  • 339
  • 1
  • 13
1
vote
1 answer

gcovr not showing code coverage for untouched header files

I have the following structure for a header only library include - header1.h - header2.h - header3.h test - test1.cpp Now test1.cpp only uses header1.h, so when I compile test1.cpp with --coverage option, run the test, and then run gcovr to…
1
vote
0 answers

How to generate Code Coverage for entire c++ codebase coverage w/ gcov/lcov

We have a large body of C/C++ code that is cross-compiled for an embedded Linux target. We've recently begun implementing unit tests (using gmock/gtest) that are run on our development server (which is Linux as well). The unit tests are executed…
vishnu
  • 363
  • 3
  • 20
1
vote
0 answers

How to generate .gcov intermediate text file with windows Mingw compiler and how lcov can use those .gcov file?

My project is integrated with GTest Unit Test Framework and Gcov and Lcov Coverage tool is used generate Code Coverage report. The Coverage report was generating fine with QT version 5.9.1 and MingW compiler (mingw530_32). The same project has been…
Bharathi
  • 337
  • 1
  • 5
  • 17
1
vote
1 answer

What does "#" mean in LCOV report?

I thought I had covered both cases for the while loop, but brcov doesn't show 100% due to that "#" alert: hash symbol
1
vote
2 answers

Calling a function which is inside a Thread

I was doing Unit Testing and finding code coverage using gtest and lcov. My function is void MyClass::MyFunction(const std::string& argument1, const std::string& argument2) { std::thread([this, argument1, argument2]() { …
Jff
  • 91
  • 1
  • 8
1
vote
2 answers

How to measure code coverage of the part of execution in C++

I have two C++ binaries (A and B) with socket connections between two binaries. Binary A is listening for B. And, B connects to the A. A accepts B's message and executes some functions depending on message contents. We created a kind of unit-test…
C.H.Song
  • 39
  • 6
1
vote
0 answers

Code coverage using lcov+gtest only reports on the coverage of the unit test cpp file, not the files of the library being tested

I am trying to implement a small example on how to use google test and lcov so I can see how my testing of the code is doing. Here is my example repository. My project has the following file tree: unit_test_coverage/ |--CMakeLists.txt …
apalomer
  • 1,895
  • 14
  • 36
1
vote
0 answers

How to install lcov tool in Windows machine for flutter code coverage

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…