Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c1fd5218
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c1fd5218
编写于
7月 07, 2022
作者:
S
slzhou
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of github.com:taosdata/TDengine into szhou/feature/push-project-condition
上级
f32cbdee
ac08c6ea
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
176 addition
and
140 deletion
+176
-140
cmake/cmake.options
cmake/cmake.options
+7
-0
source/dnode/mgmt/test/sut/src/sut.cpp
source/dnode/mgmt/test/sut/src/sut.cpp
+3
-0
source/libs/executor/test/CMakeLists.txt
source/libs/executor/test/CMakeLists.txt
+15
-13
source/libs/function/src/tudf.c
source/libs/function/src/tudf.c
+4
-0
source/libs/index/test/CMakeLists.txt
source/libs/index/test/CMakeLists.txt
+103
-101
source/libs/planner/test/CMakeLists.txt
source/libs/planner/test/CMakeLists.txt
+28
-26
source/libs/tfs/test/tfsTest.cpp
source/libs/tfs/test/tfsTest.cpp
+16
-0
未找到文件。
cmake/cmake.options
浏览文件 @
c1fd5218
...
@@ -51,6 +51,13 @@ IF(${TD_WINDOWS})
...
@@ -51,6 +51,13 @@ IF(${TD_WINDOWS})
"If build unit tests using googletest"
"If build unit tests using googletest"
ON
ON
)
)
ELSEIF (TD_DARWIN_64)
add_definitions(-DCOMPILER_SUPPORTS_CXX13)
option(
BUILD_TEST
"If build unit tests using googletest"
ON
)
ELSE ()
ELSE ()
include(CheckCXXCompilerFlag)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++13" COMPILER_SUPPORTS_CXX13)
CHECK_CXX_COMPILER_FLAG("-std=c++13" COMPILER_SUPPORTS_CXX13)
...
...
source/dnode/mgmt/test/sut/src/sut.cpp
浏览文件 @
c1fd5218
...
@@ -43,6 +43,9 @@ if (taosInitLog("taosdlog", 1) != 0) {
...
@@ -43,6 +43,9 @@ if (taosInitLog("taosdlog", 1) != 0) {
}
}
void
Testbase
::
Init
(
const
char
*
path
,
int16_t
port
)
{
void
Testbase
::
Init
(
const
char
*
path
,
int16_t
port
)
{
#ifdef _TD_DARWIN_64
osDefaultInit
();
#endif
tsServerPort
=
port
;
tsServerPort
=
port
;
strcpy
(
tsLocalFqdn
,
"localhost"
);
strcpy
(
tsLocalFqdn
,
"localhost"
);
snprintf
(
tsLocalEp
,
TSDB_EP_LEN
,
"%s:%u"
,
tsLocalFqdn
,
tsServerPort
);
snprintf
(
tsLocalEp
,
TSDB_EP_LEN
,
"%s:%u"
,
tsLocalFqdn
,
tsServerPort
);
...
...
source/libs/executor/test/CMakeLists.txt
浏览文件 @
c1fd5218
MESSAGE
(
STATUS
"build parser unit test"
)
MESSAGE
(
STATUS
"build parser unit test"
)
# GoogleTest requires at least C++11
IF
(
NOT TD_DARWIN
)
SET
(
CMAKE_CXX_STANDARD 11
)
# GoogleTest requires at least C++11
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
SET
(
CMAKE_CXX_STANDARD 11
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
ADD_EXECUTABLE
(
executorTest
${
SOURCE_LIST
}
)
ADD_EXECUTABLE
(
executorTest
${
SOURCE_LIST
}
)
TARGET_LINK_LIBRARIES
(
TARGET_LINK_LIBRARIES
(
executorTest
executorTest
PRIVATE os util common transport gtest taos_static qcom executor function planner scalar nodes vnode
PRIVATE os util common transport gtest taos_static qcom executor function planner scalar nodes vnode
)
)
TARGET_INCLUDE_DIRECTORIES
(
TARGET_INCLUDE_DIRECTORIES
(
executorTest
executorTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/executor/"
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/executor/"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/libs/executor/inc"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/libs/executor/inc"
)
)
ENDIF
()
\ No newline at end of file
source/libs/function/src/tudf.c
浏览文件 @
c1fd5218
...
@@ -75,6 +75,10 @@ static int32_t udfSpawnUdfd(SUdfdData* pData) {
...
@@ -75,6 +75,10 @@ static int32_t udfSpawnUdfd(SUdfdData* pData) {
#ifdef WINDOWS
#ifdef WINDOWS
GetModuleFileName
(
NULL
,
path
,
PATH_MAX
);
GetModuleFileName
(
NULL
,
path
,
PATH_MAX
);
taosDirName
(
path
);
taosDirName
(
path
);
#elif defined(_TD_DARWIN_64)
uint32_t
pathSize
=
sizeof
(
path
);
_NSGetExecutablePath
(
path
,
&
pathSize
);
taosDirName
(
path
);
#endif
#endif
}
else
{
}
else
{
strncpy
(
path
,
tsProcPath
,
strlen
(
tsProcPath
));
strncpy
(
path
,
tsProcPath
,
strlen
(
tsProcPath
));
...
...
source/libs/index/test/CMakeLists.txt
浏览文件 @
c1fd5218
add_executable
(
idxTest
""
)
IF
(
NOT TD_DARWIN
)
add_executable
(
idxFstTest
""
)
add_executable
(
idxTest
""
)
add_executable
(
idxFstUT
""
)
add_executable
(
idxFstTest
""
)
add_executable
(
idxUtilUT
""
)
add_executable
(
idxFstUT
""
)
add_executable
(
idxJsonUT
""
)
add_executable
(
idxUtilUT
""
)
add_executable
(
idxJsonUT
""
)
target_sources
(
idxTest
target_sources
(
idxTest
PRIVATE
PRIVATE
"indexTests.cc"
"indexTests.cc"
)
)
target_sources
(
idxFstTest
target_sources
(
idxFstTest
PRIVATE
PRIVATE
"fstTest.cc"
"fstTest.cc"
)
)
target_sources
(
idxFstUT
target_sources
(
idxFstUT
PRIVATE
PRIVATE
"fstUT.cc"
"fstUT.cc"
)
)
target_sources
(
idxUtilUT
target_sources
(
idxUtilUT
PRIVATE
PRIVATE
"utilUT.cc"
"utilUT.cc"
)
)
target_sources
(
idxJsonUT
target_sources
(
idxJsonUT
PRIVATE
PRIVATE
"jsonUT.cc"
"jsonUT.cc"
)
)
target_include_directories
(
idxTest
target_include_directories
(
idxTest
PUBLIC
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
)
target_include_directories
(
idxFstTest
target_include_directories
(
idxFstTest
PUBLIC
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
)
target_include_directories
(
idxFstUT
target_include_directories
(
idxFstUT
PUBLIC
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
)
target_include_directories
(
idxUtilUT
target_include_directories
(
idxUtilUT
PUBLIC
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
)
target_include_directories
(
idxJsonUT
target_include_directories
(
idxJsonUT
PUBLIC
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
)
target_link_libraries
(
idxTest
target_link_libraries
(
idxTest
os
os
util
util
common
common
gtest_main
gtest_main
index
index
)
)
target_link_libraries
(
idxFstTest
target_link_libraries
(
idxFstTest
os
os
util
util
common
common
gtest_main
gtest_main
index
index
)
)
target_link_libraries
(
idxFstUT
target_link_libraries
(
idxFstUT
os
os
util
util
common
common
gtest_main
gtest_main
index
index
)
)
target_link_libraries
(
idxUtilUT
target_link_libraries
(
idxUtilUT
os
os
util
util
common
common
gtest_main
gtest_main
index
index
)
)
target_link_libraries
(
idxJsonUT
target_link_libraries
(
idxJsonUT
os
os
util
util
common
common
gtest_main
gtest_main
index
index
)
)
add_test
(
add_test
(
NAME idxtest
NAME idxtest
COMMAND idxTest
COMMAND idxTest
)
)
add_test
(
add_test
(
NAME idxJsonUT
NAME idxJsonUT
COMMAND idxJsonUT
COMMAND idxJsonUT
)
)
add_test
(
add_test
(
NAME idxUtilUT
NAME idxUtilUT
COMMAND idxUtilUT
COMMAND idxUtilUT
)
)
add_test
(
add_test
(
NAME idxFstUT
NAME idxFstUT
COMMAND idxFstUT
COMMAND idxFstUT
)
)
ENDIF
()
\ No newline at end of file
source/libs/planner/test/CMakeLists.txt
浏览文件 @
c1fd5218
MESSAGE
(
STATUS
"build planner unit test"
)
MESSAGE
(
STATUS
"build planner unit test"
)
# GoogleTest requires at least C++11
IF
(
NOT TD_DARWIN
)
SET
(
CMAKE_CXX_STANDARD 11
)
# GoogleTest requires at least C++11
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
SET
(
CMAKE_CXX_STANDARD 11
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
ADD_EXECUTABLE
(
plannerTest
ADD_EXECUTABLE
(
plannerTest
${
SOURCE_LIST
}
${
SOURCE_LIST
}
"
${
SOURCE_LIST
}
/../../../parser/test/mockCatalog.cpp"
"
${
SOURCE_LIST
}
/../../../parser/test/mockCatalog.cpp"
"
${
SOURCE_LIST
}
/../../../parser/test/mockCatalogService.cpp"
"
${
SOURCE_LIST
}
/../../../parser/test/mockCatalogService.cpp"
)
)
TARGET_LINK_LIBRARIES
(
TARGET_LINK_LIBRARIES
(
plannerTest
plannerTest
PUBLIC os util common nodes planner parser catalog transport gtest function qcom
PUBLIC os util common nodes planner parser catalog transport gtest function qcom
)
)
TARGET_INCLUDE_DIRECTORIES
(
TARGET_INCLUDE_DIRECTORIES
(
plannerTest
plannerTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/planner/"
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/planner/"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/libs/planner/inc"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/libs/planner/inc"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/libs/parser/test"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/libs/parser/test"
)
)
if
(
${
BUILD_WINGETOPT
}
)
if
(
${
BUILD_WINGETOPT
}
)
target_include_directories
(
target_include_directories
(
plannerTest
plannerTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/contrib/wingetopt/src"
PUBLIC
"
${
TD_SOURCE_DIR
}
/contrib/wingetopt/src"
)
)
target_link_libraries
(
plannerTest PUBLIC wingetopt
)
target_link_libraries
(
plannerTest PUBLIC wingetopt
)
endif
()
endif
()
add_test
(
add_test
(
NAME plannerTest
NAME plannerTest
COMMAND plannerTest
COMMAND plannerTest
)
)
ENDIF
()
\ No newline at end of file
source/libs/tfs/test/tfsTest.cpp
浏览文件 @
c1fd5218
...
@@ -16,7 +16,11 @@
...
@@ -16,7 +16,11 @@
class
TfsTest
:
public
::
testing
::
Test
{
class
TfsTest
:
public
::
testing
::
Test
{
protected:
protected:
#ifdef _TD_DARWIN_64
static
void
SetUpTestSuite
()
{
root
=
"/private"
TD_TMP_DIR_PATH
"tfsTest"
;
}
#else
static
void
SetUpTestSuite
()
{
root
=
TD_TMP_DIR_PATH
"tfsTest"
;
}
static
void
SetUpTestSuite
()
{
root
=
TD_TMP_DIR_PATH
"tfsTest"
;
}
#endif
static
void
TearDownTestSuite
()
{}
static
void
TearDownTestSuite
()
{}
public:
public:
...
@@ -299,6 +303,17 @@ TEST_F(TfsTest, 04_File) {
...
@@ -299,6 +303,17 @@ TEST_F(TfsTest, 04_File) {
TEST_F
(
TfsTest
,
05
_MultiDisk
)
{
TEST_F
(
TfsTest
,
05
_MultiDisk
)
{
int32_t
code
=
0
;
int32_t
code
=
0
;
#ifdef _TD_DARWIN_64
const
char
*
root00
=
"/private"
TD_TMP_DIR_PATH
"tfsTest00"
;
const
char
*
root01
=
"/private"
TD_TMP_DIR_PATH
"tfsTest01"
;
const
char
*
root10
=
"/private"
TD_TMP_DIR_PATH
"tfsTest10"
;
const
char
*
root11
=
"/private"
TD_TMP_DIR_PATH
"tfsTest11"
;
const
char
*
root12
=
"/private"
TD_TMP_DIR_PATH
"tfsTest12"
;
const
char
*
root20
=
"/private"
TD_TMP_DIR_PATH
"tfsTest20"
;
const
char
*
root21
=
"/private"
TD_TMP_DIR_PATH
"tfsTest21"
;
const
char
*
root22
=
"/private"
TD_TMP_DIR_PATH
"tfsTest22"
;
const
char
*
root23
=
"/private"
TD_TMP_DIR_PATH
"tfsTest23"
;
#else
const
char
*
root00
=
TD_TMP_DIR_PATH
"tfsTest00"
;
const
char
*
root00
=
TD_TMP_DIR_PATH
"tfsTest00"
;
const
char
*
root01
=
TD_TMP_DIR_PATH
"tfsTest01"
;
const
char
*
root01
=
TD_TMP_DIR_PATH
"tfsTest01"
;
const
char
*
root10
=
TD_TMP_DIR_PATH
"tfsTest10"
;
const
char
*
root10
=
TD_TMP_DIR_PATH
"tfsTest10"
;
...
@@ -308,6 +323,7 @@ TEST_F(TfsTest, 05_MultiDisk) {
...
@@ -308,6 +323,7 @@ TEST_F(TfsTest, 05_MultiDisk) {
const
char
*
root21
=
TD_TMP_DIR_PATH
"tfsTest21"
;
const
char
*
root21
=
TD_TMP_DIR_PATH
"tfsTest21"
;
const
char
*
root22
=
TD_TMP_DIR_PATH
"tfsTest22"
;
const
char
*
root22
=
TD_TMP_DIR_PATH
"tfsTest22"
;
const
char
*
root23
=
TD_TMP_DIR_PATH
"tfsTest23"
;
const
char
*
root23
=
TD_TMP_DIR_PATH
"tfsTest23"
;
#endif
SDiskCfg
dCfg
[
9
]
=
{
0
};
SDiskCfg
dCfg
[
9
]
=
{
0
};
tstrncpy
(
dCfg
[
0
].
dir
,
root01
,
TSDB_FILENAME_LEN
);
tstrncpy
(
dCfg
[
0
].
dir
,
root01
,
TSDB_FILENAME_LEN
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录