Collect coverage
semlanik 於 5 年之前 修改了此頁面

QtProtobuf has integrated procedure to collect code coverage for own libraries.

Collecting coverage only supported by linux-like OS's, because of gcov usage

Prerequesties

  • Make sure that you have gcov installed in your system

Optional:

  • Install gcovr to produce nice HTML coverage reports

Collect coverage

In project directory:

mkdir build
cd build
cmake .. -DMAKE_COVERAGE=ON -DCMAKE_BUILD_TYPE=DEBUG
cmake --build . -- j<N>
ctest #Run tests to collect coverage data
cmake --build . --target <QtProtobuf|QtGrpc>_coverage

Artifacts will be placed in gcov folder