aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 27d3b419e..31f40aaa6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,6 +36,7 @@ option(BUILD_HICNPLUGIN "Build the hicn vpp plugin" OFF)
option(BUILD_SYSREPOPLUGIN "Build the sysrepo plugin" OFF)
option(BUILD_EXTRAS "Build external projects" OFF)
option(BUILD_TELEMETRY "Build telemetry projects" OFF)
+option(BUILD_TESTS "Build unit tests" OFF)
option(DISABLE_EXECUTABLES "Disable executables" OFF)
if ((BUILD_APPS OR BUILD_UTILS) AND NOT BUILD_LIBTRANSPORT)
@@ -97,6 +98,18 @@ if (NOT WIN32)
add_compile_options(-Wall -Werror -Wno-shorten-64-to-32)
endif ()
+# Add unit tests
+if (BUILD_TESTS)
+ message(STATUS "Tests enabled.")
+ include (GTestImport)
+
+ if(${CMAKE_VERSION} VERSION_GREATER "3.10.0")
+ include (GoogleTest)
+ else()
+ include (CTest)
+ endif()
+endif()
+
message(STATUS "Building the following subprojects: ${subdirs}")
foreach(dir ${subdirs})