Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Test Developertest
提交
063ce27b
T
Test Developertest
项目概览
OpenHarmony
/
Test Developertest
大约 1 年 前同步成功
通知
2
Star
23
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Test Developertest
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
063ce27b
编写于
3月 29, 2022
作者:
S
stivn
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Modified
Signed-off-by:
N
stivn
<
sunteng10@huawei.com
>
上级
70562192
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
96 addition
and
40 deletion
+96
-40
aw/cxx/distributed/distributed_agent.cpp
aw/cxx/distributed/distributed_agent.cpp
+3
-3
aw/cxx/distributed/distributed_major.cpp
aw/cxx/distributed/distributed_major.cpp
+2
-2
aw/cxx/distributed/utils/csv_transform_xml.h
aw/cxx/distributed/utils/csv_transform_xml.h
+2
-2
aw/cxx/hwext/perf.cpp
aw/cxx/hwext/perf.cpp
+3
-3
examples/calculator/src/calculator.cpp
examples/calculator/src/calculator.cpp
+2
-2
examples/calculator/test/fuzztest/common/parse_fuzzer/corpus/init
.../calculator/test/fuzztest/common/parse_fuzzer/corpus/init
+12
-1
examples/detector/src/detector.cpp
examples/detector/src/detector.cpp
+3
-3
examples/distributedb/test/distributedtest/common/distribute_demo.cpp
...tributedb/test/distributedtest/common/distribute_demo.cpp
+1
-1
examples/distributedb/test/distributedtest/common/distribute_demo_agent.cpp
...edb/test/distributedtest/common/distribute_demo_agent.cpp
+3
-3
examples/lite/c_demo/include/calc_multi.h
examples/lite/c_demo/include/calc_multi.h
+1
-1
examples/lite/c_demo/source/BUILD.gn
examples/lite/c_demo/source/BUILD.gn
+1
-1
libs/benchmark/README_zh.md
libs/benchmark/README_zh.md
+6
-5
libs/benchmark/template/benchmark_detail.html
libs/benchmark/template/benchmark_detail.html
+14
-0
libs/benchmark/template/benchmark_summary.html
libs/benchmark/template/benchmark_summary.html
+14
-0
libs/fuzzlib/README_zh.md
libs/fuzzlib/README_zh.md
+2
-2
libs/fuzzlib/fuzzer_helper.py
libs/fuzzlib/fuzzer_helper.py
+2
-2
libs/fuzzlib/tools/__init__.py
libs/fuzzlib/tools/__init__.py
+16
-0
src/core/build/build_manager.py
src/core/build/build_manager.py
+1
-1
src/core/build/build_testcases.py
src/core/build/build_testcases.py
+3
-3
src/core/build/select_targets.py
src/core/build/select_targets.py
+1
-1
src/core/command/run.py
src/core/command/run.py
+1
-1
src/core/config/resource_manager.py
src/core/config/resource_manager.py
+1
-1
src/core/driver/drivers.py
src/core/driver/drivers.py
+1
-1
src/core/utils.py
src/core/utils.py
+1
-1
未找到文件。
aw/cxx/distributed/distributed_agent.cpp
浏览文件 @
063ce27b
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021
-2022
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -78,7 +78,7 @@ int DistributedAgent::InitAgentServer()
}
int
num
=
1
;
if
(
setsockopt
(
serverSockFd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
num
,
sizeof
(
num
))
!=
0
)
{
if
(
setsockopt
(
serverSockFd
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
num
,
sizeof
(
num
)))
{
close
(
serverSockFd
);
serverSockFd
=
-
1
;
return
serverSockFd
;
...
...
@@ -155,7 +155,7 @@ int DistributedAgent::DoCmdServer(int serverSockFd)
// every cmd length less than MAX_BUFF_LEN bytes;
int
recvCmdLen
=
recv
(
clientSockFd_
,
buff
,
DST_COMMAND_HEAD_LEN
,
0
);
if
(
static_cast
<
unsigned
long
>
(
recvCmdLen
)
<
DST_COMMAND_HEAD_LEN
)
{
if
(
recvCmdLen
==
0
)
{
if
(
!
recvCmdLen
)
{
HiLog
::
Info
(
DistributedAgent
::
LABEL
,
"agent connect socket closed, IP:%s .
\n
"
,
inet_ntoa
(
clientAddr
.
sin_addr
));
mbStop_
=
true
;
...
...
aw/cxx/distributed/distributed_major.cpp
浏览文件 @
063ce27b
...
...
@@ -130,7 +130,7 @@ int DistributeTestEnvironment::ConnectAgent(size_t devNo)
addr
.
sin_port
=
htons
(
serverPort_
);
int
connectCount
=
0
;
for
(
connectCount
=
0
;
connectCount
<
CONNECT_TIME
;
connectCount
++
)
{
// try connect to agent 3 times.
if
(
connect
(
clientSockFd
,
reinterpret
<
struct
sockaddr
*>
(
&
addr
),
sizeof
(
addr
))
==
0
)
{
if
(
!
connect
(
clientSockFd
,
reinterpret
<
struct
sockaddr
*>
(
&
addr
),
sizeof
(
addr
))
)
{
break
;
}
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
SLEEP_TIME
));
// delay 10ms
...
...
@@ -223,7 +223,7 @@ bool DistributeTestEnvironment::SendToAgent(size_t devNo, int cmdType, void *pst
HiLog
::
Error
(
LABEL
,
"get error message. type is :%d"
,
pCmdTest
->
cmdTestType
);
}
}
else
{
if
(
rlen
==
0
)
{
if
(
!
rlen
)
{
// peer socket is closed.
HiLog
::
Error
(
LABEL
,
"device socket close."
);
break
;
...
...
aw/cxx/distributed/utils/csv_transform_xml.h
浏览文件 @
063ce27b
...
...
@@ -67,7 +67,7 @@ public:
int
testCaseSum
=
vecLines_
.
size
()
/
3
;
// one item case_result from csv includes 3 strings
int
failCaseSum
=
0
;
for
(
std
::
string
s
:
vecLines_
)
{
if
(
s
.
compare
(
"FAILED"
)
==
0
)
{
if
(
!
s
.
compare
(
"FAILED"
)
)
{
failCaseSum
++
;
}
}
...
...
@@ -78,7 +78,7 @@ public:
<<
"
\"
failures=
\"
"
<<
failCaseSum
<<
"
\"
disabled=
\"
0
\"
errors=
\"
0
\"
time=
\"
192.553
\"
>"
<<
std
::
endl
;
unsigned
long
i
=
0
;
while
(
i
<
vecLines_
.
size
())
{
if
(
vecLines_
.
at
(
i
+
2
).
compare
(
"FAILED"
)
==
0
)
{
// the result of every case intervals 2 string
if
(
!
(
vecLines_
.
at
(
i
+
2
).
compare
(
"FAILED"
))
)
{
// the result of every case intervals 2 string
xmlOut
<<
" <testcase name=
\"
"
<<
vecLines_
.
at
(
i
)
<<
"
\"
status=
\"
run
\"
time=
\"\"
classname=
\"
"
<<
fileName_
<<
"
\"
level=
\"
3
\"
>"
<<
std
::
endl
;
xmlOut
<<
" <failure message=
\"
NULL
\"
></failure>"
<<
std
::
endl
;
...
...
aw/cxx/hwext/perf.cpp
浏览文件 @
063ce27b
...
...
@@ -103,7 +103,7 @@ bool BaseLineManager::ReadXmlFile(string baselinePath)
xmlNodePtr
ptrRootNode
=
xmlDocGetRootElement
(
ptrXmlDoc
);
if
(
ptrRootNode
==
nullptr
||
ptrRootNode
->
name
==
nullptr
||
xmlStrcmp
(
ptrRootNode
->
name
,
reinterpret_cast
<
const
xmlChar
*>
(
XML_TAG_ROOT
))
!=
0
)
{
xmlStrcmp
(
ptrRootNode
->
name
,
reinterpret_cast
<
const
xmlChar
*>
(
XML_TAG_ROOT
)))
{
xmlFreeDoc
(
ptrXmlDoc
);
return
false
;
}
...
...
@@ -138,7 +138,7 @@ bool BaseLineManager::IsNoBaseline()
return
m_bNoBaseline
;
}
double
BaseLineManager
::
Str
T
oDouble
(
const
string
&
str
)
double
BaseLineManager
::
Str
t
oDouble
(
const
string
&
str
)
{
istringstream
iss
(
str
);
double
num
;
...
...
@@ -157,7 +157,7 @@ bool BaseLineManager::GetExtraValueDouble(const string testcaseName, const strin
map
<
string
,
string
>
properties
=
*
iter
;
if
(
properties
.
count
(
XML_TAG_CASENAME
)
==
1
&&
properties
[
XML_TAG_CASENAME
]
==
testcaseName
)
{
if
(
properties
.
count
(
extra
)
==
1
)
{
value
=
Str
T
oDouble
(
properties
[
extra
]);
value
=
Str
t
oDouble
(
properties
[
extra
]);
}
break
;
}
...
...
examples/calculator/src/calculator.cpp
浏览文件 @
063ce27b
...
...
@@ -32,7 +32,7 @@ int Sub(int e1, int e2)
int
Mul
(
int
e1
,
int
e2
)
{
int
result
=
e1
*
e2
;
if
(
e1
==
0
)
{
if
(
!
e1
)
{
return
0
;
}
if
((
result
/
e1
)
!=
e2
)
{
...
...
@@ -43,7 +43,7 @@ int Mul(int e1, int e2)
int
Div
(
int
e1
,
int
e2
)
{
if
(
e2
==
0
)
{
if
(
!
e2
)
{
return
-
1
;
}
...
...
examples/calculator/test/fuzztest/common/parse_fuzzer/corpus/init
浏览文件 @
063ce27b
FUZZ
\ No newline at end of file
# Copyright (c) 2020-2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
\ No newline at end of file
examples/detector/src/detector.cpp
浏览文件 @
063ce27b
...
...
@@ -32,7 +32,7 @@ bool IsPrime(int n)
return
false
;
}
if
(
n
%
DetectorTest
::
HALF
==
0
)
{
if
(
!
(
n
%
DetectorTest
::
HALF
)
)
{
return
n
==
DetectorTest
::
HALF
;
}
...
...
@@ -40,7 +40,7 @@ bool IsPrime(int n)
if
(
i
>
(
n
/
i
))
{
break
;
}
if
(
n
%
i
==
0
)
{
if
(
!
(
n
%
i
)
)
{
return
false
;
}
}
...
...
@@ -51,5 +51,5 @@ bool IsPrime(int n)
bool
FileExist
(
const
char
*
fileName
)
{
struct
stat
myStat
;
return
(
stat
(
fileName
,
&
myStat
)
==
0
);
return
(
!
stat
(
fileName
,
&
myStat
)
);
}
examples/distributedb/test/distributedtest/common/distribute_demo.cpp
浏览文件 @
063ce27b
...
...
@@ -151,7 +151,7 @@ HWTEST_F(DistributeDemo, getkvstore_001, TestSize.Level0) {
Options
options
;
options
.
createIfMissing
=
true
;
options
.
encrypt
=
false
;
options
.
persist
a
nt
=
true
;
options
.
persist
e
nt
=
true
;
std
::
string
appId
=
"com.ohos.nb.service.user1_test"
;
std
::
string
storeId
=
"student_1"
;
manager
=
AppDistributedKvDataManager
::
GetInstance
(
appId
,
"/data/test"
);
...
...
examples/distributedb/test/distributedtest/common/distribute_demo_agent.cpp
浏览文件 @
063ce27b
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021
-2022
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -83,7 +83,7 @@ bool DistributeDemoAgent::SetUp()
Options
options
;
options
.
createIfMissing
=
true
;
options
.
encrypt
=
false
;
options
.
persist
a
nt
=
true
;
options
.
persist
e
nt
=
true
;
std
::
string
storeId
=
g_storeId
;
Status
status
=
g_manager
->
GetKvStore
(
options
,
storeId
,
[
&
](
std
::
unique_ptr
<
AppKvStore
>
kvStore
)
{
g_kvStorePtr
=
std
::
move
(
kvStore
);
...
...
@@ -115,7 +115,7 @@ int DistributeDemoAgent::OnProcessMsg(const std::string &strMsg, int len,
nret
=
returnBufLen
;
}
else
{
HiLog
::
Info
(
LABEL
,
"receive message=%s."
,
strMsg
.
c_str
());
if
(
strncmp
(
strMsg
.
c_str
(),
"recall"
,
MSG_CALL_LEN
)
==
0
)
{
if
(
!
strncmp
(
strMsg
.
c_str
(),
"recall"
,
MSG_CALL_LEN
)
)
{
returnStr
=
"I get recall message."
;
int
ptrlen
=
returnStr
.
size
();
if
(
ptrlen
>
returnBufLen
)
{
...
...
examples/lite/c_demo/include/calc_multi.h
浏览文件 @
063ce27b
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* Copyright (c) 2020
-2021
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
examples/lite/c_demo/source/BUILD.gn
浏览文件 @
063ce27b
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Copyright (c) 2020
-2021
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
libs/benchmark/README_zh.md
浏览文件 @
063ce27b
...
...
@@ -6,7 +6,7 @@
```
/*
* Copyright (c) 2021
Huawei
Device Co., Ltd.
* Copyright (c) 2021
XXXX
Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -158,7 +158,7 @@ BENCHMARK_MAIN();
```
/*
* Copyright (c) 2021
Huawei
Device Co., Ltd.
* Copyright (c) 2021
XXXX
Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -242,10 +242,11 @@ BENCHMARK_MAIN();
benchmark还支持其他多种参数,具体介绍和使用参考
[
benchmark
](
https://gitee.com/openharmony/third_party_benchmark/blob/master/README.md
)
## 用例编译
## 用例编译
```
# Copyright (c) 2021
Huawei
Device Co., Ltd.
# Copyright (c) 2021
XXXX
Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
@@ -283,7 +284,7 @@ group("unittest") {
1.
添加文件头注释信息
```
# Copyright (c) 2021
Huawei
Device Co., Ltd.
# Copyright (c) 2021
XXXX
Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
libs/benchmark/template/benchmark_detail.html
浏览文件 @
063ce27b
<!--
Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
...
...
libs/benchmark/template/benchmark_summary.html
浏览文件 @
063ce27b
<!--
Copyright (c) 2021 Huawei Device Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
...
...
libs/fuzzlib/README_zh.md
浏览文件 @
063ce27b
...
...
@@ -138,7 +138,7 @@ Fuzzing测试框架使用了LLVM编译器框架中的[libFuzzer](https://llvm.or
2.
BUILD.gn编写
基于[ohos_fuzztest]
#
配置Fuzz模板,例如:
基于[ohos_fuzztest]配置Fuzz模板,例如:
```
ohos_fuzztest("CalculatorFuzzTest") { #定义测试套名称CalculatorFuzzTest
...
...
@@ -155,7 +155,7 @@ Fuzzing测试框架使用了LLVM编译器框架中的[libFuzzer](https://llvm.or
}
```
[group]
#
引用测试套,例如:
[group]引用测试套,例如:
```
group("fuzztest") {
...
...
libs/fuzzlib/fuzzer_helper.py
浏览文件 @
063ce27b
...
...
@@ -112,8 +112,8 @@ def generate(args):
template_args
=
{
'project_name'
:
args
.
project_name
,
'author'
:
"
@fixme
"
,
'email'
:
"
@fixme
"
'author'
:
""
,
'email'
:
""
}
project_dir_path
=
os
.
path
.
join
(
args
.
project_path
,
args
.
project_name
)
...
...
libs/fuzzlib/tools/__init__.py
浏览文件 @
063ce27b
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
\ No newline at end of file
src/core/build/build_manager.py
浏览文件 @
063ce27b
...
...
@@ -2,7 +2,7 @@
# coding=utf-8
#
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Copyright (c) 2020
-2021
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
src/core/build/build_testcases.py
浏览文件 @
063ce27b
...
...
@@ -2,7 +2,7 @@
# coding=utf-8
#
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Copyright (c) 2020
-2021
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
@@ -44,8 +44,8 @@ class BuildTestcases(object):
user_manager
=
UserConfigManager
()
self
.
is_build_example
=
user_manager
.
get_user_config_flag
(
"build"
,
"example"
)
self
.
build_paramter_dic
=
user_manager
.
get_user_config
(
"build"
,
"paramter"
)
self
.
build_param
e
ter_dic
=
user_manager
.
get_user_config
(
"build"
,
"param
e
ter"
)
@
classmethod
def
_copy_folder
(
cls
,
source_dir
,
target_dir
):
...
...
src/core/build/select_targets.py
浏览文件 @
063ce27b
...
...
@@ -2,7 +2,7 @@
# coding=utf-8
#
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Copyright (c) 2020
-2021
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
src/core/command/run.py
浏览文件 @
063ce27b
...
...
@@ -2,7 +2,7 @@
# coding=utf-8
#
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Copyright (c) 2020
-2021
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
src/core/config/resource_manager.py
浏览文件 @
063ce27b
...
...
@@ -2,7 +2,7 @@
# coding=utf-8
#
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Copyright (c) 2020
-2021
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
src/core/driver/drivers.py
浏览文件 @
063ce27b
...
...
@@ -2,7 +2,7 @@
# coding=utf-8
#
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Copyright (c) 2020
-2021
Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
...
...
src/core/utils.py
浏览文件 @
063ce27b
...
...
@@ -155,7 +155,7 @@ def parse_product_info(product_form):
def
is_32_bit_test
():
manager
=
UserConfigManager
()
para_dic
=
manager
.
get_user_config
(
"build"
,
"paramter"
)
para_dic
=
manager
.
get_user_config
(
"build"
,
"param
e
ter"
)
target_cpu
=
para_dic
.
get
(
"target_cpu"
,
""
)
if
target_cpu
==
"arm"
:
return
True
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录