diff --git a/source/server/vnode/CMakeLists.txt b/source/server/vnode/CMakeLists.txt index 03421b2628..20b50bf244 100644 --- a/source/server/vnode/CMakeLists.txt +++ b/source/server/vnode/CMakeLists.txt @@ -15,4 +15,9 @@ target_link_libraries( PUBLIC meta PUBLIC tq PUBLIC tsdb -) \ No newline at end of file +) + +# test +if(${BUILD_TEST}) + add_subdirectory(test) +endif(${BUILD_TEST}) diff --git a/source/server/vnode/test/CMakeLists.txt b/source/server/vnode/test/CMakeLists.txt new file mode 100644 index 0000000000..fad366e6ef --- /dev/null +++ b/source/server/vnode/test/CMakeLists.txt @@ -0,0 +1,9 @@ +# vnodeMemAllocatorTest +add_executable(VMATest "") +target_sources(VMATest + PRIVATE + "../src/vnodeMemAllocator.c" + "vnodeMemAllocatorTest.cpp" +) +target_include_directories(VMATest PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../inc") +target_link_libraries(VMATest os gtest_main) \ No newline at end of file diff --git a/source/server/vnode/test/vnodeMemAllocatorTest.cpp b/source/server/vnode/test/vnodeMemAllocatorTest.cpp new file mode 100644 index 0000000000..4de717d80d --- /dev/null +++ b/source/server/vnode/test/vnodeMemAllocatorTest.cpp @@ -0,0 +1,8 @@ +#include +#include + +#include "vnodeMemAllocator.h" + +TEST(VMATest, basic_create_and_destroy_test) { + std::cout << "Hello, this is VMA test" << std::endl; +} \ No newline at end of file