docs/dev/test_coverage.md
The coverage report is generated using Lcov tool and based on profile data generated by GCC.
The generated reports are in HTML form and located in <openvino_build>/coverage. The reports are generated for the following components:
inference - Inference component is a part of OpenVINO Runtime library.core - Core component is a part of OpenVINO Runtime library.low_precision_transformations - Low Precision transformations is a part of OpenVINO Runtime library.openvino_transformations - Common transformations is a part of OpenVINO Runtime library.snippets - OpenVINO snippets.hetero_plugin - Heterogeneous plugin.auto_plugin - Auto plugin.proxy_plugin - Proxy plugin.auto_batch_plugin - Auto-batching plugin.template_plugin - Template plugin.intel_gpu_plugin - GPU plugin.intel_cpu_plugin - CPU plugin.intel_npu_plugin - Intel® NPU plugin.To build coverage report, compile OpenVINO with an additional CMake option -DENABLE_COVERAGE=ON:
$ cmake -DENABLE_COVERAGE=ON .
And build OpenVINO as usual.
In order to generate coverage reports, first of all, the tests must be run. Depending on how many tests are run, the better coverage percentage can be achieved. E.g. for openvino component, InferenceEngineUnitTests, ieUnitTests, ieFuncTests must be run as well as plugin tests.
$ ctest -V
OpenVINO components define several common groups which allow to run tests for separate component (with ctest argiment -L GROUP_NAME):
After sufficient number of tests are executed, the coverage numbers can be calculated. In order to do this, run:
$ make ov_coverage
The following tree of reports are generated:
$ find coverage -maxdepth 2 -name index.html
coverage/auto_batch_plugin/index.html
coverage/auto_plugin/index.html
coverage/core/index.html
coverage/transformations/index.html
coverage/paddle_frontend/index.html
coverage/tf_frontend/index.html
coverage/openvino/index.html
coverage/onnx_frontend/index.html
coverage/ir_frontend/index.html
coverage/low_precision_transformations/index.html
coverage/proxy_plugin/index.html
coverage/template_plugin/index.html
coverage/inference/index.html
coverage/frontend_common/index.html
coverage/hetero_plugin/index.html
coverage/intel_cpu_plugin/index.html
coverage/intel_gpu_plugin/index.html
coverage/intel_npu_plugin/index.html