Category : gcov

I would like to get per test coverage for every test case in my c++ program. What I get is that GoogleTest allows some actions to be performed before and after every test #pragma once #include <gtest/gtest.h> #include <gcov.h> class CodeCoverageListener : public ::testing::TestEventListener { public: virtual void OnTestProgramStart(const ::testing::UnitTest&) {} virtual void OnTestIterationStart(const ::testing::UnitTest&, ..

Read more

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 automatically when check-ins are detected (we’re using Microsoft Azure pipeline). We’re using gcov and ..

Read more

I have followed this link(https://jhbell.com/using-cmake-and-gcov) to integrate gcov in CMake. But it is only working when all the test cases are passed. My few of the Google test cases are getting failed, so cmake is stopping generating the coverage report. Is there any way to change build system behavior for CMake? Source: Windows Que..

Read more

In my (linux-based) CI/CD pipeline i’m currently doing (basically): Build Release (cmake out-of-source-build) Test/(Custom-)Fuzz the build Build Instrumentation-focused = gcov + ASan (again: cmake) Test/(Custom-)Fuzz the build Process Coverage (gcovr) This is based on GCC 10 right now. While thinking about adding Sonarqube-based analysis (which means using a build-wrapper which hopefully is as non-intrusive as ..

Read more

I’m wondering if there is any way to get gcov coverage results while keeping the source code tree structure, so that we can see coverage results for entire folders ? I’m currently using lcov to visualize the results, but I don’t mind switching to another tool if is provides that features. Lcov output (top view) ..

Read more

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 can compile and run all these files to generate coverage using gcov ? ..

Read more