diff --git a/source/libs/tfs/CMakeLists.txt b/source/libs/tfs/CMakeLists.txt index 1b6f662507..607ccd4c48 100644 --- a/source/libs/tfs/CMakeLists.txt +++ b/source/libs/tfs/CMakeLists.txt @@ -6,4 +6,8 @@ target_include_directories( PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/inc" ) -target_link_libraries(tfs os util common) \ No newline at end of file +target_link_libraries(tfs os util common) + +if(${BUILD_TEST}) + add_subdirectory(test) +endif(${BUILD_TEST}) \ No newline at end of file diff --git a/source/libs/tfs/test/CMakeLists.txt b/source/libs/tfs/test/CMakeLists.txt new file mode 100644 index 0000000000..ee28dcf723 --- /dev/null +++ b/source/libs/tfs/test/CMakeLists.txt @@ -0,0 +1,14 @@ +enable_testing() + +aux_source_directory(. TFS_TEST_SRC) +add_executable(tfs_test ${TFS_TEST_SRC}) +target_link_libraries( + tfs_test + PUBLIC tfs + PUBLIC gtest_main +) + +add_test( + NAME tfs_test + COMMAND tfs_test +) diff --git a/source/libs/tfs/test/tfsTest.cpp b/source/libs/tfs/test/tfsTest.cpp new file mode 100644 index 0000000000..a85bea192c --- /dev/null +++ b/source/libs/tfs/test/tfsTest.cpp @@ -0,0 +1,27 @@ +/** + * @file tfsTest.cpp + * @author slguan (slguan@taosdata.com) + * @brief TFS module tests + * @version 1.0 + * @date 2022-01-20 + * + * @copyright Copyright (c) 2022 + * + */ + +#include +#include "os.h" + +class TfsTest : public ::testing::Test { + protected: + static void SetUpTestSuite() {} + static void TearDownTestSuite() {} + + public: + void SetUp() override {} + void TearDown() override {} +}; + +TEST_F(TfsTest, 01_Open_Close) { + +}