tests: make code coverage for unit tests optional
[vpp.git] / src / CMakeLists.txt
index 3966bc3..a1764f7 100644 (file)
@@ -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
 ##############################################################################