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})
"If build unit tests using googletest"
ON
)
ELSEIF (TD_DARWIN_64)
add_definitions(-DCOMPILER_SUPPORTS_CXX13)
option(
BUILD_TEST
"If build unit tests using googletest"
ON
)
ELSE ()
include(CheckCXXCompilerFlag)
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) {
}
void
Testbase
::
Init
(
const
char
*
path
,
int16_t
port
)
{
#ifdef _TD_DARWIN_64
osDefaultInit
();
#endif
tsServerPort
=
port
;
strcpy
(
tsLocalFqdn
,
"localhost"
);
snprintf
(
tsLocalEp
,
TSDB_EP_LEN
,
"%s:%u"
,
tsLocalFqdn
,
tsServerPort
);
...
...
source/libs/executor/test/CMakeLists.txt
浏览文件 @
c1fd5218
MESSAGE
(
STATUS
"build parser unit test"
)
# GoogleTest requires at least C++11
SET
(
CMAKE_CXX_STANDARD 11
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
IF
(
NOT TD_DARWIN
)
# GoogleTest requires at least C++11
SET
(
CMAKE_CXX_STANDARD 11
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
ADD_EXECUTABLE
(
executorTest
${
SOURCE_LIST
}
)
TARGET_LINK_LIBRARIES
(
executorTest
PRIVATE os util common transport gtest taos_static qcom executor function planner scalar nodes vnode
)
ADD_EXECUTABLE
(
executorTest
${
SOURCE_LIST
}
)
TARGET_LINK_LIBRARIES
(
executorTest
PRIVATE os util common transport gtest taos_static qcom executor function planner scalar nodes vnode
)
TARGET_INCLUDE_DIRECTORIES
(
executorTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/executor/"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/libs/executor/inc"
)
TARGET_INCLUDE_DIRECTORIES
(
executorTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/executor/"
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) {
#ifdef WINDOWS
GetModuleFileName
(
NULL
,
path
,
PATH_MAX
);
taosDirName
(
path
);
#elif defined(_TD_DARWIN_64)
uint32_t
pathSize
=
sizeof
(
path
);
_NSGetExecutablePath
(
path
,
&
pathSize
);
taosDirName
(
path
);
#endif
}
else
{
strncpy
(
path
,
tsProcPath
,
strlen
(
tsProcPath
));
...
...
source/libs/index/test/CMakeLists.txt
浏览文件 @
c1fd5218
add_executable
(
idxTest
""
)
add_executable
(
idxFstTest
""
)
add_executable
(
idxFstUT
""
)
add_executable
(
idxUtilUT
""
)
add_executable
(
idxJsonUT
""
)
IF
(
NOT TD_DARWIN
)
add_executable
(
idxTest
""
)
add_executable
(
idxFstTest
""
)
add_executable
(
idxFstUT
""
)
add_executable
(
idxUtilUT
""
)
add_executable
(
idxJsonUT
""
)
target_sources
(
idxTest
PRIVATE
"indexTests.cc"
)
target_sources
(
idxFstTest
PRIVATE
"fstTest.cc"
)
target_sources
(
idxTest
PRIVATE
"indexTests.cc"
)
target_sources
(
idxFstTest
PRIVATE
"fstTest.cc"
)
target_sources
(
idxFstUT
PRIVATE
"fstUT.cc"
)
target_sources
(
idxUtilUT
PRIVATE
"utilUT.cc"
)
target_sources
(
idxFstUT
PRIVATE
"fstUT.cc"
)
target_sources
(
idxUtilUT
PRIVATE
"utilUT.cc"
)
target_sources
(
idxJsonUT
PRIVATE
"jsonUT.cc"
)
target_include_directories
(
idxTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
target_include_directories
(
idxFstTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
target_sources
(
idxJsonUT
PRIVATE
"jsonUT.cc"
)
target_include_directories
(
idxTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
target_include_directories
(
idxFstTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
target_include_directories
(
idxFstUT
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
target_include_directories
(
idxFstUT
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
target_include_directories
(
idxUtilUT
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
target_include_directories
(
idxUtilUT
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
target_include_directories
(
idxJsonUT
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
target_link_libraries
(
idxTest
os
util
common
gtest_main
index
)
target_link_libraries
(
idxFstTest
os
util
common
gtest_main
index
)
target_link_libraries
(
idxFstUT
os
util
common
gtest_main
index
)
target_include_directories
(
idxJsonUT
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/index"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/../inc"
)
target_link_libraries
(
idxTest
os
util
common
gtest_main
index
)
target_link_libraries
(
idxFstTest
os
util
common
gtest_main
index
)
target_link_libraries
(
idxFstUT
os
util
common
gtest_main
index
)
target_link_libraries
(
idxUtilUT
os
util
common
gtest_main
index
)
target_link_libraries
(
idxUtilUT
os
util
common
gtest_main
index
)
target_link_libraries
(
idxJsonUT
os
util
common
gtest_main
index
)
target_link_libraries
(
idxJsonUT
os
util
common
gtest_main
index
)
add_test
(
NAME idxtest
COMMAND idxTest
)
add_test
(
NAME idxJsonUT
COMMAND idxJsonUT
)
add_test
(
NAME idxUtilUT
COMMAND idxUtilUT
)
add_test
(
NAME idxFstUT
COMMAND idxFstUT
)
add_test
(
NAME idxtest
COMMAND idxTest
)
add_test
(
NAME idxJsonUT
COMMAND idxJsonUT
)
add_test
(
NAME idxUtilUT
COMMAND idxUtilUT
)
add_test
(
NAME idxFstUT
COMMAND idxFstUT
)
ENDIF
()
\ No newline at end of file
source/libs/planner/test/CMakeLists.txt
浏览文件 @
c1fd5218
MESSAGE
(
STATUS
"build planner unit test"
)
# GoogleTest requires at least C++11
SET
(
CMAKE_CXX_STANDARD 11
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
IF
(
NOT TD_DARWIN
)
# GoogleTest requires at least C++11
SET
(
CMAKE_CXX_STANDARD 11
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
ADD_EXECUTABLE
(
plannerTest
ADD_EXECUTABLE
(
plannerTest
${
SOURCE_LIST
}
"
${
SOURCE_LIST
}
/../../../parser/test/mockCatalog.cpp"
"
${
SOURCE_LIST
}
/../../../parser/test/mockCatalogService.cpp"
)
)
TARGET_LINK_LIBRARIES
(
plannerTest
PUBLIC os util common nodes planner parser catalog transport gtest function qcom
)
TARGET_LINK_LIBRARIES
(
plannerTest
PUBLIC os util common nodes planner parser catalog transport gtest function qcom
)
TARGET_INCLUDE_DIRECTORIES
(
plannerTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/planner/"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/libs/planner/inc"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/libs/parser/test"
)
TARGET_INCLUDE_DIRECTORIES
(
plannerTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/include/libs/planner/"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/libs/planner/inc"
PRIVATE
"
${
TD_SOURCE_DIR
}
/source/libs/parser/test"
)
if
(
${
BUILD_WINGETOPT
}
)
target_include_directories
(
plannerTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/contrib/wingetopt/src"
)
target_link_libraries
(
plannerTest PUBLIC wingetopt
)
endif
()
if
(
${
BUILD_WINGETOPT
}
)
target_include_directories
(
plannerTest
PUBLIC
"
${
TD_SOURCE_DIR
}
/contrib/wingetopt/src"
)
target_link_libraries
(
plannerTest PUBLIC wingetopt
)
endif
()
add_test
(
NAME plannerTest
COMMAND plannerTest
)
add_test
(
NAME plannerTest
COMMAND plannerTest
)
ENDIF
()
\ No newline at end of file
source/libs/tfs/test/tfsTest.cpp
浏览文件 @
c1fd5218
...
...
@@ -16,7 +16,11 @@
class
TfsTest
:
public
::
testing
::
Test
{
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"
;
}
#endif
static
void
TearDownTestSuite
()
{}
public:
...
...
@@ -299,6 +303,17 @@ TEST_F(TfsTest, 04_File) {
TEST_F
(
TfsTest
,
05
_MultiDisk
)
{
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
*
root01
=
TD_TMP_DIR_PATH
"tfsTest01"
;
const
char
*
root10
=
TD_TMP_DIR_PATH
"tfsTest10"
;
...
...
@@ -308,6 +323,7 @@ TEST_F(TfsTest, 05_MultiDisk) {
const
char
*
root21
=
TD_TMP_DIR_PATH
"tfsTest21"
;
const
char
*
root22
=
TD_TMP_DIR_PATH
"tfsTest22"
;
const
char
*
root23
=
TD_TMP_DIR_PATH
"tfsTest23"
;
#endif
SDiskCfg
dCfg
[
9
]
=
{
0
};
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录