From e321a3be12ad5d960f02a1b79323c7ee6dab1d55 Mon Sep 17 00:00:00 2001 From: Simon Guan Date: Thu, 6 Mar 2025 13:49:31 +0800 Subject: [PATCH] refactor: cmake files --- source/libs/function/test/runUdf.c | 5 +---- tests/script/tsim/sync/3Replica1VgElect.sim | 17 +++++++---------- utils/CMakeLists.txt | 5 ++++- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/source/libs/function/test/runUdf.c b/source/libs/function/test/runUdf.c index f28b44d1b8..39f547cc06 100644 --- a/source/libs/function/test/runUdf.c +++ b/source/libs/function/test/runUdf.c @@ -1,6 +1,3 @@ -#include -#include -#include #include "uv.h" #include "fnLog.h" @@ -218,4 +215,4 @@ int main(int argc, char *argv[]) { fnError("failed to close udfc"); return -1; } -} +} \ No newline at end of file diff --git a/tests/script/tsim/sync/3Replica1VgElect.sim b/tests/script/tsim/sync/3Replica1VgElect.sim index 6ebee885a8..353ec2c792 100644 --- a/tests/script/tsim/sync/3Replica1VgElect.sim +++ b/tests/script/tsim/sync/3Replica1VgElect.sim @@ -91,19 +91,19 @@ endi if $data[0][4] == leader then if $data[0][7] == follower then if $data[0][10] == follower then - print ---- vgroup $data[0][0] leader locate on dnode $data[0][3] + print ---- vgroup $data[0][0] leader locate on dnode $data[0][4] endi endi -elif $data[0][6] == leader then - if $data[0][7] == follower then - if $data[0][10] == follower then - print ---- vgroup $data[0][0] leader locate on dnode $data[0][5] +elif $data[0][7] == leader then + if $data[0][10] == follower then + if $data[0][4] == follower then + print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] endi endi elif $data[0][10] == leader then if $data[0][4] == follower then if $data[0][7] == follower then - print ---- vgroup $data[0][0] leader locate on dnode $data[0][7] + print ---- vgroup $data[0][0] leader locate on dnode $data[0][10] endi endi else @@ -461,7 +461,4 @@ endi system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode2 -s stop -x SIGINT system sh/exec.sh -n dnode3 -s stop -x SIGINT -system sh/exec.sh -n dnode4 -s stop -x SIGINT - - - +system sh/exec.sh -n dnode4 -s stop -x SIGINT \ No newline at end of file diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 9872a9dc55..721da32bfc 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -1,6 +1,9 @@ # ADD_SUBDIRECTORY(examples/c) ADD_SUBDIRECTORY(tsim) -ADD_SUBDIRECTORY(test/c) + +IF(${BUILD_TEST}) + ADD_SUBDIRECTORY(test/c) +ENDIF(${BUILD_TEST}) # ADD_SUBDIRECTORY(comparisonTest/tdengine) IF(NOT "${TSZ_ENABLED}" MATCHES "false")