Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
8e7f0c6c
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,发现更多精彩内容 >>
提交
8e7f0c6c
编写于
8月 24, 2022
作者:
F
FondMemoryVVV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add toolchain
Signed-off-by:
N
FondMemoryVVV
<
mashuai53@huawei.com
>
上级
4f6a6918
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
33 addition
and
34 deletion
+33
-34
test_packages.gni
test_packages.gni
+1
-0
toolchain/BUILD.gn
toolchain/BUILD.gn
+3
-0
toolchain/libc-test/include/getfiles.cpp
toolchain/libc-test/include/getfiles.cpp
+14
-18
toolchain/libc-test/include/runtest.h
toolchain/libc-test/include/runtest.h
+1
-1
toolchain/libc-test/src/toolchaintest.cpp
toolchain/libc-test/src/toolchaintest.cpp
+14
-15
未找到文件。
test_packages.gni
浏览文件 @
8e7f0c6c
...
...
@@ -47,6 +47,7 @@ _all_test_packages = [
"${ACTS_ROOT}/barrierfree:barrierfree",
"${ACTS_ROOT}/customization:customization",
"${ACTS_ROOT}/distributedschedule:distributedschedule",
"${ACTS_ROOT}/toolchain:toolchain",
]
_all_test_packages_ivi = [
...
...
toolchain/BUILD.gn
浏览文件 @
8e7f0c6c
...
...
@@ -15,6 +15,9 @@ import("//test/xts/tools/build/suite.gni")
group("toolchain") {
testonly = true
deps = [
"//third_party/musl:libctest",
]
if (is_standard_system) {
deps = [
#":tar_testcases",
...
...
toolchain/libc-test/include/getfiles.cpp
浏览文件 @
8e7f0c6c
...
...
@@ -17,28 +17,24 @@
#include <vector>
#include <cstring>
#include <dirent.h>
#include "gettestfiles.cpp"
#include "runtest.h"
void
GetFileNames
(
std
::
string
path
,
std
::
vector
<
std
::
string
>&
filenames
)
using
namespace
std
;
vector
<
string
>
filenames
;
vector
<
std
::
string
>
GetFileNames
(
std
::
string
path
)
{
DIR
*
pDir
;
struct
dirent
*
ptr
;
std
::
string
p
;
if
(
!
(
pDir
=
opendir
(
path
.
c_str
())))
{
std
::
cout
<<
"Folder doesn't Exist!"
<<
std
::
endl
;
return
;
}
while
((
ptr
=
readdir
(
pDir
))
!=
nullptr
)
{
if
(
ptr
->
d_type
==
DT_DIR
)
{
if
(
strcmp
(
ptr
->
d_name
,
"."
)
!=
0
&&
strcmp
(
ptr
->
d_name
,
".."
)
!=
0
)
{
GetFileNames
(
path
+
"/"
+
ptr
->
d_name
,
filenames
);
}
}
else
{
if
(
strcmp
(
ptr
->
d_name
,
"."
)
!=
0
&&
strcmp
(
ptr
->
d_name
,
".."
)
!=
0
)
{
filenames
.
push_back
(
path
+
"/"
+
ptr
->
d_name
);
}
vector
<
string
>
tempName
;
GetTestNames
(
path
,
tempName
);
for
(
size_t
i
=
0
;
i
<
tempName
.
size
();
i
++
)
{
if
((
tempName
[
i
].
find
(
"stat"
,
path
.
length
()
-
1
)
!=
-
1
)
||
(
tempName
[
i
].
find
(
"sem_close-unmap"
,
path
.
length
()
-
1
)
!=
-
1
)
||
(
tempName
[
i
].
find
(
"runtest"
,
path
.
length
()
-
1
)
!=
-
1
))
{
continue
;
}
filenames
.
push_back
(
tempName
[
i
]);
}
closedir
(
pDir
)
;
return
filenames
;
}
\ No newline at end of file
toolchain/libc-test/include/runtest.h
浏览文件 @
8e7f0c6c
...
...
@@ -20,6 +20,6 @@
#include <vector>
int
t_setrlim
(
int
r
,
long
lim
);
void
GetFileNames
(
std
::
string
path
,
std
::
vector
<
std
::
string
>&
filenames
);
std
::
vector
<
std
::
string
>
GetFileNames
(
std
::
string
path
);
#endif // TOOLCHAIN_LIBC_TEST_INCLUDE_RUNTEST_H_
toolchain/libc-test/src/toolchaintest.cpp
浏览文件 @
8e7f0c6c
...
...
@@ -32,8 +32,10 @@
using
namespace
std
;
using
namespace
testing
::
ext
;
class
toolchaintest
:
public
testing
::
Test
{};
class
ToolChainTest
:
public
::
testing
::
TestWithParam
<
string
>
{};
static
string
filepath
=
"/data/local/tmp/libc-test/src"
;
static
vector
<
std
::
string
>
temp
=
GetFileNames
(
filepath
);
volatile
int
t_status
=
0
;
static
void
handler
(
int
s
)
...
...
@@ -54,7 +56,7 @@ static int start(char *wrap, const char *argvs)
return
pid
;
}
static
int
run
t
ests
(
const
char
*
argvs
)
static
int
run
T
ests
(
const
char
*
argvs
)
{
char
wrap
[]
=
""
;
int
timeoutsec
=
5
,
timeout
=
0
;
...
...
@@ -109,23 +111,20 @@ static int runtests(const char *argvs)
}
/**
* @tc.name :
toolchaint
est.LibcTest
* @tc.name :
ToolChainT
est.LibcTest
* @tc.desc : start test
* @tc.level : Level 2
*/
static
HWTEST_F
(
toolchaint
est
,
LibcTest
,
Function
|
MediumTest
|
Level3
)
static
HWTEST_F
(
ToolChainT
est
,
LibcTest
,
Function
|
MediumTest
|
Level3
)
{
int
ret
;
vector
<
string
>
temp
;
string
filepath
=
"/data/local/tmp/libc-test/src"
;
GetFileNames
(
filepath
,
temp
);
for
(
size_t
i
=
0
;
i
<
temp
.
size
();
i
++
)
{
if
((
temp
[
i
].
find
(
"stat"
,
filepath
.
length
()
-
1
)
!=
-
1
)
||
(
temp
[
i
].
find
(
"sem_close-unmap"
,
filepath
.
length
()
-
1
)
!=
-
1
)
||
(
temp
[
i
].
find
(
"runtest"
,
filepath
.
length
()
-
1
)
!=
-
1
))
{
continue
;
}
ret
=
runtests
(
temp
[
i
].
c_str
());
EXPECT_EQ
(
0
,
ret
)
<<
"test "
<<
temp
[
i
]
<<
" failed"
<<
endl
;
string
testName
=
GetParam
();
ret
=
runTests
(
testName
.
c_str
());
if
(
ret
==
0
)
{
EXPECT_EQ
(
0
,
ret
)
<<
"test "
<<
testName
<<
" succeed"
<<
endl
;
}
else
{
EXPECT_EQ
(
1
,
ret
)
<<
"test "
<<
testName
<<
" failed"
<<
endl
;
EXPECT_EQ
(
-
1
,
ret
)
<<
"test "
<<
testName
<<
" failed"
<<
endl
;
}
}
INSTANTIATE_TEST_CASE_P
(
libcTest
,
ToolChainTest
,
testing
::
ValuesIn
(
temp
.
begin
(),
temp
.
end
()));
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录