sanitycheck: support coverage with unit tests

Fix setting coverage for unit tests and link against gcov when coverage
is enabled.

Fixes #24674

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2020-04-28 14:27:46 -04:00
commit 051602f4f3
2 changed files with 6 additions and 0 deletions

View file

@ -71,6 +71,10 @@ if(COVERAGE)
-fprofile-arcs
-ftest-coverage
)
target_link_libraries(testbinary PRIVATE
-lgcov
)
endif()
if(LIBS)