Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0937d38e
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0937d38e
编写于
12月 09, 2022
作者:
O
openharmony_ci
提交者:
Gitee
12月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6872 修复libuvxts
Merge pull request !6872 from lushi1202/master
上级
9ae7917d
581f4685
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
31 addition
and
34 deletion
+31
-34
arkui/libuv/BUILD.gn
arkui/libuv/BUILD.gn
+4
-5
arkui/libuv/README_zh.md
arkui/libuv/README_zh.md
+3
-6
arkui/libuv/Test.json
arkui/libuv/Test.json
+8
-4
arkui/libuv/cplibuv.sh
arkui/libuv/cplibuv.sh
+2
-1
arkui/libuv/genlocal.py
arkui/libuv/genlocal.py
+4
-4
arkui/libuv/src/ActsLibuvTest.cpp
arkui/libuv/src/ActsLibuvTest.cpp
+9
-13
arkui/libuv/src/ActsLibuvTest.h
arkui/libuv/src/ActsLibuvTest.h
+1
-1
未找到文件。
arkui/libuv/BUILD.gn
浏览文件 @
0937d38e
...
...
@@ -61,7 +61,6 @@ ohos_static_library("libuvTestStatic") {
"//third_party/libuv/test/test-get-passwd.c",
"//third_party/libuv/test/test-getaddrinfo.c",
"//third_party/libuv/test/test-gethostname.c",
"//third_party/libuv/test/test-getnameinfo.c",
"//third_party/libuv/test/test-getsockname.c",
"//third_party/libuv/test/test-getters-setters.c",
"//third_party/libuv/test/test-gettimeofday.c",
...
...
@@ -209,8 +208,8 @@ ohos_executable("libuvruntest") {
deps = [ ":libuvTestStatic" ]
}
ohos_moduletest_suite("ActsLibuvTest
Suite
") {
sources = [ "src/ActsLibuvTest
Suite
.cpp" ]
ohos_moduletest_suite("ActsLibuvTest") {
sources = [ "src/ActsLibuvTest.cpp" ]
include_dirs = [
"//test/xts/acts/arkui/libuv/src",
...
...
@@ -228,7 +227,7 @@ action("cpLibuv") {
script = "cplibuv.sh"
outputs = [ "${target_out_dir}/cplibuv.log" ]
deps = [
":ActsLibuvTest
Suite
",
":ActsLibuvTest",
":libuvruntest",
]
}
...
...
@@ -237,7 +236,7 @@ group("libuvTest") {
testonly = true
if (is_standard_system) {
deps = [
":ActsLibuvTest
Suite
",
":ActsLibuvTest",
":cpLibuv",
":libuvruntest",
]
...
...
arkui/libuv/README_zh.md
浏览文件 @
0937d38e
...
...
@@ -14,8 +14,8 @@ Libuv测试套件使用Libuv三方库内原有的unittest,通过acts测试套
├── cplibuv.sh
├── genlocal.py
├── src
│ ├── ActsLibuvTest
Suite
.cpp
│ └── ActsLibuvTest
Suite
.h
│ ├── ActsLibuvTest.cpp
│ └── ActsLibuvTest.h
└── Test.json
```
...
...
@@ -35,12 +35,9 @@ Libuv测试套件使用Libuv三方库内原有的unittest,通过acts测试套
./build.sh
--product-name
rk3568
--gn-args
build_xts
=
true
--build-target
"acts"
--gn-args
is_standard_system
=
true
```
*
测试运行:进入suites/acts目录,执行python -m xdevice,然后在命令框里输入一下命令
```
bash
run
-l
ActsLibuvTest
Suite
run
-l
ActsLibuvTest
```
\ No newline at end of file
arkui/libuv/Test.json
浏览文件 @
0937d38e
{
"description"
:
"Config for ActsLibuvTest
Suite
test cases"
,
"description"
:
"Config for ActsLibuvTest test cases"
,
"driver"
:
{
"module-name"
:
"ActsLibuvTest
Suite
"
,
"module-name"
:
"ActsLibuvTest"
,
"native-test-timeout"
:
"120000"
,
"native-test-device-path"
:
"/data/local/tmp"
,
"runtime-hint"
:
"100s"
,
...
...
@@ -10,13 +10,17 @@
"kits"
:
[
{
"pre-push"
:
[
"mkdir -p /data/local/tmp/test/fixtures"
],
"post-push"
:
[
"chmod -R 777 /data/local/tmp/*"
],
"push"
:
[
"ActsLibuvTestSuite->/data/local/tmp/ActsLibuvTestSuite"
,
"libuvdata/libuvruntest->/data/local/tmp/libuvruntest "
"ActsLibuvTest->/data/local/tmp/ActsLibuvTest"
,
"libuvdata/libuvruntest->/data/local/tmp/libuvruntest"
,
"libuvdata/test/fixtures/empty_file->/data/local/tmp/test/fixtures/empty_file"
,
"libuvdata/test/fixtures/load_error.node->/data/local/tmp/test/fixtures/load_error.node"
,
"libuvdata/test/fixtures/lorem_ipsum.txt->/data/local/tmp/test/fixtures/lorem_ipsum.txt"
],
"type"
:
"PushKit"
},
...
...
arkui/libuv/cplibuv.sh
浏览文件 @
0937d38e
...
...
@@ -15,6 +15,7 @@
set
-e
mkdir
-p
"suites/acts/testcases/libuvdata"
mkdir
-p
"suites/acts/testcases/libuvdata
/test
"
cp
-rf
"../../test/xts/acts/arkui/libuv/genlocal.py"
"suites/acts/testcases/libuvdata"
cp
-rf
"common/common/libuvruntest"
"suites/acts/testcases/libuvdata"
cp
-rf
"../../third_party/libuv/test/fixtures"
"suites/acts/testcases/libuvdata/test"
arkui/libuv/genlocal.py
浏览文件 @
0937d38e
...
...
@@ -142,7 +142,7 @@ def writemulbuildgn():
#替换index.ets里的名称
indexetsname
=
hapdirpath
+
G_INDEXETSPATH
os
.
system
(
r
"sed -i 's/{}/{}/g' {}"
.
format
(
G_SUITENAMEPATTERN
,
suiteitemcap
,
indexetsname
))
#替换Test.json里的名称
testjsonname
=
hapdirpath
+
G_TESTJSONPATH
os
.
system
(
r
"sed -i 's/{}/{}/g' {}"
.
format
(
G_SUITENAMEPATTERN
,
suiteitemcap
,
testjsonname
))
...
...
@@ -177,7 +177,7 @@ def removedir(rootdir):
os
.
rmdir
(
rootdir
)
def
printhelp
():
def
printhelp
():
print
(
"Need testsuite and codepattern:
\n
"
)
print
(
"For example
\n
"
)
print
(
"python3 .\GenerateTestCase.py apilack
\n
"
)
...
...
@@ -201,7 +201,7 @@ def new_report(bakdir, str):
if
__name__
==
'__main__'
:
latestpath
=
new_report
(
"reports"
,
""
)
tmpfile
=
"tmptestsuite.xml"
putfile
=
"/result/ActsLibuvTest
Suite
.xml"
putfile
=
"/result/ActsLibuvTest.xml"
tasklogfile
=
"/log/task_log.log"
putdir
=
latestpath
+
putfile
tasklogpath
=
latestpath
+
tasklogfile
...
...
@@ -255,4 +255,4 @@ if __name__ == '__main__':
xmlfile
.
write
(
"</testsuites>
\n
"
)
xmlfile
.
close
()
#将tmp文件替换xts框架的result
os
.
system
(
r
"cp {} {}"
.
format
(
tmpfile
,
putdir
))
\ No newline at end of file
os
.
system
(
r
"cp {} {}"
.
format
(
tmpfile
,
putdir
))
arkui/libuv/src/ActsLibuvTest
Suite
.cpp
→
arkui/libuv/src/ActsLibuvTest.cpp
浏览文件 @
0937d38e
...
...
@@ -15,7 +15,7 @@
#include <gtest/gtest.h>
#include <stdlib.h>
#include "ActsLibuvTest
Suite
.h"
#include "ActsLibuvTest.h"
extern
"C"
{
#include "runner.h"
}
...
...
@@ -25,31 +25,27 @@ namespace OHOS {
using
namespace
testing
::
ext
;
// Preset action of the test suite, which is executed before the first test case
void
ActsLibuvTest
Suite
::
SetUpTestCase
(
void
)
void
ActsLibuvTest
::
SetUpTestCase
(
void
)
{
}
// Test suite cleanup action, which is executed after the last test case
void
ActsLibuvTest
Suite
::
TearDownTestCase
(
void
)
void
ActsLibuvTest
::
TearDownTestCase
(
void
)
{
}
// Preset action of the test case
void
ActsLibuvTest
Suite
::
SetUp
()
void
ActsLibuvTest
::
SetUp
()
{
}
// Cleanup action of the test case
void
ActsLibuvTest
Suite
::
TearDown
()
void
ActsLibuvTest
::
TearDown
()
{
}
HWTEST_F
(
ActsLibuvTest
Suite
,
t
estLibuvTestCase001
,
Function
|
MediumTest
|
Level2
)
HWTEST_F
(
ActsLibuvTest
,
T
estLibuvTestCase001
,
Function
|
MediumTest
|
Level2
)
{
printf
(
"------start ActsLibuvTestSuite------
\n
"
);
// int m =run_tests(0);
// printf("%d\n",m);
int
ret
=
system
(
"/data/local/tmp/libuvruntest"
);
printf
(
"system ret=%d
\n
"
,
ret
);
printf
(
"------start ActsLibuvTest------
\n
"
);
system
(
"/data/local/tmp/libuvruntest"
);
EXPECT_TRUE
(
true
);
printf
(
"------end ActsLibuvTest
Suite
------
\n
"
);
printf
(
"------end ActsLibuvTest------
\n
"
);
}
}
arkui/libuv/src/ActsLibuvTest
Suite
.h
→
arkui/libuv/src/ActsLibuvTest.h
浏览文件 @
0937d38e
...
...
@@ -18,7 +18,7 @@
#include <gtest/gtest.h>
namespace
OHOS
{
class
ActsLibuvTest
Suite
:
public
testing
::
Test
{
class
ActsLibuvTest
:
public
testing
::
Test
{
public:
protected:
// Preset action of the test suite, which is executed before the first test case
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录