From 44b35bb9c4e4d4892eb1908a14b1d8aa769de27a Mon Sep 17 00:00:00 2001 From: Simon Guan Date: Mon, 3 Mar 2025 10:40:16 +0800 Subject: [PATCH 1/3] fix: remove tset files --- source/os/test/osFileTests.cpp | 2 +- source/os/test/osTests.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/os/test/osFileTests.cpp b/source/os/test/osFileTests.cpp index f9e40c2703..97e5c8493d 100644 --- a/source/os/test/osFileTests.cpp +++ b/source/os/test/osFileTests.cpp @@ -196,7 +196,7 @@ TEST(osFileTests, taosCopyFile) { retsize = taosReadFromCFile(NULL, 0, 0, NULL); EXPECT_EQ(retsize, 0); - taosRemoveFile(from); + taosRemoveFile(from); } TEST(osFileTests, taosCreateFile) { diff --git a/source/os/test/osTests.cpp b/source/os/test/osTests.cpp index f4e7eff323..1e4bcbd3d6 100644 --- a/source/os/test/osTests.cpp +++ b/source/os/test/osTests.cpp @@ -389,7 +389,7 @@ TEST(osTest, osFile) { (void)taosThreadJoin(thread2, NULL); taosThreadClear(&thread2); - // int ret = taosRemoveFile(fname); + taosRemoveFile(fname); // ASSERT_EQ(ret, 0); // printf("remove file success"); } @@ -651,6 +651,8 @@ TEST(osTest, osFilePerformance) { taosMemoryFree(writeBuffer); taosMemoryFree(readBuffer); + taosRemoveFile(fname); + (void)printf("Test Write file %d times, cost: %" PRId64 "us\n", TESTTIMES, WriteFileCost); (void)printf("Test Read file %d times, cost: %" PRId64 "us\n", TESTTIMES, ReadFileCost); (void)printf("Test OpenForWrite & Close file %d times, cost: %" PRId64 "us\n", TESTTIMES, OpenForWriteCloseFileCost); From 225b65707f428ea4fcfeb4b8a4a584f4f53d2668 Mon Sep 17 00:00:00 2001 From: Simon Guan Date: Thu, 13 Mar 2025 11:38:50 +0800 Subject: [PATCH 2/3] fix: enable test --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2be056ec4e..064765cd3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ include(${TD_SUPPORT_DIR}/cmake.options) include(${TD_SUPPORT_DIR}/cmake.define) include(${TD_SUPPORT_DIR}/cmake.version) include(${TD_SUPPORT_DIR}/cmake.install) +enable_testing() set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_NO_CYCLES OFF) @@ -34,6 +35,5 @@ add_subdirectory(docs/doxgen) if(${BUILD_TEST}) include(CTest) - enable_testing() add_subdirectory(examples/c) endif(${BUILD_TEST}) \ No newline at end of file From 64c650f5245c3bb7a922b826df39cde0b6757904 Mon Sep 17 00:00:00 2001 From: Simon Guan Date: Thu, 13 Mar 2025 11:51:38 +0800 Subject: [PATCH 3/3] fix: enable testing --- CMakeLists.txt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 064765cd3e..07760e923b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,21 +19,20 @@ include(${TD_SUPPORT_DIR}/cmake.options) include(${TD_SUPPORT_DIR}/cmake.define) include(${TD_SUPPORT_DIR}/cmake.version) include(${TD_SUPPORT_DIR}/cmake.install) -enable_testing() set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_NO_CYCLES OFF) +add_subdirectory(contrib) + +if(${BUILD_TEST}) + include(CTest) + enable_testing() + add_subdirectory(examples/c) +endif(${BUILD_TEST}) add_library(api INTERFACE) target_include_directories(api INTERFACE "include/client") - -add_subdirectory(contrib) add_subdirectory(source) add_subdirectory(tools) add_subdirectory(utils) add_subdirectory(tests) add_subdirectory(docs/doxgen) - -if(${BUILD_TEST}) - include(CTest) - add_subdirectory(examples/c) -endif(${BUILD_TEST}) \ No newline at end of file