From 9432340362a0eb8fe5ed39cdac0a907f0f50a461 Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Thu, 11 Nov 2021 19:22:12 +0100 Subject: tests: make code coverage for unit tests optional Add a new cmake option VPP_BUILD_TESTS_WITH_COVERAGE to enable building unittests with clang code coverage. Type: improvement Signed-off-by: Ole Troan Change-Id: I9cbe9e3031afdcd03bc8f9203d662b91677724ab Signed-off-by: Ole Troan --- src/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3966bc322ce..a1764f73b18 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -156,6 +156,14 @@ if(VPP_ENABLE_TRAJECTORY_TRACE) add_compile_definitions(VLIB_BUFFER_TRACE_TRAJECTORY=1) endif() +############################################################################## +# unittest with clang ode coverage +############################################################################## + +if("${CMAKE_VERSION}" VERSION_GREATER_EQUAL "3.13" AND "${CMAKE_C_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang") + option(VPP_BUILD_TESTS_WITH_COVERAGE "Build unit tests with code coverage" OFF) +endif() + ############################################################################## # install config ############################################################################## -- cgit 1.2.3-korg