OCT 1. 重新整理单元测试目录结构

This commit is contained in:
huangxin 2023-02-01 10:10:49 +08:00
parent ec81857489
commit c99c119b2f
6 changed files with 10 additions and 6 deletions

View File

@ -111,3 +111,8 @@ ENDIF ()
ADD_SUBDIRECTORY(srcs) ADD_SUBDIRECTORY(srcs)
ADD_SUBDIRECTORY(srcs/libs) ADD_SUBDIRECTORY(srcs/libs)
ADD_SUBDIRECTORY(srcs/httpserver) ADD_SUBDIRECTORY(srcs/httpserver)
IF (BUILD_TESTING)
ADD_SUBDIRECTORY(test)
ADD_SUBDIRECTORY(srcs/libs/unit_test)
ENDIF ()

View File

@ -61,7 +61,3 @@ IF (USED_OPENDHCPD)
ENDIF () ENDIF ()
TARGET_INCLUDE_DIRECTORIES(${LIB_PROJECT_TARGET} PUBLIC ${PROJECT_BINARY_DIR}/ ${CMAKE_BINARY_DIR}/) TARGET_INCLUDE_DIRECTORIES(${LIB_PROJECT_TARGET} PUBLIC ${PROJECT_BINARY_DIR}/ ${CMAKE_BINARY_DIR}/)
IF (BUILD_TESTING)
ADD_SUBDIRECTORY(unit_test)
ENDIF ()

View File

@ -1,6 +1,6 @@
PROJECT(libcommon_utest) PROJECT(libcommon_utest)
INCLUDE_DIRECTORIES(./ ../include ../../include) INCLUDE_DIRECTORIES(./ ../include ../../include ../../test)
AUX_SOURCE_DIRECTORY(misc UTEST_SRC) AUX_SOURCE_DIRECTORY(misc UTEST_SRC)

View File

@ -3,7 +3,7 @@
// //
// provides main(); this line is required in only one .cpp file // provides main(); this line is required in only one .cpp file
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "../doctest.h" #include "doctest.h"
#include "uuid.h" #include "uuid.h"

3
test/CMakeLists.txt Normal file
View File

@ -0,0 +1,3 @@
PROJECT(vcpe_utest)
INCLUDE_DIRECTORIES(./ ../srcs/include ../srcs/libs/include)