Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1dd6f365
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看板
未验证
提交
1dd6f365
编写于
6月 15, 2021
作者:
J
Jun Li
提交者:
GitHub
6月 16, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add support to build queryTest, cliTest and osTest (#6497)
上级
d644bf5c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
19 deletion
+32
-19
src/client/tests/CMakeLists.txt
src/client/tests/CMakeLists.txt
+6
-1
src/os/tests/CMakeLists.txt
src/os/tests/CMakeLists.txt
+6
-1
src/query/src/qTsbuf.c
src/query/src/qTsbuf.c
+13
-16
src/query/tests/CMakeLists.txt
src/query/tests/CMakeLists.txt
+7
-1
未找到文件。
src/client/tests/CMakeLists.txt
浏览文件 @
1dd6f365
...
...
@@ -7,7 +7,12 @@ FIND_LIBRARY(LIB_GTEST_STATIC_DIR libgtest.a /usr/lib/ /usr/local/lib)
IF
(
HEADER_GTEST_INCLUDE_DIR AND LIB_GTEST_STATIC_DIR
)
MESSAGE
(
STATUS
"gTest library found, build unit test"
)
INCLUDE_DIRECTORIES
(
${
HEADER_GTEST_INCLUDE_DIR
}
)
# GoogleTest requires at least C++11
SET
(
CMAKE_CXX_STANDARD 11
)
INCLUDE_DIRECTORIES
(
/usr/include /usr/local/include
)
LINK_DIRECTORIES
(
/usr/lib /usr/local/lib
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
ADD_EXECUTABLE
(
cliTest
${
SOURCE_LIST
}
)
...
...
src/os/tests/CMakeLists.txt
浏览文件 @
1dd6f365
...
...
@@ -7,7 +7,12 @@ FIND_LIBRARY(LIB_GTEST_STATIC_DIR libgtest.a /usr/lib/ /usr/local/lib)
IF
(
HEADER_GTEST_INCLUDE_DIR AND LIB_GTEST_STATIC_DIR
)
MESSAGE
(
STATUS
"gTest library found, build unit test"
)
INCLUDE_DIRECTORIES
(
${
HEADER_GTEST_INCLUDE_DIR
}
)
# GoogleTest requires at least C++11
SET
(
CMAKE_CXX_STANDARD 11
)
INCLUDE_DIRECTORIES
(
/usr/include /usr/local/include
)
LINK_DIRECTORIES
(
/usr/lib /usr/local/lib
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
ADD_EXECUTABLE
(
osTest
${
SOURCE_LIST
}
)
...
...
src/query/src/qTsbuf.c
浏览文件 @
1dd6f365
...
...
@@ -812,34 +812,31 @@ int32_t tsBufMerge(STSBuf* pDestBuf, const STSBuf* pSrcBuf) {
int64_t
offset
=
getDataStartOffset
();
int32_t
size
=
(
int32_t
)
pSrcBuf
->
fileSize
-
(
int32_t
)
offset
;
int64_t
rc
=
taosFSendFile
(
pDestBuf
->
f
,
pSrcBuf
->
f
,
&
offset
,
size
);
if
(
rc
==
-
1
)
{
// tscError("failed to merge tsBuf from:%s to %s, reason:%s\n", pSrcBuf->path, pDestBuf->path, strerror(errno));
return
-
1
;
}
int64_t
written
=
taosFSendFile
(
pDestBuf
->
f
,
pSrcBuf
->
f
,
&
offset
,
size
);
if
(
rc
!=
size
)
{
// tscError("failed to merge tsBuf from:%s to %s, reason:%s\n", pSrcBuf->path, pDestBuf->path, strerror(errno));
if
(
written
==
-
1
||
written
!=
size
)
{
return
-
1
;
}
pDestBuf
->
numOfTotal
+=
pSrcBuf
->
numOfTotal
;
int32_t
oldSize
=
pDestBuf
->
fileSize
;
// file meta data may be cached, close and reopen the file for accurate file size.
fclose
(
pDestBuf
->
f
);
pDestBuf
->
f
=
fopen
(
pDestBuf
->
path
,
"rb+"
);
if
(
pDestBuf
->
f
==
NULL
)
{
return
-
1
;
}
struct
stat
fileStat
;
if
(
fstat
(
fileno
(
pDestBuf
->
f
),
&
fileStat
)
!=
0
)
{
return
-
1
;
}
pDestBuf
->
fileSize
=
(
uint32_t
)
fileStat
.
st_size
;
assert
(
pDestBuf
->
fileSize
==
oldSize
+
size
);
// tscDebug("tsBuf merge success, %p, path:%s, fd:%d, file size:%d, numOfGroups:%d, autoDelete:%d", pDestBuf,
// pDestBuf->path, fileno(pDestBuf->f), pDestBuf->fileSize, pDestBuf->numOfGroups, pDestBuf->autoDelete);
return
0
;
}
...
...
src/query/tests/CMakeLists.txt
浏览文件 @
1dd6f365
...
...
@@ -7,11 +7,17 @@ FIND_LIBRARY(LIB_GTEST_STATIC_DIR libgtest.a /usr/lib/ /usr/local/lib)
IF
(
HEADER_GTEST_INCLUDE_DIR AND LIB_GTEST_STATIC_DIR
)
MESSAGE
(
STATUS
"gTest library found, build unit test"
)
# GoogleTest requires at least C++11
SET
(
CMAKE_CXX_STANDARD 11
)
INCLUDE_DIRECTORIES
(
/usr/include /usr/local/include
)
LINK_DIRECTORIES
(
/usr/lib /usr/local/lib
)
INCLUDE_DIRECTORIES
(
${
HEADER_GTEST_INCLUDE_DIR
}
)
AUX_SOURCE_DIRECTORY
(
${
CMAKE_CURRENT_SOURCE_DIR
}
SOURCE_LIST
)
ADD_EXECUTABLE
(
queryTest
${
SOURCE_LIST
}
)
TARGET_LINK_LIBRARIES
(
queryTest taos query gtest pthread
gcov
)
TARGET_LINK_LIBRARIES
(
queryTest taos query gtest pthread
)
ENDIF
()
SET_SOURCE_FILES_PROPERTIES
(
./astTest.cpp PROPERTIES COMPILE_FLAGS -w
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录