Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2793effa
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
2793effa
编写于
9月 23, 2021
作者:
J
jiacy-jcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TS-293]<test>:add test case
上级
f253be59
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
97 addition
and
15 deletion
+97
-15
tests/examples/c/makefile
tests/examples/c/makefile
+3
-12
tests/script/api/clientcfgtest.c
tests/script/api/clientcfgtest.c
+62
-0
tests/script/api/makefile
tests/script/api/makefile
+6
-2
tests/test-all.sh
tests/test-all.sh
+26
-1
未找到文件。
tests/examples/c/makefile
浏览文件 @
2793effa
...
...
@@ -7,8 +7,7 @@ LFLAGS = '-Wl,-rpath,/usr/local/taos/driver/' -ltaos -lpthread -lm -lrt
CFLAGS
=
-O3
-g
-Wall
-Wno-deprecated
-fPIC
-Wno-unused-result
-Wconversion
\
-Wno-char-subscripts
-D_REENTRANT
-Wno-format
-D_REENTRANT
-DLINUX
\
-Wno-unused-function
-D_M_X64
-I
/usr/local/taos/include
-std
=
gnu99
\
-I
../../../deps/cJson/inc
-I
../../../src/os/inc
-I
../../../src/inc
\
-I
../../../src/util/inc
-I
../../../src/common/inc
-I
../../../deps/cJson/inc
all
:
$(TARGET)
exe
:
...
...
@@ -18,11 +17,7 @@ exe:
gcc
$(CFLAGS)
./stream.c
-o
$(ROOT)
stream
$(LFLAGS)
gcc
$(CFLAGS)
./subscribe.c
-o
$(ROOT)
subscribe
$(LFLAGS)
gcc
$(CFLAGS)
./apitest.c
-o
$(ROOT)
apitest
$(LFLAGS)
gcc
$(CFLAGS)
./clientcfgtest.c
-o
$(ROOT)
clientcfgtest
$(LFLAGS)
gcc
$(CFLAGS)
./clientcfgtest-wrongtype.c
-o
$(ROOT)
clientcfgtest-wrongtype
$(LFLAGS)
gcc
$(CFLAGS)
./clientcfgtest-wrongjson.c
-o
$(ROOT)
clientcfgtest-wrongjson
$(LFLAGS)
gcc
$(CFLAGS)
./clientcfgtest-wrongvalue.c
-o
$(ROOT)
clientcfgtest-wrongvalue
$(LFLAGS)
gcc
$(CFLAGS)
./clientcfgtest-taosd.c
-o
$(ROOT)
clientcfgtest-taosd
$(LFLAGS)
clean
:
...
...
@@ -33,9 +28,5 @@ clean:
rm
$(ROOT)
stream
rm
$(ROOT)
subscribe
rm
$(ROOT)
apitest
rm
$(ROOT)
clientcfgtest
rm
$(ROOT)
clientcfgtest-wrongtype
rm
$(ROOT)
clientcfgtest-wrongjson
rm
$(ROOT)
clientcfgtest-wrongvalue
rm
$(ROOT)
clientcfgtest-taosd
tests/script/api/clientcfgtest.c
0 → 100644
浏览文件 @
2793effa
// The test case to verfy TS-293
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <taos.h>
#include "os.h"
#include "taosdef.h"
#include "taoserror.h"
#include "tconfig.h"
#include "tglobal.h"
#include "tulog.h"
#include "tsocket.h"
#include "tutil.h"
extern
SGlobalCfg
*
taosGetConfigOption
(
const
char
*
option
)
;
int
main
(
int
argc
,
char
*
argv
[]){
printf
(
"start to test
\n
"
);
//case1:
//Test config firstEp success
const
char
config1
[
128
]
=
"{
\"
firstEp
\"
:
\"
BCC-2:6030
\"
,
\"
debugFlag
\"
:
\"
135
\"
}"
;
//input the parameter which want to be configured
taos_set_config
(
config1
);
//configure the parameter
SGlobalCfg
*
cfg
;
cfg
=
taosGetConfigOption
(
"firstEp"
);
//check the option result
if
(
cfg
->
cfgStatus
!=
3
){
//If cfgStatus is 3,it means configure is success
printf
(
"config firstEp 'BCC-2:6030'failures!
\n
"
);
exit
(
1
);
}
cfg
=
taosGetConfigOption
(
"debugFlag"
);
//check the option result
if
(
cfg
->
cfgStatus
!=
3
){
printf
(
"config debugFlag '135' failures!
\n
"
);
exit
(
1
);
}
//case2:
//Test config only useful at the first time
//The result is failure
const
char
config2
[
128
]
=
"{
\"
fqdn
\"
:
\"
BCC-3
\"
}"
;
taos_set_config
(
config2
);
//configure the parameter
cfg
=
taosGetConfigOption
(
"fqdn"
);
//check the option result
if
(
cfg
->
cfgStatus
==
3
){
printf
(
"config firstEp to 'BCC-3' failures!
\n
"
);
exit
(
1
);
}
else
{
printf
(
"test case success!
\n
"
);
exit
(
0
);
}
return
0
;
}
tests/script/api/makefile
浏览文件 @
2793effa
...
...
@@ -4,10 +4,12 @@
ROOT
=
./
TARGET
=
exe
LFLAGS
=
'-Wl,-rpath,/usr/local/taos/driver/'
-ltaos
-lpthread
-lm
-lrt
CFLAGS
=
-O
0
-g
-Wall
-Wno-deprecated
-fPIC
-Wno-unused-result
-Wconversion
\
CFLAGS
=
-O
3
-g
-Wall
-Wno-deprecated
-fPIC
-Wno-unused-result
-Wconversion
\
-Wno-char-subscripts
-D_REENTRANT
-Wno-format
-D_REENTRANT
-DLINUX
\
-Wno-unused-function
-D_M_X64
-I
/usr/local/taos/include
-std
=
gnu99
\
-fsanitize
=
address
-I
../../../deps/cJson/inc
\
-I
../../../src/os/inc/
-I
../../../src/inc
-I
../../../src/util/inc
\
-I
../../../src/common/inc
all
:
$(TARGET)
...
...
@@ -16,9 +18,11 @@ exe:
gcc
$(CFLAGS)
./stmtBatchTest.c
-o
$(ROOT)
stmtBatchTest
$(LFLAGS)
gcc
$(CFLAGS)
./stmtTest.c
-o
$(ROOT)
stmtTest
$(LFLAGS)
gcc
$(CFLAGS)
./stmt_function.c
-o
$(ROOT)
stmt_function
$(LFLAGS)
gcc
$(CFLAGS)
./clientcfgtest.c
-o
$(ROOT)
clientcfgtest
$(LFLAGS)
clean
:
rm
$(ROOT)
batchprepare
rm
$(ROOT)
stmtBatchTest
rm
$(ROOT)
stmtTest
rm
$(ROOT)
stmt_function
rm
$(ROOT)
clientcfgtest
tests/test-all.sh
浏览文件 @
2793effa
...
...
@@ -233,6 +233,7 @@ totalPyFailed=0
totalJDBCFailed
=
0
totalUnitFailed
=
0
totalExampleFailed
=
0
totalApiFailed
=
0
if
[
"
${
OS
}
"
==
"Linux"
]
;
then
corepath
=
`
grep
-oP
'.*(?=core_)'
/proc/sys/kernel/core_pattern||grep
-oP
'.*(?=core-)'
/proc/sys/kernel/core_pattern
`
...
...
@@ -532,7 +533,25 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "jdbc" ] && [ "$2" !=
echo
"demo pass"
totalExamplePass
=
`
expr
$totalExamplePass
+ 1
`
fi
echo
"### run setconfig tests ###"
stopTaosd
cd
..
cd
..
cd
scrpt/api
make
>
/dev/null
./clientcfgtest
if
[
$?
!=
"0"
]
;
then
echo
"clientcfgtest failed"
totalExampleFailed
=
`
expr
$totalExampleFailed
+ 1
`
else
echo
"clientcfgtest pass"
totalExamplePass
=
`
expr
$totalExamplePass
+ 1
`
fi
if
[
"
$totalExamplePass
"
-gt
"0"
]
;
then
echo
-e
"
\n
${
GREEN
}
### Total
$totalExamplePass
examples succeed! ###
${
NC
}
"
fi
...
...
@@ -544,7 +563,13 @@ if [ "$2" != "sim" ] && [ "$2" != "python" ] && [ "$2" != "jdbc" ] && [ "$2" !=
if
[
"
${
OS
}
"
==
"Linux"
]
;
then
dohavecore 1
fi
fi
exit
$((
$totalFailed
+
$totalPyFailed
+
$totalJDBCFailed
+
$totalUnitFailed
+
$totalExampleFailed
))
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录