diff --git a/CMakeLists.txt b/CMakeLists.txt index 04a3ce0..72001e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,3 +111,8 @@ ENDIF () ADD_SUBDIRECTORY(srcs) ADD_SUBDIRECTORY(srcs/libs) ADD_SUBDIRECTORY(srcs/httpserver) + +IF (BUILD_TESTING) + ADD_SUBDIRECTORY(test) + ADD_SUBDIRECTORY(srcs/libs/unit_test) +ENDIF () diff --git a/srcs/libs/CMakeLists.txt b/srcs/libs/CMakeLists.txt index 5bb4284..a19ed4c 100644 --- a/srcs/libs/CMakeLists.txt +++ b/srcs/libs/CMakeLists.txt @@ -61,7 +61,3 @@ IF (USED_OPENDHCPD) ENDIF () TARGET_INCLUDE_DIRECTORIES(${LIB_PROJECT_TARGET} PUBLIC ${PROJECT_BINARY_DIR}/ ${CMAKE_BINARY_DIR}/) - -IF (BUILD_TESTING) - ADD_SUBDIRECTORY(unit_test) -ENDIF () \ No newline at end of file diff --git a/srcs/libs/unit_test/CMakeLists.txt b/srcs/libs/unit_test/CMakeLists.txt index 839716b..7907a5a 100644 --- a/srcs/libs/unit_test/CMakeLists.txt +++ b/srcs/libs/unit_test/CMakeLists.txt @@ -1,6 +1,6 @@ PROJECT(libcommon_utest) -INCLUDE_DIRECTORIES(./ ../include ../../include) +INCLUDE_DIRECTORIES(./ ../include ../../include ../../test) AUX_SOURCE_DIRECTORY(misc UTEST_SRC) diff --git a/srcs/libs/unit_test/misc/uuid_test.cpp b/srcs/libs/unit_test/misc/uuid_test.cpp index 259f49b..b8c4959 100644 --- a/srcs/libs/unit_test/misc/uuid_test.cpp +++ b/srcs/libs/unit_test/misc/uuid_test.cpp @@ -3,7 +3,7 @@ // // provides main(); this line is required in only one .cpp file #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN -#include "../doctest.h" +#include "doctest.h" #include "uuid.h" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..bf8f0f8 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,3 @@ +PROJECT(vcpe_utest) + +INCLUDE_DIRECTORIES(./ ../srcs/include ../srcs/libs/include) diff --git a/srcs/libs/unit_test/doctest.h b/test/doctest.h similarity index 100% rename from srcs/libs/unit_test/doctest.h rename to test/doctest.h