Maven Googletest

fatmanur61fatmanur61 Posts: 76

Hi our company use maven and we write our test with Googletest framework. We want to see coverage by using Parasoft standard edition. Parasoft only shows us coverage because we use jenkins and jenkins run Googletests. I searched some docs from customer portal but I did not find any maven with Google test usage together with parasoft. Could you inform me about this case?


  • Bogdan CzwartkowskiBogdan Czwartkowski Posts: 107 admin
    edited October 2019

    Hi @fatmanur61 ,

    Collecting coverage from GoogleTest runs done through Maven conceptually would be similar to what you need to do for regular runs of GoogleTest outside Maven, as outlined here:

    In short:
    1. You need to prefix your compiler with cpptestcc utility (plus needed options) to instrument the files
    2. You need to add our runtime library to your linker command line, so that instrumented objects can have their dependencies on our runtime symbols resolved
    3. Then the instrumented GoogleTest program can be run as usual to collect test results and at the same time obtain coverage log files for C/C++test
    4. Once coverage logs are available, you need to run C/C++test standard edition cpptestcli to convert raw coverage logs into reports.

    Items #1 and #2 will most likely require modification of your Maven POM files, to inject cpptestcc and add our runtime library.

    There is no dedicated support for Maven in C/C++test because there is no standard way of integrating C/C++ into Maven.

Sign In or Register to comment.