Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
4f9548bc
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
1 年多 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
4f9548bc
编写于
2月 27, 2023
作者:
O
openharmony_ci
提交者:
Gitee
2月 27, 2023
浏览文件
操作
浏览文件
下载
差异文件
!590 Add libc-test summary & Fix failed tests
Merge pull request !590 from mwx1087526/fix-libctest
上级
dfbf1624
222b14f6
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
236 addition
and
132 deletion
+236
-132
libc-test/README-HowtoRun.md
libc-test/README-HowtoRun.md
+83
-56
libc-test/src/functionalext/common/asctime_data.h
libc-test/src/functionalext/common/asctime_data.h
+1
-1
libc-test/src/functionalext/common/difftime_data.h
libc-test/src/functionalext/common/difftime_data.h
+1
-1
libc-test/src/functionalext/common/gmtime_data.h
libc-test/src/functionalext/common/gmtime_data.h
+1
-1
libc-test/src/functionalext/common/localtime_data.h
libc-test/src/functionalext/common/localtime_data.h
+1
-1
libc-test/src/functionalext/common/mktime_data.h
libc-test/src/functionalext/common/mktime_data.h
+1
-1
libc-test/src/functionalext/common/strftime_data.h
libc-test/src/functionalext/common/strftime_data.h
+1
-1
libc-test/src/functionalext/common/strptime_data.h
libc-test/src/functionalext/common/strptime_data.h
+1
-1
libc-test/src/functionalext/common/timegm_data.h
libc-test/src/functionalext/common/timegm_data.h
+1
-1
libc-test/src/functionalext/dlns/dlns_separated.c
libc-test/src/functionalext/dlns/dlns_separated.c
+2
-2
libc-test/src/functionalext/dlns/dlns_set_fun.c
libc-test/src/functionalext/dlns/dlns_set_fun.c
+4
-4
libc-test/src/functionalext/dlns/dlns_test.h
libc-test/src/functionalext/dlns/dlns_test.h
+7
-7
libc-test/test_template.gni
libc-test/test_template.gni
+1
-1
porting/linux/user/config/ld-musl-namespace-aarch64-test.ini
porting/linux/user/config/ld-musl-namespace-aarch64-test.ini
+10
-10
porting/linux/user/config/ld-musl-namespace-arm-test.ini
porting/linux/user/config/ld-musl-namespace-arm-test.ini
+10
-10
porting/linux/user/config/ld-musl-namespace-x86_64-test.ini
porting/linux/user/config/ld-musl-namespace-x86_64-test.ini
+10
-10
scripts/runtest.sh
scripts/runtest.sh
+28
-8
scripts/runtest_Windows.bat
scripts/runtest_Windows.bat
+73
-16
未找到文件。
libc-test/README-HowtoRun.md
浏览文件 @
4f9548bc
## libc-test脚本使用说明
### 一、生成用例
编译命令,单独编译出libc-test测试用例
```
shell
./build.sh
--product-name
Hi3516DV300
--build-target
third_party/musl:libctest
```
文件生成的目录位于
`out/hi3516dv300/tests/unittest/libc-test`
注:
旧版ohos中,文件生成的目录位于
`out/ohos-arm-release/tests/unittest/libc-test`
,请根据实际修改脚本中相关路径!!
请务必根据实际修改脚本中相关路径!
### 二、执行用例
1.
将HDC(Windows版)工具加入到windows环境变量,并将工具改名为hdc.exe。连接上开发板,保证HDC工具可以连接。
2.
进入musl/scripts,并根据实际环境,修改runtest.bat中测试用例生成目录完整路径(必要)
```
bat
@REM 本地OpenHarmony源码目录,请根据实际环境修改!!
set
LOCAL
=
\\wsl$\ubuntu
-
20
.04\home\OHOS\
@REM 本地编译out目录
set
OUTDIR
=
out
\hi3516dv300
```
3.
将bat脚本复制到windows环境下使用!!windows端双击运行runtest.bat,执行完毕会将结果REPORT返回到当前bat所在目录。
此bat将从WSL映射目录传输文件到单板目录下,由于WSL无法直接访问windows端口,所以在WSL中直接使用可能无法传输用例。
4.
若要单独执行测试用例,需要先将common目录下的
`runtest`
与用例传输到单板,再通过命令执行,结果将打印出来
```
shell
./runtest
-w
''
{
filename
}
```
5.
runtest.bat执行结束前会将输出的REPORT与在libc-test/report_base下的REPORT相比较,如果比较出不同将会在scripts下
生成一个result.html文件,否则不生成。
### 三、增加用例
若要在functional、math、regression或增加用例,需要在相应目录的test_src_{dir}.gni中添加文件名。
例如:
1、需要在functional目录中新增一个用例:由
`new_test.c`
生成可执行文件
`new_test`
2、首先把c文件放入functional目录中,打开
`test_src_functional.gni`
,在
`functional_list`
中最后一行增加
`"new_test",`
3、执行步骤一(生成用例)中的编译命令,即可生成对应可执行文件。
## libc-test脚本使用说明
### 一、编译
编译命令,仅编译libc-test测试用例
```
./build.sh --product-name rk3568 --build-target libctest
```
用例可执行文件生成的目录位于
`out/rk3568/musl/libc-test`
以及相关的动态库位于
`out/rk3568/musl/libc-test-lib`
### 二、执行测试
1.
将HDC(Windows版)工具hdc.exe加入到windows环境变量。连接上开发板,保证HDC工具可以连接。
2.
进入musl/scripts,并根据实际环境,修改runtest_Windows.bat中测试用例生成目录完整路径(必要)
```
bat
@REM 本地OpenHarmony源码目录,需根据实际环境修改
set
LOCAL
=
\\wsl$\ubuntu
-
20
.04\home\code\OpenHarmony
@REM 本地编译out目录
set
OUTDIR
=
out
\rk3568
```
3.
将bat脚本复制到windows环境下使用!windows端双击运行runtest_Windows.bat,执行完毕会将详细错误结果信息REPORT返回到当前bat所在目录,并对结果进行统计生成FileList.txt(本次测试执行用例列表)与Summary.txt(统计报告),内容如下:
$
\c
olor{red}{提交PR需在提交里附上对应统计报告!}$
```
SUMMARY
All: 1177 | Run: 1147 | Skip: 30
Pass: [1083/1147]
Fail: [64/1147]
Check REPORT for more details.
[Failed List]:
FAIL __fwritable [signal Segmentation fault]
FAIL __fwriting [signal Segmentation fault]
FAIL a_stack_chk_fail [status 255]
FAIL asctime [status 1]
...
[Skip List]:
trace_stresstest
fatal_message
tgkill_ext
exittest01
...
```
注:此bat文件是从WSL映射目录传输文件到单板目录下,由于WSL无法直接访问windows端口,所以在WSL目录中使用可能无法传输用例。
4.
若要单独执行测试用例,将编译结果目录下的
`runtest`
与需要执行的用例传输到单板
单板执行
`./runtest -w '' {filename}`
,例如:
测试成功,无报错信息
```
# ./runtest -w '' memmem
```
测试失败,提示FAIL+用例名+错误码
```
# ./runtest -w '' pthread_atfork-errno-clobber
../../third_party/musl/libc-test/src/regression/pthread_atfork-errno-clobber.c:23: (pid = fork()) == -1 failed: fork succeeded despite rlimit
FAIL pthread_atfork-errno-clobber [status 1]
```
### 三、增加用例
举例:在functional目录中新增用例new_test
1.
在libc-test/src/functional目录下新建
`new_test.c`
2.
编辑libc-test/src/functional目录下的
`test_src_functional.gni`
,并在
`functional_list`
末尾添加
`"new_test",`
3.
(可选)利用模板添加编译选项,修改
`libc-test/test_template.gni`
中编译选项内容或针对指定的用例添加,例如:
```
if (target_name == "tls_init") {
cflags += [ "-Wno-literal-range" ]
ldflags += [ "-Wl,-rpath=./" ]
libs += [ "//${root_out_dir}/${test_lib_dir}/libtls_init_dso.so" ]
}
```
3.
执行步骤一(编译)中的编译命令,即可生成对应可执行文件。
libc-test/src/functionalext/common/asctime_data.h
浏览文件 @
4f9548bc
...
...
@@ -54,7 +54,7 @@ static const struct time_test_string_struct test_asctime_data[] = {
{
"Pacific/Efate"
,
"Sat Jul 30 21:40:14 2022"
},
{
"Pacific/Midway"
,
"Fri Jul 29 23:40:14 2022"
},
{
"Pacific/Niue"
,
"Fri Jul 29 23:40:14 2022"
},
{
"Pacific/
Enderbury
"
,
"Sat Jul 30 23:40:14 2022"
},
{
"Pacific/
Kanton
"
,
"Sat Jul 30 23:40:14 2022"
},
{
"Pacific/Funafuti"
,
"Sat Jul 30 22:40:14 2022"
},
{
"Pacific/Gambier"
,
"Sat Jul 30 01:40:14 2022"
},
{
"EET"
,
"Sat Jul 30 13:40:14 2022"
},
...
...
libc-test/src/functionalext/common/difftime_data.h
浏览文件 @
4f9548bc
...
...
@@ -54,7 +54,7 @@ static const struct time_test_double_struct test_difftime_data[] = {
{
"Pacific/Efate"
,
10
.
000000
},
{
"Pacific/Midway"
,
10
.
000000
},
{
"Pacific/Niue"
,
10
.
000000
},
{
"Pacific/
Enderbury
"
,
10
.
000000
},
{
"Pacific/
Kanton
"
,
10
.
000000
},
{
"Pacific/Funafuti"
,
10
.
000000
},
{
"Pacific/Gambier"
,
10
.
000000
},
{
"EET"
,
10
.
000000
},
...
...
libc-test/src/functionalext/common/gmtime_data.h
浏览文件 @
4f9548bc
...
...
@@ -54,7 +54,7 @@ static const struct time_test_string_struct test_gmtime_data[] = {
{
"Pacific/Efate"
,
"2022-6-30 10:40:14 wday=6,yday=210,isdst=0,gmtoff=0,zone=GMT"
},
{
"Pacific/Midway"
,
"2022-6-30 10:40:14 wday=6,yday=210,isdst=0,gmtoff=0,zone=GMT"
},
{
"Pacific/Niue"
,
"2022-6-30 10:40:14 wday=6,yday=210,isdst=0,gmtoff=0,zone=GMT"
},
{
"Pacific/
Enderbury
"
,
"2022-6-30 10:40:14 wday=6,yday=210,isdst=0,gmtoff=0,zone=GMT"
},
{
"Pacific/
Kanton
"
,
"2022-6-30 10:40:14 wday=6,yday=210,isdst=0,gmtoff=0,zone=GMT"
},
{
"Pacific/Funafuti"
,
"2022-6-30 10:40:14 wday=6,yday=210,isdst=0,gmtoff=0,zone=GMT"
},
{
"Pacific/Gambier"
,
"2022-6-30 10:40:14 wday=6,yday=210,isdst=0,gmtoff=0,zone=GMT"
},
{
"EET"
,
"2022-6-30 10:40:14 wday=6,yday=210,isdst=0,gmtoff=0,zone=GMT"
},
...
...
libc-test/src/functionalext/common/localtime_data.h
浏览文件 @
4f9548bc
...
...
@@ -54,7 +54,7 @@ static const struct time_test_string_struct test_localtime_data[] = {
{
"Pacific/Efate"
,
"2022-6-30 21:40:14 wday=6,yday=210,isdst=0,gmtoff=39600,zone=+11"
},
{
"Pacific/Midway"
,
"2022-6-29 23:40:14 wday=5,yday=209,isdst=0,gmtoff=-39600,zone=SST"
},
{
"Pacific/Niue"
,
"2022-6-29 23:40:14 wday=5,yday=209,isdst=0,gmtoff=-39600,zone=-11"
},
{
"Pacific/
Enderbury
"
,
"2022-6-30 23:40:14 wday=6,yday=210,isdst=0,gmtoff=46800,zone=+13"
},
{
"Pacific/
Kanton
"
,
"2022-6-30 23:40:14 wday=6,yday=210,isdst=0,gmtoff=46800,zone=+13"
},
{
"Pacific/Funafuti"
,
"2022-6-30 22:40:14 wday=6,yday=210,isdst=0,gmtoff=43200,zone=+12"
},
{
"Pacific/Gambier"
,
"2022-6-30 1:40:14 wday=6,yday=210,isdst=0,gmtoff=-32400,zone=-09"
},
{
"EET"
,
"2022-6-30 13:40:14 wday=6,yday=210,isdst=1,gmtoff=10800,zone=EEST"
},
...
...
libc-test/src/functionalext/common/mktime_data.h
浏览文件 @
4f9548bc
...
...
@@ -54,7 +54,7 @@ static const struct time_test_time_struct test_mktime_data[] = {
{
"Pacific/Efate"
,
1659177614
},
{
"Pacific/Midway"
,
1659177614
},
{
"Pacific/Niue"
,
1659177614
},
{
"Pacific/
Enderbury
"
,
1659177614
},
{
"Pacific/
Kanton
"
,
1659177614
},
{
"Pacific/Funafuti"
,
1659177614
},
{
"Pacific/Gambier"
,
1659177614
},
{
"EET"
,
1659177614
},
...
...
libc-test/src/functionalext/common/strftime_data.h
浏览文件 @
4f9548bc
...
...
@@ -439,7 +439,7 @@ static const struct time_test_string_struct test_strftime_data[] = {
{
"Pacific/Saipan"
,
"Sat Jul 30 20:40:14 2022 ChST+1000"
},
{
"Pacific/Guadalcanal"
,
"Sat Jul 30 21:40:14 2022 +11+1100"
},
{
"Pacific/Nauru"
,
"Sat Jul 30 22:40:14 2022 +12+1200"
},
{
"Pacific/
Enderbury
"
,
"Sat Jul 30 23:40:14 2022 +13+1300"
},
{
"Pacific/
Kanton
"
,
"Sat Jul 30 23:40:14 2022 +13+1300"
},
{
"Pacific/Bougainville"
,
"Sat Jul 30 21:40:14 2022 +11+1100"
},
{
"Pacific/Tarawa"
,
"Sat Jul 30 22:40:14 2022 +12+1200"
},
{
"Pacific/Kiritimati"
,
"Sun Jul 31 00:40:14 2022 +14+1400"
},
...
...
libc-test/src/functionalext/common/strptime_data.h
浏览文件 @
4f9548bc
...
...
@@ -439,7 +439,7 @@ static const struct time_test_string_struct test_strptime_data[] = {
{
"Pacific/Saipan"
,
"2022-6-30 20:40:14 wday=6,yday=0,isdst=0,gmtoff=36000,zone=ChST"
},
{
"Pacific/Guadalcanal"
,
"2022-6-30 21:40:14 wday=6,yday=0,isdst=0,gmtoff=39600,zone=+11"
},
{
"Pacific/Nauru"
,
"2022-6-30 22:40:14 wday=6,yday=0,isdst=0,gmtoff=43200,zone=+12"
},
{
"Pacific/
Enderbury
"
,
"2022-6-30 23:40:14 wday=6,yday=0,isdst=0,gmtoff=46800,zone=+13"
},
{
"Pacific/
Kanton
"
,
"2022-6-30 23:40:14 wday=6,yday=0,isdst=0,gmtoff=46800,zone=+13"
},
{
"Pacific/Bougainville"
,
"2022-6-30 21:40:14 wday=6,yday=0,isdst=0,gmtoff=39600,zone=+11"
},
{
"Pacific/Tarawa"
,
"2022-6-30 22:40:14 wday=6,yday=0,isdst=0,gmtoff=43200,zone=+12"
},
{
"Pacific/Kiritimati"
,
"2022-6-31 0:40:14 wday=0,yday=0,isdst=0,gmtoff=50400,zone=+14"
},
...
...
libc-test/src/functionalext/common/timegm_data.h
浏览文件 @
4f9548bc
...
...
@@ -54,7 +54,7 @@ static const struct time_test_time_struct test_timegm_data[] = {
{
"Pacific/Efate"
,
1659217214
},
{
"Pacific/Midway"
,
1659138014
},
{
"Pacific/Niue"
,
1659138014
},
{
"Pacific/
Enderbury
"
,
1659224414
},
{
"Pacific/
Kanton
"
,
1659224414
},
{
"Pacific/Funafuti"
,
1659220814
},
{
"Pacific/Gambier"
,
1659145214
},
{
"EET"
,
1659188414
},
...
...
libc-test/src/functionalext/dlns/dlns_separated.c
浏览文件 @
4f9548bc
...
...
@@ -231,13 +231,13 @@ void separated_1200(void)
Dl_namespace
dlns
;
dlns_init
(
&
dlns
,
"ns_asan_permit_path"
);
char
*
libcc
=
"/data/tests/libc-test/src/
functionalext/dlns/
C/libC.so"
;
char
*
libcc
=
"/data/tests/libc-test/src/C/libC.so"
;
void
*
handle
=
dlopen_ns
(
&
dlns
,
libcc
,
RTLD_LAZY
);
EXPECT_TRUE
(
"separated_1200"
,
handle
);
dlclose
(
handle
);
char
*
libbb
=
"/data/tests/libc-test/src/
functionalext/dlns/
B/libB.so"
;
char
*
libbb
=
"/data/tests/libc-test/src/B/libB.so"
;
void
*
handle1
=
dlopen_ns
(
&
dlns
,
libbb
,
RTLD_LAZY
);
EXPECT_FALSE
(
"separated_1200"
,
handle1
);
...
...
libc-test/src/functionalext/dlns/dlns_set_fun.c
浏览文件 @
4f9548bc
...
...
@@ -93,7 +93,7 @@ void dlns_set_namespace_lib_path_0500(void)
EXPECT_EQ
(
"dlns_set_namespace_lib_path_0500"
,
dlns_create
(
&
dlns
,
NULL
),
EOK
);
char
*
newlibpath
=
"/data/tests/libc-test/src
/functionalext/dlns:/data/tests/libc-test/src/functionalext/dlns
/B"
;
char
*
newlibpath
=
"/data/tests/libc-test/src
:/data/tests/libc-test/src
/B"
;
EXPECT_EQ
(
"dlns_set_namespace_lib_path_0500"
,
dlns_set_namespace_lib_path
(
"dlns_set_namespace_lib_path_0500"
,
newlibpath
),
EOK
);
...
...
@@ -198,7 +198,7 @@ void dlns_set_namespace_permitted_paths_0300(void)
Dl_namespace
dlns
;
dlns_init
(
&
dlns
,
"dlns_set_namespace_permitted_paths_0300"
);
char
*
newLibPath
=
"/data/tests/libc-test/src/
functionalext/dlns/
B/libB.so"
;
char
*
newLibPath
=
"/data/tests/libc-test/src/B/libB.so"
;
EXPECT_EQ
(
"dlns_set_namespace_permitted_paths_0300"
,
dlns_create
(
&
dlns
,
NULL
),
EOK
);
...
...
@@ -237,8 +237,8 @@ void dlns_set_namespace_permitted_paths_0500(void)
Dl_namespace
dlns
;
dlns_init
(
&
dlns
,
"dlns_set_namespace_permitted_paths_0500"
);
char
*
newPermittPath
=
"/data/tests/libc-test/src
/functionalext
"
;
char
*
libBpath
=
"/data/tests/libc-test/src/
functionalext/dlns/
B/libB.so"
;
char
*
newPermittPath
=
"/data/tests/libc-test/src"
;
char
*
libBpath
=
"/data/tests/libc-test/src/B/libB.so"
;
EXPECT_EQ
(
"dlns_set_namespace_permitted_paths_0500"
,
dlns_create
(
&
dlns
,
NULL
),
EOK
);
...
...
libc-test/src/functionalext/dlns/dlns_test.h
浏览文件 @
4f9548bc
...
...
@@ -16,19 +16,19 @@
#ifndef LIBC_TEST_SRC_FUNCTIONALEXT_DLNS_DLNS_TEST_H
#define LIBC_TEST_SRC_FUNCTIONALEXT_DLNS_DLNS_TEST_H
static
const
char
*
path
=
"/data/tests/libc-test/src
/functionalext/dlns
"
;
static
const
char
*
path
=
"/data/tests/libc-test/src"
;
static
const
char
*
dllName
=
"libdlopen_ns_dso.so"
;
static
const
char
*
dllNamePath
=
"/data/tests/libc-test/src/
functionalext/dlns/
libdlopen_ns_dso.so"
;
static
const
char
*
dllNamePath
=
"/data/tests/libc-test/src/libdlopen_ns_dso.so"
;
static
const
char
*
errdllNamePath
=
"/etc/test/libdlopen_ns_dso.so"
;
static
const
char
*
dllName2
=
"libdlopen_dso.so"
;
static
const
char
*
dllNamePath2
=
"/data/tests/libc-test/src/
functionalext/dlns/
libdlopen_dso.so"
;
static
const
char
*
dllNamePath2
=
"/data/tests/libc-test/src/libdlopen_dso.so"
;
static
const
char
*
errPath_ns
=
"src/test"
;
static
const
char
*
sharedLib
=
"sharedlibtest.so"
;
static
const
char
*
pathA
=
"/data/tests/libc-test/src/
functionalext/dlns/
A"
;
static
const
char
*
pathB
=
"/data/tests/libc-test/src/
functionalext/dlns/
B"
;
static
const
char
*
pathC
=
"/data/tests/libc-test/src/
functionalext/dlns/
C"
;
static
const
char
*
pathD
=
"/data/tests/libc-test/src/
functionalext/dlns/
D"
;
static
const
char
*
pathA
=
"/data/tests/libc-test/src/A"
;
static
const
char
*
pathB
=
"/data/tests/libc-test/src/B"
;
static
const
char
*
pathC
=
"/data/tests/libc-test/src/C"
;
static
const
char
*
pathD
=
"/data/tests/libc-test/src/D"
;
static
const
char
*
libB
=
"libB.so"
;
static
const
char
*
libC
=
"libC.so"
;
...
...
libc-test/test_template.gni
浏览文件 @
4f9548bc
...
...
@@ -158,9 +158,9 @@ template("test_unittest") {
}
if (target_dir == "functionalext/symver") {
ldflags += [ "-Wl,-rpath=./" ]
if (target_name == "dlsym" || target_name == "dlvsym" ||
target_name == "dynlink" || target_name == "dynlink_default") {
ldflags += [ "-Wl,-rpath=src/functional" ]
libs += [
"//${root_out_dir}/${test_lib_dir}/libdso_easy_symver.so",
"//${root_out_dir}/${test_lib_dir}/libdso_hard_symver.so",
...
...
porting/linux/user/config/ld-musl-namespace-aarch64-test.ini
浏览文件 @
4f9548bc
[section.dir.map]
acquiescence
=
/
test
=
/data/tests/libc-test/src
/functionalext:/data/tests/libc-test/src/functionalext/dlns
test
=
/data/tests/libc-test/src
[acquiescence]
namespace.default.lib.paths
=
/system/lib64:/vendor/lib64:/vendor/lib64/chipsetsdk:/system/lib64/ndk:/system/lib64/chipset-pub-sdk:/system/lib64/chipset-sdk:/system/lib64/platformsdk:/system/lib64/priv-platformsdk:/system/lib64/priv-module:/system/lib64/module:/system/lib64/module/data:/system/lib64/module/multimedia:/system/lib64/module/security:/system/lib:/vendor/lib:/system/lib/ndk:/system/lib/chipset-pub-sdk:/system/lib/chipset-sdk:/system/lib/platformsdk:/system/lib/priv-platformsdk:/system/lib/priv-module:/system/lib/module:/system/lib/module/data:/system/lib/module/multimedia:/lib64:/lib:/usr/local/lib:/usr/lib
...
...
@@ -11,11 +11,11 @@
#ns_no_allowed_libs ,allowed libs not configed
namespace.ns_no_allowed_libs.separated
=
true
namespace.ns_no_allowed_libs.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.ns_no_allowed_libs.lib.paths
=
/data/tests/libc-test/src
#ns_normal ,normal namespace
namespace.ns_normal.separated
=
true
namespace.ns_normal.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.ns_normal.lib.paths
=
/data/tests/libc-test/src
namespace.ns_normal.allowed.libs
=
libdlopen_ns_dso.so
#ns_wrong_lib_path ,path in allowed_libs,but not in env or lib or permitted Path
...
...
@@ -36,21 +36,21 @@
#inherited_class
namespace.inherited_class.separated
=
true
namespace.inherited_class.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.inherited_class.lib.paths
=
/data/tests/libc-test/src
namespace.inherited_class.allowed.libs
=
libdlopen_ns_dso.so:sharedlibtest.so
#ns_separated_flase
namespace.ns_separated_flase.separated
=
false
namespace.ns_separated_flase.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.ns_separated_flase.lib.paths
=
/data/tests/libc-test/src
namespace.ns_separated_flase.allowed.libs
=
libdlopen_ns_dso.so
#ns_asan_lib_path ,testing asan.lib.paths
namespace.ns_asan_lib_path.separated
=
true
namespace.ns_asan_lib_path.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.ns_asan_lib_path.asan.lib.paths
=
/data/tests/libc-test/src/
functionalext/dlns/
B
namespace.ns_asan_lib_path.lib.paths
=
/data/tests/libc-test/src
namespace.ns_asan_lib_path.asan.lib.paths
=
/data/tests/libc-test/src/B
#ns_asan_permit_path ,testing asan.permitted.paths
namespace.ns_asan_permit_path.separated
=
true
namespace.ns_asan_permit_path.permitted.paths
=
/data/tests/libc-test/src/
functionalext/dlns/
C
namespace.ns_asan_permit_path.asan.permitted.paths
=
/data/tests/libc-test/src/
functionalext/dlns/
B
namespace.ns_asan_permit_path.separated
=
true
namespace.ns_asan_permit_path.permitted.paths
=
/data/tests/libc-test/src/C
namespace.ns_asan_permit_path.asan.permitted.paths
=
/data/tests/libc-test/src/B
porting/linux/user/config/ld-musl-namespace-arm-test.ini
浏览文件 @
4f9548bc
[section.dir.map]
acquiescence
=
/
test
=
/data/tests/libc-test/src
/functionalext:/data/tests/libc-test/src/functionalext/dlns
test
=
/data/tests/libc-test/src
[acquiescence]
namespace.default.lib.paths
=
/system/lib:/vendor/lib:/vendor/lib/chipsetsdk:/system/lib/ndk:/system/lib/chipset-pub-sdk:/system/lib/chipset-sdk:/system/lib/platformsdk:/system/lib/priv-platformsdk:/system/lib/priv-module:/system/lib/module:/system/lib/module/data:/system/lib/module/multimedia:/system/lib/module/security:/lib:/usr/local/lib:/usr/lib
...
...
@@ -11,11 +11,11 @@
#ns_no_allowed_libs ,allowed libs not configed
namespace.ns_no_allowed_libs.separated
=
true
namespace.ns_no_allowed_libs.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.ns_no_allowed_libs.lib.paths
=
/data/tests/libc-test/src
#ns_normal ,normal namespace
namespace.ns_normal.separated
=
true
namespace.ns_normal.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.ns_normal.lib.paths
=
/data/tests/libc-test/src
namespace.ns_normal.allowed.libs
=
libdlopen_ns_dso.so
#ns_wrong_lib_path ,path in allowed_libs,but not in env or lib or permitted Path
...
...
@@ -36,21 +36,21 @@
#inherited_class
namespace.inherited_class.separated
=
true
namespace.inherited_class.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.inherited_class.lib.paths
=
/data/tests/libc-test/src
namespace.inherited_class.allowed.libs
=
libdlopen_ns_dso.so:sharedlibtest.so
#ns_separated_flase
namespace.ns_separated_flase.separated
=
false
namespace.ns_separated_flase.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.ns_separated_flase.lib.paths
=
/data/tests/libc-test/src
namespace.ns_separated_flase.allowed.libs
=
libdlopen_ns_dso.so
#ns_asan_lib_path ,testing asan.lib.paths
namespace.ns_asan_lib_path.separated
=
true
namespace.ns_asan_lib_path.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.ns_asan_lib_path.asan.lib.paths
=
/data/tests/libc-test/src/
functionalext/dlns/
B
namespace.ns_asan_lib_path.lib.paths
=
/data/tests/libc-test/src
namespace.ns_asan_lib_path.asan.lib.paths
=
/data/tests/libc-test/src/B
#ns_asan_permit_path ,testing asan.permitted.paths
namespace.ns_asan_permit_path.separated
=
true
namespace.ns_asan_permit_path.permitted.paths
=
/data/tests/libc-test/src/
functionalext/dlns/
C
namespace.ns_asan_permit_path.asan.permitted.paths
=
/data/tests/libc-test/src/
functionalext/dlns/
B
namespace.ns_asan_permit_path.separated
=
true
namespace.ns_asan_permit_path.permitted.paths
=
/data/tests/libc-test/src/C
namespace.ns_asan_permit_path.asan.permitted.paths
=
/data/tests/libc-test/src/B
porting/linux/user/config/ld-musl-namespace-x86_64-test.ini
浏览文件 @
4f9548bc
[section.dir.map]
acquiescence
=
/
test
=
/data/tests/libc-test/src
/functionalext:/data/tests/libc-test/src/functionalext/dlns
test
=
/data/tests/libc-test/src
[acquiescence]
namespace.default.lib.paths
=
/system/lib64:/vendor/lib64:/vendor/lib64/chipsetsdk:/system/lib64/ndk:/system/lib64/chipset-pub-sdk:/system/lib64/chipset-sdk:/system/lib64/platformsdk:/system/lib64/priv-platformsdk:/system/lib64/priv-module:/system/lib64/module:/system/lib64/module/data:/system/lib64/module/multimedia:/system/lib64/module/security:/lib64
...
...
@@ -11,11 +11,11 @@
#ns_no_allowed_libs ,allowed libs not configed
namespace.ns_no_allowed_libs.separated
=
true
namespace.ns_no_allowed_libs.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.ns_no_allowed_libs.lib.paths
=
/data/tests/libc-test/src
#ns_normal ,normal namespace
namespace.ns_normal.separated
=
true
namespace.ns_normal.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.ns_normal.lib.paths
=
/data/tests/libc-test/src
namespace.ns_normal.allowed.libs
=
libdlopen_ns_dso.so
#ns_wrong_lib_path ,path in allowed_libs,but not in env or lib or permitted Path
...
...
@@ -36,21 +36,21 @@
#inherited_class
namespace.inherited_class.separated
=
true
namespace.inherited_class.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.inherited_class.lib.paths
=
/data/tests/libc-test/src
namespace.inherited_class.allowed.libs
=
libdlopen_ns_dso.so:sharedlibtest.so
#ns_separated_flase
namespace.ns_separated_flase.separated
=
false
namespace.ns_separated_flase.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.ns_separated_flase.lib.paths
=
/data/tests/libc-test/src
namespace.ns_separated_flase.allowed.libs
=
libdlopen_ns_dso.so
#ns_asan_lib_path ,testing asan.lib.paths
namespace.ns_asan_lib_path.separated
=
true
namespace.ns_asan_lib_path.lib.paths
=
/data/tests/libc-test/src
/functionalext/dlns
namespace.ns_asan_lib_path.asan.lib.paths
=
/data/tests/libc-test/src/
functionalext/dlns/
B
namespace.ns_asan_lib_path.lib.paths
=
/data/tests/libc-test/src
namespace.ns_asan_lib_path.asan.lib.paths
=
/data/tests/libc-test/src/B
#ns_asan_permit_path ,testing asan.permitted.paths
namespace.ns_asan_permit_path.separated
=
true
namespace.ns_asan_permit_path.permitted.paths
=
/data/tests/libc-test/src/
functionalext/dlns/
C
namespace.ns_asan_permit_path.asan.permitted.paths
=
/data/tests/libc-test/src/
functionalext/dlns/
B
namespace.ns_asan_permit_path.separated
=
true
namespace.ns_asan_permit_path.permitted.paths
=
/data/tests/libc-test/src/C
namespace.ns_asan_permit_path.asan.permitted.paths
=
/data/tests/libc-test/src/B
scripts/runtest.sh
浏览文件 @
4f9548bc
cd
/data/tests/libc-test/src
rm
/data/tests/libc-test/REPORT
rm
/data/tests/libc-test/FileList.txt
rm
/data/tests/libc-test/SkipList.txt
touch
/data/tests/libc-test/REPORT
touch
/data/tests/libc-test/FileList.txt
touch
/data/tests/libc-test/SkipList.txt
function
FileSuffix
()
{
local
filename
=
"
$1
"
...
...
@@ -11,9 +15,22 @@ function FileSuffix() {
}
#Test cases that need to be shielded
ShieldedList
=(
"trace_stresstest"
"fatal_message"
"tgkill"
"exittest01"
"exittest02"
"syslog"
"vsyslog"
"ldso_randomization_manual"
"ldso_randomization_test"
"dlopen_ext_relro_test"
"runtest"
)
ShieldedList
=(
"trace_stresstest"
"syslog"
"vsyslog"
"runtest"
#Failed when running by shell, need to be run manually
"fatal_message"
"tgkill_ext"
"exittest01"
"exittest02"
"stat"
"isatty"
"ldso_randomization_manual"
"ldso_randomization_test"
"dlopen_ext_relro_test"
"tcgetattr"
"tcgetpgrp"
"tcgetsid"
"tcsendbreak"
"tcsetattr"
"tcsetpgrp"
#These need run with special condiction
"ipc_msg"
"ipc_sem"
"ipc_shm"
"sem_close-unmap"
"sem_open"
"pthread_atfork-errno-clobber"
"flockfile-list"
"dlns_set_fun_test"
"dlns_inherit_test"
"dlns_separated_test"
#Some math test cases need to skip.
"acoshl"
"asinhl"
"erfcl"
"fenv"
"fma"
"fmaf"
"fmal"
"lgammal"
"nearbyint"
"nearbyintf"
"nearbyintl"
"rint"
"rintf"
"rintl"
"sqrt"
"sqrtf"
"sqrtl"
"tgammal"
)
for
skiped
in
${
ShieldedList
[*]
}
;
do
echo
$skiped
>>
/data/tests/libc-test/SkipList.txt
done
function
ShieldedCases
()
{
for
filename
in
${
ShieldedList
[*]
}
...
...
@@ -32,11 +49,14 @@ do
||
[
-d
$file
]
then
continue
elif
[
"
$file
"
=
"tgkill"
]
elif
[
-x
$file
]
&&
[
-s
$file
]
then
./runtest
-w
''
$file
12345 34567
>>
/data/tests/libc-test/REPORT
else
echo
$subdir
/
$file
>>
FileList
./runtest
-w
''
$file
>>
/data/tests/libc-test/REPORT
echo
$file
>>
/data/tests/libc-test/FileList.txt
if
[
"
$file
"
=
"tgkill"
]
then
./runtest
-w
''
$file
12345 34567
>>
/data/tests/libc-test/REPORT
else
./runtest
-w
''
-t
30
$file
>>
/data/tests/libc-test/REPORT
fi
fi
done
\ No newline at end of file
scripts/runtest_Windows.bat
浏览文件 @
4f9548bc
...
...
@@ -11,15 +11,10 @@ set TESTDIR=%LOCAL%\%OUTDIR%\musl\libc-test
set
DYNLIB
=
%LOCAL%
\
%OUTDIR%
\musl\libc
-test-lib
@REM 远程传输目标目录
set
REMOTE
=
/data/tests/libc-test
set
REMOTEFEXT
=
/data/tests/libc-test/src/functionalext
set
REMOTESYSTEM
=
/system/lib
@REM runtest脚本所在目录
set
SHDIR
=
%LOCAL%
\third_party\musl\scripts
@REM 开始时间
set
/a
startS
=
%time
:
~
6
,
2
%
set
/a
startM
=
%time
:
~
3
,
2
%
@REM 检查设备是否连接
echo
checking
HDC
device
for
/F
"usebackq delims=="
%%c
in
(
`hdc list targets`
)
DO
(
...
...
@@ -36,14 +31,13 @@ if exist %TESTDIR% (
goto
end
)
@REM 在单板创建目录, 需要预先创建好才能传输到相应位置。
:hdcStart
echo
.
echo
now
mkdir
...
hdc
shell
rm
-rf /data/tests/libc-test
hdc
shell
mkdir
/data/tests
hdc
shell
mkdir
%REMOTE%
hdc
shell
mkdir
%REMOTE%
/src
@REM 创建临时文件夹,用于存放用例生成的临时文件
hdc
shell
mkdir
/tmp
...
...
@@ -53,10 +47,7 @@ goto hdcSend
@REM 传输文件,单板上执行runtest.sh,将结果REPORT返回到.bat所在目录
:hdcSend
for
%%i
in
(
%TESTDIR%
\
*)
do
(
echo
%%i
hdc
file
send
%%i
%REMOTE%
/src
)
hdc
file
send
%TESTDIR%
%REMOTE%
/src
for
%%j
in
(
%DYNLIB%
\
*)
do
(
echo
%%j
hdc
file
send
%%j
%REMOTE%
/src
...
...
@@ -65,20 +56,86 @@ hdc shell chmod +x %REMOTE%/src/*
hdc
shell
mount
-o
rw
,
remount
/
hdc
shell
chmod
777
/etc
hdc
shell
cp
/etc/ld-musl-namespace-arm
.ini
/etc/ld-musl-namespace-arm
.ini.bak
hdc
file
send
%LOCAL%
\third_party\musl\porting\linux\user\config\ld
-musl-namespace-arm-test
.ini
^
/etc/ld-musl-namespace-arm
.ini
hdc
shell
mkdir
%REMOTE%
/src/A
hdc
shell
mkdir
%REMOTE%
/src/B
hdc
shell
mkdir
%REMOTE%
/src/C
hdc
shell
mkdir
%REMOTE%
/src/D
hdc
shell
mv
%REMOTE%
/src/libdlns
_dlsym_dep_a.so
%REMOTE%
/src/A
hdc
shell
mv
%REMOTE%
/src/libdlns
_dlsym_dep_b.so
%REMOTE%
/src/B
hdc
shell
mv
%REMOTE%
/src/libdlns
_dlsym_dep_c.so
%REMOTE%
/src/C
hdc
shell
cp
%REMOTE%
/src/libdlopen
_dso.so
%REMOTE%
/src/B/libB
.so
hdc
shell
cp
%REMOTE%
/src/libdlopen
_dso.so
%REMOTE%
/src/C/libC
.so
hdc
shell
cp
%REMOTE%
/src/libdlopen
_dso.so
%REMOTE%
/src/D/libD
.so
hdc
shell
cp
%REMOTE%
/src/libdlopen
_dso.so
%REMOTE%
/src/sharedlibtest
.so
hdc
shell
cp
%REMOTE%
/src/libdlopen
_dso.so
%REMOTE%
/src/set
_lib_path_0200.so
hdc
shell
cp
%REMOTE%
/src/libdlopen
_dso.so
%REMOTE%
/src/inherit
_0300.so
hdc
shell
cp
%REMOTE%
/src/libdlopen
_dso.so
%REMOTE%
/src/inherit
_0700.so
hdc
shell
cp
%REMOTE%
/src/libdlopen
_dso.so
%REMOTE%
/src/inherit
_0800.so
hdc
shell
cp
%REMOTE%
/src/libdlopen
_dso.so
%REMOTE%
/src/inherit
_1100.so
hdc
shell
cp
%REMOTE%
/src/libdlopen
_ns_dso.so
/system/lib
hdc
file
send
%SHDIR%
\runtest.sh
%REMOTE%
/runtest
.sh
hdc
shell
chmod
+x
%REMOTE%
/runtest
.sh
hdc
shell
%REMOTE%
/runtest
.sh
:Summary
echo
hdc
file
recv
%REMOTE%
/REPORT
%~dp0
REPORT
hdc
file
recv
%REMOTE%
/REPORT
%~dp0
REPORT
:end
if
exist
FileList
.txt
(
del
FileList
.txt
)
if
exist
Summary
.txt
(
del
Summary
.txt
)
hdc
file
recv
%REMOTE%
/FileList
.txt
%~dp0
FileList
.txt
hdc
file
recv
%REMOTE%
/SkipList
.txt
%~dp0
SkipList
.txt
for
/f
"delims=:"
%%a
in
(
'dir /b "
%TESTDIR%
"
^|
findstr /n .*'
)
do
set
all
=
%%a
for
/f
%%b
in
(
' find /c /v ""
^<
"FileList.txt" '
)
do
set
/a
run
=
%%b
for
/f
%%c
in
(
' find /c "FAIL"
^<
"REPORT" '
)
do
set
fail
=
%%c
echo
===================================
set
/a
pass
=
%run%
-
%fail%
set
/a
skip
=
%all%
-
%run%
echo
SUMMARY
echo
All
:
%all%
^|
Run
:
%run%
^|
Skip
:
%skip%
echo
Pass
:
[
%pass%
/
%run%
]
echo
Fail
:
[
%fail%
/
%run%
]
(
echo
SUMMARY
echo
All
:
%all%
^|
Run
:
%run%
^|
Skip
:
%skip%
echo
Pass
:
[
%pass%
/
%run%
]
echo
Fail
:
[
%fail%
/
%run%
]
echo
Check
REPORT
for
more
details
.
echo
.
set
/a
endS
=
%time
:
~
6
,
2
%
set
/a
endM
=
%time
:
~
3
,
2
%
set
/a
diffS_
=
%endS%
-
%startS%
set
/a
diffM_
=
%endM%
-
%startM%
)>>
Summary
.txt
echo
[
Failed
List
]
:
>>
Summary
.txt
setlocal
EnableDelayedExpansion
for
/f
"delims="
%%i
in
(
'findstr /c:"FAIL" REPORT'
)
do
(
set
"F=
%%i
"
set
"F=
!
F:*FAIL =FAIL
!
"
echo
!F!
>>
Summary
.txt
)
echo
.
>>
Summary
.txt
echo
[
Skip
List
]
:
>>
Summary
.txt
copy
/b
Summary
.txt
+SkipList
.txt
del
SkipList
.txt
goto
end
:noDevice
echo
Device
not
found
,
please
check
your
device
.
:end
echo
.
pause
exit
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录