Questions tagged [gcovr]

114 questions
0
votes
1 answer

Genetate GCOV report for multiple cpp files

I have 3 files in a folder. one.cpp, one.hpp and main.cpp. one.hpp has a class declaration. one.cpp has definition of functions in the class both under same namespace.Iam calling a function from the class in main and including one.hpp in main. how…
Cod3r
  • 17
  • 5
0
votes
1 answer

Create Gcovr standalone version

I have a question about gcovr. Is it possible to install or create a standalone version of the gcovr. So that the user doesn't need to instal python or gcovr ? So that i just have to add the path. (executable) Thanks for your help Cheers
Gio
  • 5
  • 2
0
votes
0 answers

gcovr always shows 100% line coverage

I run the following code with gcovr, and get 100% line-coverage, despite bar not being called. What am I doing wrong? #include struct A{ static void foo(){ std::cout << "foo" << std::endl; } static void bar(){ …
Benny K
  • 868
  • 6
  • 18
0
votes
1 answer

Why does gcovr generate empty coverage statistics?

I'm confused about how to use gcov. I've got a cmake project that has two test executables which use googletest. I've added the required flags to my cmake script: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -g -O0") And…
CiaranWelsh
  • 7,014
  • 10
  • 53
  • 106
0
votes
1 answer

Why gcov is not covering logical && operator?

My piece of code which I am doing unit testing on is something like this: if(((State !=TCPIP_IPADDR_STATE_ASSIGNED)&& (State !=TCPIP_IPADDR_STATE_ONHOLD) && (State !=TCPIP_IPADDR_STATE_UNASSIGNED)) ||(SoConId==DOIP_INVALID_16)) { …
0
votes
1 answer

How to generate HTML reports of coverage information using gcov?

I want to generate HTML reports of result of coverage information of code written c++. what is the command to generate it ? I was using File 'c:/mingw/lib/gcc/mingw32/6.3.0/include/c++/iostream' Lines executed:100.00% of 1 Creating…
0
votes
0 answers

gcovr missing .gcda files after executing binary that is linked with a dynamically linked shard object libraries (.so)

I am trying to use gcovr on my linux project and have no luck getting .gcda files for the dynamic library after executing binary. I have a project called projectA which creates a library called libprojectA.so and the unit test project links…
takanoha
  • 183
  • 4
  • 17
0
votes
2 answers

How to make gcov and gcovr pick up source and header files

I am trying to generate coverage report for project using .bat file as detailed below. I see very few .gcov files. Also, when I click on link on generated html output, I am not able to see file details (file not found error). How do I fix…
BeHappy
  • 138
  • 2
  • 17
0
votes
0 answers

How to Define Output Directory of Coverage Files in CMake

I am trying to make a very simple regression model that (among other things), builds and compiles a GCC target for coverage, executes, and then publishes a standard Cobertura coverage report (all within Jenkins). The Jenkins part is somewhat…
SeaNick
  • 501
  • 1
  • 4
  • 14
0
votes
1 answer

How to get gcovr to report 0% for untested files?

I have a number of source files in my project which are not tested at all. So they have gcno files but no gcda files. gcovr just skips them entirely, which artificially inflates my test coverage reporting. I've looked through the various options in…
Nickolai
  • 1,579
  • 2
  • 12
  • 19
0
votes
0 answers

gcovr GCOV_EXCL_START equivalent for excluding file from line coverage

I am using gcovr for determining line and branch coverage of my C++ code. However, there are some classes that can't be tested (due to dependencies to the OS) and therefore have 0 coverage. I would like to exclude those from my reports. I have added…
Maarten
  • 31
  • 4
0
votes
1 answer

Get coverage for files in other directories with gcvor

I am here with the problem, not getting an cpp files in gcovr output. Actually my main project consist of many sub cpp files but, they are located in different directory paths. Directory…
Arun
  • 3
  • 4
0
votes
1 answer

Conda - gcovr offline installation

On my computer with windows 10, I can create following conda environment conda create -n test-coverage python=3.6 activate test-coverage pip install gcovr Now, I want to create this conda environment on a Windows 7 computer with no internet…
ge45mue
  • 677
  • 8
  • 23
0
votes
1 answer

Gcovr --object-directory option not working as expected with .gcda files in a different directory than .o files

The program I want to profile with gcovr (or gcov/lcov) is located on a shared filesystem, along with the build directory from compiling the program, and I have multiple workers with which I intend to test my program, in parallel. To solve the race…
0
votes
1 answer

How to show True/False Condition on Branch Coverage on Gcovr

I've been trying to get which condition on a branch my executed test case took. For example, this is a snip of the coverage information I got from Gcov's gcov -b (I also use -i option for readability): lcount:10,1 branch:10,nottaken branch:10,taken…
AceVez
  • 291
  • 1
  • 5
  • 19