summaryrefslogtreecommitdiffstats
path: root/src/plugins/nat
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2021-11-11 19:22:12 +0100
committerOle Troan <ot@cisco.com>2021-11-11 19:33:37 +0100
commit9432340362a0eb8fe5ed39cdac0a907f0f50a461 (patch)
treea19848f80c3b6cc3e094190acc324d89fe64e838 /src/plugins/nat
parentef2c0f177dd3c6ea174ed210f15567b08939db4a (diff)
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 <ot@cisco.com> Change-Id: I9cbe9e3031afdcd03bc8f9203d662b91677724ab Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/plugins/nat')
-rw-r--r--src/plugins/nat/CMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/nat/CMakeLists.txt b/src/plugins/nat/CMakeLists.txt
index 2545da6da18..54c15374291 100644
--- a/src/plugins/nat/CMakeLists.txt
+++ b/src/plugins/nat/CMakeLists.txt
@@ -199,7 +199,7 @@ add_custom_target(test_pnat-run
DEPENDS test_pnat
)
-if("${CMAKE_VERSION}" VERSION_GREATER_EQUAL "3.13" AND "${CMAKE_C_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
+if(VPP_BUILD_TESTS_WITH_COVERAGE)
set(TARGET_NAME test_pnat)
set(COV_SOURCES ${CMAKE_SOURCE_DIR}/plugins/nat/pnat/pnat.c ${CMAKE_SOURCE_DIR}/plugins/nat/pnat/pnat_node.h ${CMAKE_SOURCE_DIR}/plugins/nat/pnat/pnat_node.c)