Skip to content

Code Coverage

Malolan Vasu edited this page May 7, 2020 · 3 revisions

Running Code Coverage tools

Install tools

First, install gcov and lcov.

Backend Tests

First delete any existing build directories in the parent directory of the git repo clone. Use QTCreator to run the subproject tests/backend/. Create a directory called lcovBackend in the git repo clone's parent directory.

Then, go to the parent directory of the git repo clone and run the following commands:

lcov --capture --directory build-lafayette53-Desktop_Qt_5_14_1_clang_64bit-Debug/tests/backend --output-file lcovBackend/coverage.info

genhtml lcovBackend/coverage.info --output-directory lcovBackend

Model Tests

Use QTCreator to run the subproject tests/model/. Create a directory called lcovModel in the git repo clone's parent directory.

Then, go to the parent directory of the git repo clone and run the following commands:

lcov --capture --directory build-lafayette53-Desktop_Qt_5_14_1_clang_64bit-Debug/tests/backend --output-file lcovModel/coverage.info

genhtml lcovModel/coverage.info --output-directory lcovModel