3.1.22. waf_tools.gcov
Integration of Gcov and gcovr into the Waf build system.
This waf tool adds code-coverage support to unit test builds. When the
--coverage command-line flag is passed, the tool injects GCC’s
--coverage compiler and linker flags into tasks that carry the test
feature and schedules a post-build step that invokes gcovr to produce a
coverage report.
3.1.22.1. Usage
Load the tool during
optionsandconfigure:def options(opt): opt.load("gcov", tooldir=TOOLDIR) def configure(ctx): ctx.load("gcov", tooldir=TOOLDIR)
Run the build with coverage enabled:
waf build_(app|bootloader)_unit_test_gcc --coverage
3.1.22.2. Dependencies
GCC
gcovr (https://gcovr.com/)
Functions
|
Configure the build environment for coverage. |
|
Executes gcovr with the configuration file stored in |
|
Register a post-build coverage step for test targets, if coverage is enabled. |
|
Register the |
|
Pretty-prints stdout/stderr of unit test results to the console. |