From dca01dda58c8c4b369130ea0ff6803cfa30e4f23 Mon Sep 17 00:00:00 2001 From: Minghao Li Date: Tue, 22 Feb 2022 11:52:49 +0800 Subject: [PATCH] add test --- source/libs/sync/CMakeLists.txt | 6 +++++- source/libs/sync/test/CMakeLists.txt | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 source/libs/sync/test/CMakeLists.txt diff --git a/source/libs/sync/CMakeLists.txt b/source/libs/sync/CMakeLists.txt index 37ee5194c8..cb38d7e363 100644 --- a/source/libs/sync/CMakeLists.txt +++ b/source/libs/sync/CMakeLists.txt @@ -13,4 +13,8 @@ target_include_directories( sync PUBLIC "${CMAKE_SOURCE_DIR}/include/libs/sync" PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" -) \ No newline at end of file +) + +if(${BUILD_TEST}) + add_subdirectory(test) +endif(${BUILD_TEST}) diff --git a/source/libs/sync/test/CMakeLists.txt b/source/libs/sync/test/CMakeLists.txt new file mode 100644 index 0000000000..f24a1a9a46 --- /dev/null +++ b/source/libs/sync/test/CMakeLists.txt @@ -0,0 +1,20 @@ +add_executable(syncTest "") +target_sources(syncTest + PRIVATE + "syncTest.cpp" +) +target_include_directories(syncTest + PUBLIC + "${CMAKE_SOURCE_DIR}/include/libs/sync" + "${CMAKE_CURRENT_SOURCE_DIR}/../inc" +) + +target_link_libraries(syncTest + sync + gtest_main +) +enable_testing() +add_test( + NAME sync_test + COMMAND syncTest +) -- GitLab