Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
6c0b0dde
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
460
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6c0b0dde
编写于
5月 18, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 18, 2023
浏览文件
操作
浏览文件
下载
差异文件
!1157 test:调整TDD测试用例
Merge pull request !1157 from zhangdengyu/fixTest0424
上级
5de241eb
76228c36
变更
37
隐藏空白更改
内联
并排
Showing
37 changed file
with
845 addition
and
213 deletion
+845
-213
testsuites/unittest/BUILD.gn
testsuites/unittest/BUILD.gn
+26
-6
testsuites/unittest/basic/dynload/smoke/dynload_test_002.cpp
testsuites/unittest/basic/dynload/smoke/dynload_test_002.cpp
+20
-8
testsuites/unittest/config.gni
testsuites/unittest/config.gni
+15
-15
testsuites/unittest/libc/io/BUILD.gn
testsuites/unittest/libc/io/BUILD.gn
+7
-7
testsuites/unittest/libc/io/config.gni
testsuites/unittest/libc/io/config.gni
+25
-5
testsuites/unittest/libc/misc/BUILD.gn
testsuites/unittest/libc/misc/BUILD.gn
+68
-0
testsuites/unittest/libc/misc/config.gni
testsuites/unittest/libc/misc/config.gni
+25
-5
testsuites/unittest/libc/posix/BUILD.gn
testsuites/unittest/libc/posix/BUILD.gn
+68
-0
testsuites/unittest/libc/posix/config.gni
testsuites/unittest/libc/posix/config.gni
+68
-0
testsuites/unittest/libc/posix/mem/config.gni
testsuites/unittest/libc/posix/mem/config.gni
+6
-5
testsuites/unittest/libc/posix/mqueue/config.gni
testsuites/unittest/libc/posix/mqueue/config.gni
+6
-5
testsuites/unittest/libc/posix/pthread/config.gni
testsuites/unittest/libc/posix/pthread/config.gni
+6
-5
testsuites/unittest/libc/sys/BUILD.gn
testsuites/unittest/libc/sys/BUILD.gn
+68
-0
testsuites/unittest/libc/sys/config.gni
testsuites/unittest/libc/sys/config.gni
+25
-5
testsuites/unittest/libc/time/BUILD.gn
testsuites/unittest/libc/time/BUILD.gn
+68
-0
testsuites/unittest/libc/time/clock/config.gni
testsuites/unittest/libc/time/clock/config.gni
+6
-5
testsuites/unittest/libc/time/config.gni
testsuites/unittest/libc/time/config.gni
+15
-14
testsuites/unittest/libc/time/timer/config.gni
testsuites/unittest/libc/time/timer/config.gni
+6
-5
testsuites/unittest/libc/util/BUILD.gn
testsuites/unittest/libc/util/BUILD.gn
+68
-0
testsuites/unittest/libc/util/config.gni
testsuites/unittest/libc/util/config.gni
+25
-5
testsuites/unittest/process/basic/process/BUILD.gn
testsuites/unittest/process/basic/process/BUILD.gn
+5
-5
testsuites/unittest/process/basic/process/config.gni
testsuites/unittest/process/basic/process/config.gni
+26
-5
testsuites/unittest/process/basic/pthread/BUILD.gn
testsuites/unittest/process/basic/pthread/BUILD.gn
+58
-0
testsuites/unittest/process/basic/pthread/config.gni
testsuites/unittest/process/basic/pthread/config.gni
+26
-5
testsuites/unittest/process/basic/pthread/smoke/pthread_test_020.cpp
...unittest/process/basic/pthread/smoke/pthread_test_020.cpp
+13
-13
testsuites/unittest/process/basic/pthread/smoke/pthread_test_021.cpp
...unittest/process/basic/pthread/smoke/pthread_test_021.cpp
+14
-14
testsuites/unittest/process/basic/pthread/smoke/pthread_test_022.cpp
...unittest/process/basic/pthread/smoke/pthread_test_022.cpp
+15
-15
testsuites/unittest/process/basic/pthread/smoke/pthread_test_023.cpp
...unittest/process/basic/pthread/smoke/pthread_test_023.cpp
+6
-6
testsuites/unittest/process/basic/pthread/smoke/pthread_test_024.cpp
...unittest/process/basic/pthread/smoke/pthread_test_024.cpp
+3
-3
testsuites/unittest/process/basic/pthread/smoke/pthread_test_025.cpp
...unittest/process/basic/pthread/smoke/pthread_test_025.cpp
+3
-3
testsuites/unittest/process/basic/pthread/smoke/pthread_test_026.cpp
...unittest/process/basic/pthread/smoke/pthread_test_026.cpp
+10
-10
testsuites/unittest/process/basic/pthread/smoke/pthread_test_027.cpp
...unittest/process/basic/pthread/smoke/pthread_test_027.cpp
+6
-6
testsuites/unittest/process/lock/BUILD.gn
testsuites/unittest/process/lock/BUILD.gn
+1
-1
testsuites/unittest/process/lock/config.gni
testsuites/unittest/process/lock/config.gni
+19
-17
testsuites/unittest/process/lock/mutex/config.gni
testsuites/unittest/process/lock/mutex/config.gni
+6
-5
testsuites/unittest/process/lock/rwlock/config.gni
testsuites/unittest/process/lock/rwlock/config.gni
+6
-5
testsuites/unittest/process/lock/spinlock/config.gni
testsuites/unittest/process/lock/spinlock/config.gni
+7
-5
未找到文件。
testsuites/unittest/BUILD.gn
浏览文件 @
6c0b0dde
...
@@ -113,10 +113,24 @@ group("unittest") {
...
@@ -113,10 +113,24 @@ group("unittest") {
# libc test
# libc test
if (LOSCFG_USER_TEST_LIBC == true) {
if (LOSCFG_USER_TEST_LIBC == true) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
deps += [ "libc:liteos_a_libc_unittest_door" ]
deps += [
"libc/io:liteos_a_libc_io_unittest_door",
"libc/misc:liteos_a_libc_misc_unittest_door",
"libc/posix:liteos_a_libc_posix_unittest_door",
"libc/sys:liteos_a_libc_sys_unittest_door",
"libc/time:liteos_a_libc_time_unittest_door",
"libc/util:liteos_a_libc_util_unittest_door",
]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
deps += [ "libc:liteos_a_libc_unittest" ]
deps += [
"libc/io:liteos_a_libc_io_unittest",
"libc/misc:liteos_a_libc_misc_unittest",
"libc/posix:liteos_a_libc_posix_unittest",
"libc/sys:liteos_a_libc_sys_unittest",
"libc/time:liteos_a_libc_time_unittest",
"libc/util:liteos_a_libc_util_unittest",
]
}
}
}
}
...
@@ -133,8 +147,11 @@ group("unittest") {
...
@@ -133,8 +147,11 @@ group("unittest") {
# process test
# process test
if (LOSCFG_USER_TEST_PROCESS_THREAD == true) {
if (LOSCFG_USER_TEST_PROCESS_THREAD == true) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
deps += [ "process/basic:liteos_a_process_basic_unittest_door" ]
deps += [
deps += [ "process/lock:liteos_a_process_lock_unittest_door" ]
"process/basic/process:liteos_a_process_basic_process_unittest_door",
"process/basic/pthread:liteos_a_process_basic_pthread_unittest_door",
"process/lock:liteos_a_process_lock_unittest_door",
]
if (LOSCFG_USER_TEST_PROCESS_FS == true) {
if (LOSCFG_USER_TEST_PROCESS_FS == true) {
deps += [ "process/fs:liteos_a_process_fs_unittest_door" ]
deps += [ "process/fs:liteos_a_process_fs_unittest_door" ]
}
}
...
@@ -143,8 +160,11 @@ group("unittest") {
...
@@ -143,8 +160,11 @@ group("unittest") {
}
}
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
deps += [ "process/basic:liteos_a_process_basic_unittest" ]
deps += [
deps += [ "process/lock:liteos_a_process_lock_unittest" ]
"process/basic/process:liteos_a_process_basic_process_unittest",
"process/basic/pthread:liteos_a_process_basic_pthread_unittest",
"process/lock:liteos_a_process_lock_unittest",
]
if (LOSCFG_USER_TEST_PROCESS_FS == true) {
if (LOSCFG_USER_TEST_PROCESS_FS == true) {
deps += [ "process/fs:liteos_a_process_fs_unittest" ]
deps += [ "process/fs:liteos_a_process_fs_unittest" ]
}
}
...
...
testsuites/unittest/basic/dynload/smoke/dynload_test_002.cpp
浏览文件 @
6c0b0dde
/*
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-202
1
Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-202
3
Huawei Device Co., Ltd. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
...
@@ -42,40 +42,52 @@ static int Testcase(void)
...
@@ -42,40 +42,52 @@ static int Testcase(void)
char
*
workingPath
=
"/usr/bin"
;
char
*
workingPath
=
"/usr/bin"
;
void
*
handle
=
nullptr
;
void
*
handle
=
nullptr
;
int
(
*
func
)(
int
);
int
(
*
func
)(
int
);
char
curPath
[
1024
]
=
{
0
};
/* 1024, buffer size */
handle
=
getcwd
(
curPath
,
sizeof
(
curPath
));
ICUNIT_ASSERT_NOT_EQUAL
(
handle
,
NULL
,
handle
);
ret
=
chdir
(
workingPath
);
ret
=
chdir
(
workingPath
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
handle
=
dlopen
(
NULL
,
RTLD_NOW
|
RTLD_LOCAL
);
handle
=
dlopen
(
NULL
,
RTLD_NOW
|
RTLD_LOCAL
);
ICUNIT_
ASSERT_NOT_EQUAL
(
handle
,
NULL
,
handle
);
ICUNIT_
GOTO_NOT_EQUAL
(
handle
,
NULL
,
1
,
EXIT1
);
/* 1, return value */
ret
=
dlclose
(
handle
);
ret
=
dlclose
(
handle
);
ICUNIT_
ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_
GOTO_EQUAL
(
ret
,
0
,
ret
,
EXIT
);
handle
=
dlopen
(
LIBCSO_REAL_PATH
,
RTLD_NOW
);
handle
=
dlopen
(
LIBCSO_REAL_PATH
,
RTLD_NOW
);
ICUNIT_
ASSERT_NOT_EQUAL
(
handle
,
NULL
,
handle
);
ICUNIT_
GOTO_NOT_EQUAL
(
handle
,
NULL
,
1
,
EXIT1
);
/* 1, return value */
func
=
reinterpret_cast
<
int
(
*
)(
int
)
>
(
dlsym
(
handle
,
SYMBOL_TO_FIND
));
func
=
reinterpret_cast
<
int
(
*
)(
int
)
>
(
dlsym
(
handle
,
SYMBOL_TO_FIND
));
ICUNIT_GOTO_NOT_EQUAL
(
func
,
NULL
,
func
,
EXIT
);
ICUNIT_GOTO_NOT_EQUAL
(
func
,
NULL
,
func
,
EXIT
);
ICUNIT_GOTO_EQUAL
(
func
,
SYMBOL_TO_MATCH
,
func
,
EXIT
);
ICUNIT_GOTO_EQUAL
(
func
,
SYMBOL_TO_MATCH
,
func
,
EXIT
);
ret
=
dlclose
(
handle
);
ret
=
dlclose
(
handle
);
ICUNIT_
ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_
GOTO_EQUAL
(
ret
,
0
,
ret
,
EXIT
);
handle
=
dlopen
(
LIBCSO_RELATIVE_PATH
,
RTLD_NOW
);
handle
=
dlopen
(
LIBCSO_RELATIVE_PATH
,
RTLD_NOW
);
ICUNIT_
ASSERT_NOT_EQUAL
(
handle
,
NULL
,
handle
);
ICUNIT_
GOTO_NOT_EQUAL
(
handle
,
NULL
,
1
,
EXIT1
);
/* 1, return value */
func
=
reinterpret_cast
<
int
(
*
)(
int
)
>
(
dlsym
(
handle
,
SYMBOL_TO_FIND
));
func
=
reinterpret_cast
<
int
(
*
)(
int
)
>
(
dlsym
(
handle
,
SYMBOL_TO_FIND
));
ICUNIT_GOTO_NOT_EQUAL
(
func
,
NULL
,
func
,
EXIT
);
ICUNIT_GOTO_NOT_EQUAL
(
func
,
NULL
,
func
,
EXIT
);
ret
=
dlclose
(
handle
);
ret
=
dlclose
(
handle
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_GOTO_EQUAL
(
ret
,
0
,
ret
,
EXIT
);
ret
=
chdir
(
curPath
);
ICUNIT_GOTO_EQUAL
(
ret
,
0
,
ret
,
EXIT1
);
return
0
;
return
0
;
EXIT:
EXIT:
dlclose
(
handle
);
dlclose
(
handle
);
return
0
;
EXIT1:
ret
=
chdir
(
curPath
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
return
1
;
/* 1, return value */
}
}
void
ItTestDynload002
(
void
)
void
ItTestDynload002
(
void
)
...
...
testsuites/unittest/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
# Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
# Copyright (c) 2020-202
1
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2020-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -64,11 +64,11 @@ LOSCFG_USER_TEST_MEM_VM = true
...
@@ -64,11 +64,11 @@ LOSCFG_USER_TEST_MEM_VM = true
LOSCFG_USER_TEST_PROCESS_THREAD = true
LOSCFG_USER_TEST_PROCESS_THREAD = true
# Module list
# Module list
LOSCFG_USER_TEST_
MUTEX
= true
LOSCFG_USER_TEST_
PROCESS_BASIC_PROCESS
= true
LOSCFG_USER_TEST_PROCESS = true
LOSCFG_USER_TEST_PROCESS
_BASIC_PTHREAD
= true
LOSCFG_USER_TEST_P
THREAD
= true
LOSCFG_USER_TEST_P
ROCESS_LOCK_MUTEX
= true
LOSCFG_USER_TEST_RWLOCK = true
LOSCFG_USER_TEST_
PROCESS_LOCK_
RWLOCK = true
LOSCFG_USER_TEST_SPINLOCK = true
LOSCFG_USER_TEST_
PROCESS_LOCK_
SPINLOCK = true
########## extended test ##########
########## extended test ##########
# Control switch for extended function test
# Control switch for extended function test
...
@@ -102,15 +102,15 @@ LOSCFG_USER_TEST_FS_VFAT = false
...
@@ -102,15 +102,15 @@ LOSCFG_USER_TEST_FS_VFAT = false
LOSCFG_USER_TEST_LIBC = true
LOSCFG_USER_TEST_LIBC = true
# Module list
# Module list
LOSCFG_USER_TEST_IO = true
LOSCFG_USER_TEST_
LIBC_
IO = true
LOSCFG_USER_TEST_MISC = true
LOSCFG_USER_TEST_
LIBC_
MISC = true
LOSCFG_USER_TEST_POSIX_MEM = true
LOSCFG_USER_TEST_
LIBC_
POSIX_MEM = true
LOSCFG_USER_TEST_POSIX_MQUEUE = true
LOSCFG_USER_TEST_
LIBC_
POSIX_MQUEUE = true
LOSCFG_USER_TEST_POSIX_PTHREAD = false
LOSCFG_USER_TEST_
LIBC_
POSIX_PTHREAD = false
LOSCFG_USER_TEST_SYS = true
LOSCFG_USER_TEST_
LIBC_
SYS = true
LOSCFG_USER_TEST_TIME_CLOCK = true
LOSCFG_USER_TEST_
LIBC_
TIME_CLOCK = true
LOSCFG_USER_TEST_TIME_TIMER = true
LOSCFG_USER_TEST_
LIBC_
TIME_TIMER = true
LOSCFG_USER_TEST_UTIL = true
LOSCFG_USER_TEST_
LIBC_
UTIL = true
########## net test ##########
########## net test ##########
# Control switch for network function test
# Control switch for network function test
...
...
testsuites/unittest/libc/BUILD.gn
→
testsuites/unittest/libc/
io/
BUILD.gn
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -31,15 +31,15 @@ import("//kernel/liteos_a/testsuites/unittest/config.gni")
...
@@ -31,15 +31,15 @@ import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
import("./config.gni")
config("libc_config") {
config("libc_config") {
if (LOSCFG_USER_TEST_POSIX_MQUEUE == true ||
if (LOSCFG_USER_TEST_
LIBC_
POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_POSIX_PTHREAD == true) {
LOSCFG_USER_TEST_
LIBC_
POSIX_PTHREAD == true) {
cflags = [ "-O1" ]
cflags = [ "-O1" ]
cflags_cc = cflags
cflags_cc = cflags
}
}
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_libc_unittest_door") {
unittest("liteos_a_libc_
io_
unittest_door") {
output_extension = "bin"
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
include_dirs = common_include_dirs
...
@@ -47,21 +47,21 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
...
@@ -47,21 +47,21 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
sources += sources_smoke
sources += sources_smoke
sources_full = []
sources_full = []
sources += sources_full
sources += sources_full
configs = [ "..:public_config_for_door" ]
configs = [ "..
/..
:public_config_for_door" ]
configs += [ ":libc_config" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_libc_unittest") {
unittest("liteos_a_libc_
io_
unittest") {
output_extension = "bin"
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
include_dirs = common_include_dirs
sources = sources_entry
sources = sources_entry
sources += sources_smoke
sources += sources_smoke
sources += sources_full
sources += sources_full
configs = [ "..:public_config_for_all" ]
configs = [ "..
/..
:public_config_for_all" ]
configs += [ ":libc_config" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
...
...
testsuites/unittest/libc/io/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,20 +26,32 @@
...
@@ -26,20 +26,32 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
io_include_dirs = [ "$TEST_UNITTEST_DIR/libc/io" ]
common_include_dirs = [
"//third_party/googletest/googletest/include",
"../../common/include",
]
sources_entry = [ "../../common/osTest.cpp" ]
sources_smoke = []
io_sources_entry = [ "$TEST_UNITTEST_DIR/libc/io/io_test.cpp"
]
sources_full = [
]
io_sources_smoke = [
libc_io_include_dirs = [ "$TEST_UNITTEST_DIR/libc/io" ]
libc_io_sources_entry = [ "$TEST_UNITTEST_DIR/libc/io/io_test.cpp" ]
libc_io_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_005.cpp",
"$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_005.cpp",
"$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_008.cpp",
"$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_008.cpp",
"$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_010.cpp",
"$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_010.cpp",
"$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_013.cpp",
"$TEST_UNITTEST_DIR/libc/io/smoke/IO_test_013.cpp",
]
]
io_sources_full = [
libc_
io_sources_full = [
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_confstr_001.cpp",
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_confstr_001.cpp",
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_dcgettext_001.cpp",
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_dcgettext_001.cpp",
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_dcgettext_002.cpp",
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_dcgettext_002.cpp",
...
@@ -82,3 +94,11 @@ io_sources_full = [
...
@@ -82,3 +94,11 @@ io_sources_full = [
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_epoll_001.cpp",
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_epoll_001.cpp",
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_epoll_002.cpp",
"$TEST_UNITTEST_DIR/libc/io/full/IO_test_epoll_002.cpp",
]
]
# libc io module
if (LOSCFG_USER_TEST_LIBC_IO == true) {
common_include_dirs += libc_io_include_dirs
sources_entry += libc_io_sources_entry
sources_smoke += libc_io_sources_smoke
sources_full += libc_io_sources_full
}
testsuites/unittest/libc/misc/BUILD.gn
0 → 100644
浏览文件 @
6c0b0dde
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
config("libc_config") {
if (LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
cflags = [ "-O1" ]
cflags_cc = cflags
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_libc_misc_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_libc_misc_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources += sources_full
configs = [ "../..:public_config_for_all" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
testsuites/unittest/libc/misc/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,13 +26,25 @@
...
@@ -26,13 +26,25 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
misc_include_dirs = [ "$TEST_UNITTEST_DIR/libc/misc" ]
common_include_dirs = [
"//third_party/googletest/googletest/include",
"../../common/include",
]
sources_entry = [ "../../common/osTest.cpp" ]
sources_smoke = []
misc_sources_entry = [ "$TEST_UNITTEST_DIR/libc/misc/misc_test.cpp"
]
sources_full = [
]
misc_sources_smoke = [
libc_misc_include_dirs = [ "$TEST_UNITTEST_DIR/libc/misc" ]
libc_misc_sources_entry = [ "$TEST_UNITTEST_DIR/libc/misc/misc_test.cpp" ]
libc_misc_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_002.cpp",
"$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_002.cpp",
"$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_003.cpp",
"$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_003.cpp",
...
@@ -41,7 +53,7 @@ misc_sources_smoke = [
...
@@ -41,7 +53,7 @@ misc_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_014.cpp",
"$TEST_UNITTEST_DIR/libc/misc/smoke/misc_test_014.cpp",
]
]
misc_sources_full = [
libc_
misc_sources_full = [
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_006.cpp",
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_006.cpp",
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_007.cpp",
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_007.cpp",
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_008.cpp",
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_008.cpp",
...
@@ -51,3 +63,11 @@ misc_sources_full = [
...
@@ -51,3 +63,11 @@ misc_sources_full = [
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_012.cpp",
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_012.cpp",
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_013.cpp",
"$TEST_UNITTEST_DIR/libc/misc/full/misc_test_013.cpp",
]
]
# libc misc module
if (LOSCFG_USER_TEST_LIBC_MISC == true) {
common_include_dirs += libc_misc_include_dirs
sources_entry += libc_misc_sources_entry
sources_smoke += libc_misc_sources_smoke
sources_full += libc_misc_sources_full
}
testsuites/unittest/libc/posix/BUILD.gn
0 → 100644
浏览文件 @
6c0b0dde
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
config("libc_config") {
if (LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
cflags = [ "-O1" ]
cflags_cc = cflags
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_libc_posix_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_libc_posix_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources += sources_full
configs = [ "../..:public_config_for_all" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
testsuites/unittest/libc/config.gni
→
testsuites/unittest/libc/
posix/
config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 202
2-2022
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -31,91 +31,38 @@ import("//kernel/liteos_a/testsuites/unittest/config.gni")
...
@@ -31,91 +31,38 @@ import("//kernel/liteos_a/testsuites/unittest/config.gni")
common_include_dirs = [
common_include_dirs = [
"//third_party/googletest/googletest/include",
"//third_party/googletest/googletest/include",
"../common/include",
"../
../
common/include",
]
]
sources_entry = [ "../common/osTest.cpp" ]
sources_entry = [ "../
../
common/osTest.cpp" ]
sources_smoke = []
sources_smoke = []
sources_full = []
sources_full = []
#
io
module
#
libc posix mem
module
if (LOSCFG_USER_TEST_
IO
== true) {
if (LOSCFG_USER_TEST_
LIBC_POSIX_MEM
== true) {
import("./
io
/config.gni")
import("./
mem
/config.gni")
common_include_dirs +=
io
_include_dirs
common_include_dirs +=
libc_posix_mem
_include_dirs
sources_entry +=
io
_sources_entry
sources_entry +=
libc_posix_mem
_sources_entry
sources_smoke +=
io
_sources_smoke
sources_smoke +=
libc_posix_mem
_sources_smoke
sources_full +=
io
_sources_full
sources_full +=
libc_posix_mem
_sources_full
}
}
#
misc
module
#
libc posix mqueue
module
if (LOSCFG_USER_TEST_
MISC
== true) {
if (LOSCFG_USER_TEST_
LIBC_POSIX_MQUEUE
== true) {
import("./m
isc
/config.gni")
import("./m
queue
/config.gni")
common_include_dirs +=
misc
_include_dirs
common_include_dirs +=
libc_posix_mqueue
_include_dirs
sources_entry +=
misc
_sources_entry
sources_entry +=
libc_posix_mqueue
_sources_entry
sources_smoke +=
misc
_sources_smoke
sources_smoke +=
libc_posix_mqueue
_sources_smoke
sources_full +=
misc
_sources_full
sources_full +=
libc_posix_mqueue
_sources_full
}
}
# posix mem module
# libc posix pthread module
if (LOSCFG_USER_TEST_POSIX_MEM == true) {
if (LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
import("./posix/mem/config.gni")
import("./pthread/config.gni")
common_include_dirs += posix_mem_include_dirs
common_include_dirs += libc_posix_pthread_include_dirs
sources_entry += posix_mem_sources_entry
sources_entry += libc_posix_pthread_sources_entry
sources_smoke += posix_mem_sources_smoke
sources_smoke += libc_posix_pthread_sources_smoke
sources_full += posix_mem_sources_full
sources_full += libc_posix_pthread_sources_full
}
# posix mqueue module
if (LOSCFG_USER_TEST_POSIX_MQUEUE == true) {
import("./posix/mqueue/config.gni")
common_include_dirs += posix_mqueue_include_dirs
sources_entry += posix_mqueue_sources_entry
sources_smoke += posix_mqueue_sources_smoke
sources_full += posix_mqueue_sources_full
}
# posix pthread module
if (LOSCFG_USER_TEST_POSIX_PTHREAD == true) {
import("./posix/pthread/config.gni")
common_include_dirs += posix_pthread_include_dirs
sources_entry += posix_pthread_sources_entry
sources_smoke += posix_pthread_sources_smoke
sources_full += posix_pthread_sources_full
}
# sys module
if (LOSCFG_USER_TEST_SYS == true) {
import("./sys/config.gni")
common_include_dirs += sys_include_dirs
sources_entry += sys_sources_entry
sources_smoke += sys_sources_smoke
sources_full += sys_sources_full
}
# time module
if (LOSCFG_USER_TEST_TIME_CLOCK == true) {
import("./time/clock/config.gni")
common_include_dirs += time_clock_include_dirs
sources_entry += time_clock_sources_entry
sources_smoke += time_clock_sources_smoke
sources_full += time_clock_sources_full
}
if (LOSCFG_USER_TEST_TIME_TIMER == true) {
import("./time/timer/config.gni")
common_include_dirs += time_timer_include_dirs
sources_entry += time_timer_sources_entry
sources_smoke += time_timer_sources_smoke
sources_full += time_timer_sources_full
}
# util module
if (LOSCFG_USER_TEST_UTIL == true) {
import("./util/config.gni")
common_include_dirs += util_include_dirs
sources_entry += util_sources_entry
sources_smoke += util_sources_smoke
sources_full += util_sources_full
}
}
testsuites/unittest/libc/posix/mem/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,16 +26,17 @@
...
@@ -26,16 +26,17 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
posix_mem_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/mem" ]
libc_
posix_mem_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/mem" ]
posix_mem_sources_entry =
libc_
posix_mem_sources_entry =
[ "$TEST_UNITTEST_DIR/libc/posix/mem/posix_mem_test.cpp" ]
[ "$TEST_UNITTEST_DIR/libc/posix/mem/posix_mem_test.cpp" ]
posix_mem_sources_smoke = [
libc_
posix_mem_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/posix/mem/smoke/It_posix_mem_001.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mem/smoke/It_posix_mem_001.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mem/smoke/It_posix_mem_003.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mem/smoke/It_posix_mem_003.cpp",
]
]
posix_mem_sources_full = []
libc_
posix_mem_sources_full = []
testsuites/unittest/libc/posix/mqueue/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,14 +26,15 @@
...
@@ -26,14 +26,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
posix_mqueue_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/mqueue" ]
libc_
posix_mqueue_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/mqueue" ]
posix_mqueue_sources_entry =
libc_
posix_mqueue_sources_entry =
[ "$TEST_UNITTEST_DIR/libc/posix/mqueue/posix_mqueue_test.cpp" ]
[ "$TEST_UNITTEST_DIR/libc/posix/mqueue/posix_mqueue_test.cpp" ]
posix_mqueue_sources_smoke = [
libc_
posix_mqueue_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_001.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_001.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_003.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_003.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_028.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_028.cpp",
...
@@ -41,7 +42,7 @@ posix_mqueue_sources_smoke = [
...
@@ -41,7 +42,7 @@ posix_mqueue_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_062.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/smoke/It_posix_queue_062.cpp",
]
]
posix_mqueue_sources_full = [
libc_
posix_mqueue_sources_full = [
"$TEST_UNITTEST_DIR/libc/posix/mqueue/full/It_posix_queue_002.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/full/It_posix_queue_002.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/full/It_posix_queue_005.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/full/It_posix_queue_005.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/full/It_posix_queue_008.cpp",
"$TEST_UNITTEST_DIR/libc/posix/mqueue/full/It_posix_queue_008.cpp",
...
...
testsuites/unittest/libc/posix/pthread/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,14 +26,15 @@
...
@@ -26,14 +26,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
posix_pthread_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/pthread" ]
libc_
posix_pthread_include_dirs = [ "$TEST_UNITTEST_DIR/libc/posix/pthread" ]
posix_pthread_sources_entry =
libc_
posix_pthread_sources_entry =
[ "$TEST_UNITTEST_DIR/libc/posix/pthread/posix_pthread_test.cpp" ]
[ "$TEST_UNITTEST_DIR/libc/posix/pthread/posix_pthread_test.cpp" ]
posix_pthread_sources_smoke = [
libc_
posix_pthread_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_003.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_003.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_004.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_004.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_005.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_005.cpp",
...
@@ -45,7 +46,7 @@ posix_pthread_sources_smoke = [
...
@@ -45,7 +46,7 @@ posix_pthread_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_022.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/smoke/It_posix_pthread_022.cpp",
]
]
posix_pthread_sources_full = [
libc_
posix_pthread_sources_full = [
"$TEST_UNITTEST_DIR/libc/posix/pthread/full/It_posix_pthread_001.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/full/It_posix_pthread_001.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/full/It_posix_pthread_002.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/full/It_posix_pthread_002.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/full/It_posix_pthread_007.cpp",
"$TEST_UNITTEST_DIR/libc/posix/pthread/full/It_posix_pthread_007.cpp",
...
...
testsuites/unittest/libc/sys/BUILD.gn
0 → 100644
浏览文件 @
6c0b0dde
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
config("libc_config") {
if (LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
cflags = [ "-O1" ]
cflags_cc = cflags
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_libc_sys_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_libc_sys_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources += sources_full
configs = [ "../..:public_config_for_all" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
testsuites/unittest/libc/sys/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,13 +26,25 @@
...
@@ -26,13 +26,25 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
sys_include_dirs = [ "$TEST_UNITTEST_DIR/libc/sys" ]
common_include_dirs = [
"//third_party/googletest/googletest/include",
"../../common/include",
]
sources_entry = [ "../../common/osTest.cpp" ]
sources_smoke = []
s
ys_sources_entry = [ "$TEST_UNITTEST_DIR/libc/sys/sys_unit_test.cpp"
]
s
ources_full = [
]
sys_sources_smoke = [
libc_sys_include_dirs = [ "$TEST_UNITTEST_DIR/libc/sys" ]
libc_sys_sources_entry = [ "$TEST_UNITTEST_DIR/libc/sys/sys_unit_test.cpp" ]
libc_sys_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_004.cpp",
"$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_004.cpp",
"$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_005.cpp",
"$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_005.cpp",
"$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_006.cpp",
"$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_006.cpp",
...
@@ -51,7 +63,7 @@ sys_sources_smoke = [
...
@@ -51,7 +63,7 @@ sys_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_031.cpp",
"$TEST_UNITTEST_DIR/libc/sys/smoke/sys_test_031.cpp",
]
]
sys_sources_full = [
libc_
sys_sources_full = [
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_018.cpp",
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_018.cpp",
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_019.cpp",
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_019.cpp",
...
@@ -65,3 +77,11 @@ sys_sources_full = [
...
@@ -65,3 +77,11 @@ sys_sources_full = [
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_027.cpp",
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_027.cpp",
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_028.cpp",
"$TEST_UNITTEST_DIR/libc/sys/full/sys_test_028.cpp",
]
]
# libc sys module
if (LOSCFG_USER_TEST_LIBC_SYS == true) {
common_include_dirs += libc_sys_include_dirs
sources_entry += libc_sys_sources_entry
sources_smoke += libc_sys_sources_smoke
sources_full += libc_sys_sources_full
}
testsuites/unittest/libc/time/BUILD.gn
0 → 100644
浏览文件 @
6c0b0dde
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
config("libc_config") {
if (LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
cflags = [ "-O1" ]
cflags_cc = cflags
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_libc_time_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_libc_time_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources += sources_full
configs = [ "../..:public_config_for_all" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
testsuites/unittest/libc/time/clock/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,17 +26,18 @@
...
@@ -26,17 +26,18 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
time_clock_include_dirs = [ "$TEST_UNITTEST_DIR/libc/time/clock" ]
libc_
time_clock_include_dirs = [ "$TEST_UNITTEST_DIR/libc/time/clock" ]
time_clock_sources_entry =
libc_
time_clock_sources_entry =
[ "$TEST_UNITTEST_DIR/libc/time/clock/time_clock_test.cpp" ]
[ "$TEST_UNITTEST_DIR/libc/time/clock/time_clock_test.cpp" ]
time_clock_sources_smoke =
libc_
time_clock_sources_smoke =
[ "$TEST_UNITTEST_DIR/libc/time/clock/smoke/clock_test_smoke.cpp" ]
[ "$TEST_UNITTEST_DIR/libc/time/clock/smoke/clock_test_smoke.cpp" ]
time_clock_sources_full = [
libc_
time_clock_sources_full = [
"$TEST_UNITTEST_DIR/libc/time/clock/full/clock_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/time/clock/full/clock_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/time/clock/full/clock_test_002.cpp",
"$TEST_UNITTEST_DIR/libc/time/clock/full/clock_test_002.cpp",
"$TEST_UNITTEST_DIR/libc/time/clock/full/clock_test_003.cpp",
"$TEST_UNITTEST_DIR/libc/time/clock/full/clock_test_003.cpp",
...
...
testsuites/unittest/
process/basic
/config.gni
→
testsuites/unittest/
libc/time
/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 202
2-2022
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -40,19 +40,20 @@ sources_smoke = []
...
@@ -40,19 +40,20 @@ sources_smoke = []
sources_full = []
sources_full = []
#
basic
module
#
libc time clock
module
if (LOSCFG_USER_TEST_
PROCESS
== true) {
if (LOSCFG_USER_TEST_
LIBC_TIME_CLOCK
== true) {
import("./
process
/config.gni")
import("./
clock
/config.gni")
common_include_dirs +=
process
_include_dirs
common_include_dirs +=
libc_time_clock
_include_dirs
sources_entry +=
process
_sources_entry
sources_entry +=
libc_time_clock
_sources_entry
sources_smoke +=
process
_sources_smoke
sources_smoke +=
libc_time_clock
_sources_smoke
sources_full +=
process
_sources_full
sources_full +=
libc_time_clock
_sources_full
}
}
if (LOSCFG_USER_TEST_PTHREAD == true) {
# libc time timer module
import("./pthread/config.gni")
if (LOSCFG_USER_TEST_LIBC_TIME_TIMER == true) {
common_include_dirs += pthread_include_dirs
import("./timer/config.gni")
sources_entry += pthread_sources_entry
common_include_dirs += libc_time_timer_include_dirs
sources_smoke += pthread_sources_smoke
sources_entry += libc_time_timer_sources_entry
sources_full += pthread_sources_full
sources_smoke += libc_time_timer_sources_smoke
sources_full += libc_time_timer_sources_full
}
}
testsuites/unittest/libc/time/timer/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,14 +26,15 @@
...
@@ -26,14 +26,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
time_timer_include_dirs = [ "$TEST_UNITTEST_DIR/libc/time/timer" ]
libc_
time_timer_include_dirs = [ "$TEST_UNITTEST_DIR/libc/time/timer" ]
time_timer_sources_entry =
libc_
time_timer_sources_entry =
[ "$TEST_UNITTEST_DIR/libc/time/timer/time_timer_test.cpp" ]
[ "$TEST_UNITTEST_DIR/libc/time/timer/time_timer_test.cpp" ]
time_timer_sources_smoke = [
libc_
time_timer_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_002.cpp",
"$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_002.cpp",
"$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_003.cpp",
"$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_003.cpp",
...
@@ -43,4 +44,4 @@ time_timer_sources_smoke = [
...
@@ -43,4 +44,4 @@ time_timer_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_tzset_002.cpp",
"$TEST_UNITTEST_DIR/libc/time/timer/smoke/timer_test_tzset_002.cpp",
]
]
time_timer_sources_full = []
libc_
time_timer_sources_full = []
testsuites/unittest/libc/util/BUILD.gn
0 → 100644
浏览文件 @
6c0b0dde
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
config("libc_config") {
if (LOSCFG_USER_TEST_LIBC_POSIX_MQUEUE == true ||
LOSCFG_USER_TEST_LIBC_POSIX_PTHREAD == true) {
cflags = [ "-O1" ]
cflags_cc = cflags
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_libc_util_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_libc_util_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources += sources_full
configs = [ "../..:public_config_for_all" ]
configs += [ ":libc_config" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
testsuites/unittest/libc/util/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,16 +26,28 @@
...
@@ -26,16 +26,28 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
util_include_dirs = [
common_include_dirs = [
"//third_party/googletest/googletest/include",
"../../common/include",
]
sources_entry = [ "../../common/osTest.cpp" ]
sources_smoke = []
sources_full = []
libc_util_include_dirs = [
"$TEST_UNITTEST_DIR/libc/util",
"$TEST_UNITTEST_DIR/libc/util",
"$TEST_UNITTEST_DIR/libc/misc",
"$TEST_UNITTEST_DIR/libc/misc",
]
]
util_sources_entry = [ "$TEST_UNITTEST_DIR/libc/util/util_test.cpp" ]
libc_
util_sources_entry = [ "$TEST_UNITTEST_DIR/libc/util/util_test.cpp" ]
util_sources_smoke = [
libc_
util_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/util/smoke/it_test_util_100.cpp",
"$TEST_UNITTEST_DIR/libc/util/smoke/it_test_util_100.cpp",
"$TEST_UNITTEST_DIR/libc/util/smoke/it_test_util_101.cpp",
"$TEST_UNITTEST_DIR/libc/util/smoke/it_test_util_101.cpp",
"$TEST_UNITTEST_DIR/libc/util/smoke/util_test_001.cpp",
"$TEST_UNITTEST_DIR/libc/util/smoke/util_test_001.cpp",
...
@@ -47,4 +59,12 @@ util_sources_smoke = [
...
@@ -47,4 +59,12 @@ util_sources_smoke = [
"$TEST_UNITTEST_DIR/libc/util/smoke/util_test_007.cpp",
"$TEST_UNITTEST_DIR/libc/util/smoke/util_test_007.cpp",
]
]
util_sources_full = []
libc_util_sources_full = []
# libc util module
if (LOSCFG_USER_TEST_LIBC_UTIL == true) {
common_include_dirs += libc_util_include_dirs
sources_entry += libc_util_sources_entry
sources_smoke += libc_util_sources_smoke
sources_full += libc_util_sources_full
}
testsuites/unittest/process/basic/BUILD.gn
→
testsuites/unittest/process/basic/
process/
BUILD.gn
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -31,7 +31,7 @@ import("//kernel/liteos_a/testsuites/unittest/config.gni")
...
@@ -31,7 +31,7 @@ import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
import("./config.gni")
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_process_basic_unittest_door") {
unittest("liteos_a_process_basic_
process_
unittest_door") {
output_extension = "bin"
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
include_dirs = common_include_dirs
...
@@ -39,20 +39,20 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
...
@@ -39,20 +39,20 @@ if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
sources += sources_smoke
sources += sources_smoke
sources_full = []
sources_full = []
sources += sources_full
sources += sources_full
configs = [ "../..:public_config_for_door" ]
configs = [ "../..
/..
:public_config_for_door" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_process_basic_unittest") {
unittest("liteos_a_process_basic_
process_
unittest") {
output_extension = "bin"
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
include_dirs = common_include_dirs
sources = sources_entry
sources = sources_entry
sources += sources_smoke
sources += sources_smoke
sources += sources_full
sources += sources_full
configs = [ "../..:public_config_for_all" ]
configs = [ "../..
/..
:public_config_for_all" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
}
}
testsuites/unittest/process/basic/process/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,14 +26,27 @@
...
@@ -26,14 +26,27 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
process_include_dirs = [ "$TEST_UNITTEST_DIR/process/basic/process" ]
common_include_dirs = [
"//third_party/googletest/googletest/include",
"../../../common/include",
]
sources_entry = [ "../../../common/osTest.cpp" ]
sources_smoke = []
process_sources_entry =
sources_full = []
process_basic_process_include_dirs =
[ "$TEST_UNITTEST_DIR/process/basic/process" ]
process_basic_process_sources_entry =
[ "$TEST_UNITTEST_DIR/process/basic/process/process_process_test.cpp" ]
[ "$TEST_UNITTEST_DIR/process/basic/process/process_process_test.cpp" ]
process_sources_smoke = [
process_
basic_process_
sources_smoke = [
"$TEST_UNITTEST_DIR/process/basic/process/smoke/process_test_001.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/smoke/process_test_001.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/smoke/process_test_002.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/smoke/process_test_002.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/smoke/process_test_004.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/smoke/process_test_004.cpp",
...
@@ -81,7 +94,7 @@ process_sources_smoke = [
...
@@ -81,7 +94,7 @@ process_sources_smoke = [
"$TEST_UNITTEST_DIR/process/basic/process/smp/process_test_smp_008.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/smp/process_test_smp_008.cpp",
]
]
process_sources_full = [
process_
basic_process_
sources_full = [
"$TEST_UNITTEST_DIR/process/basic/process/full/process_test_007.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/full/process_test_007.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/full/process_test_031.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/full/process_test_031.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/full/process_test_032.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/full/process_test_032.cpp",
...
@@ -112,3 +125,11 @@ process_sources_full = [
...
@@ -112,3 +125,11 @@ process_sources_full = [
"$TEST_UNITTEST_DIR/process/basic/process/full/process_test_053.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/full/process_test_053.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/full/process_test_062.cpp",
"$TEST_UNITTEST_DIR/process/basic/process/full/process_test_062.cpp",
]
]
# process basic process module
if (LOSCFG_USER_TEST_PROCESS_BASIC_PROCESS == true) {
common_include_dirs += process_basic_process_include_dirs
sources_entry += process_basic_process_sources_entry
sources_smoke += process_basic_process_sources_smoke
sources_full += process_basic_process_sources_full
}
testsuites/unittest/process/basic/pthread/BUILD.gn
0 → 100644
浏览文件 @
6c0b0dde
# Copyright (c) 2023 Huawei Device Co., Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other materials
# provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used
# to endorse or promote products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("./config.gni")
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_LOW) {
unittest("liteos_a_process_basic_pthread_unittest_door") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources_full = []
sources += sources_full
configs = [ "../../..:public_config_for_door" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
if (LOSCFG_USER_TEST_LEVEL >= TEST_LEVEL_MIDDLE) {
unittest("liteos_a_process_basic_pthread_unittest") {
output_extension = "bin"
output_dir = "$root_out_dir/test/unittest/kernel"
include_dirs = common_include_dirs
sources = sources_entry
sources += sources_smoke
sources += sources_full
configs = [ "../../..:public_config_for_all" ]
deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
}
}
testsuites/unittest/process/basic/pthread/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,14 +26,27 @@
...
@@ -26,14 +26,27 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
pthread_include_dirs = [ "$TEST_UNITTEST_DIR/process/basic/pthread" ]
common_include_dirs = [
"//third_party/googletest/googletest/include",
"../../../common/include",
]
sources_entry = [ "../../../common/osTest.cpp" ]
sources_smoke = []
pthread_sources_entry =
sources_full = []
process_basic_pthread_include_dirs =
[ "$TEST_UNITTEST_DIR/process/basic/pthread" ]
process_basic_pthread_sources_entry =
[ "$TEST_UNITTEST_DIR/process/basic/pthread/process_pthread_test.cpp" ]
[ "$TEST_UNITTEST_DIR/process/basic/pthread/process_pthread_test.cpp" ]
pthread_sources_smoke = [
p
rocess_basic_p
thread_sources_smoke = [
"$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_atfork_test_001.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_atfork_test_001.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_atfork_test_002.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_atfork_test_002.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_cond_test_001.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_cond_test_001.cpp",
...
@@ -65,10 +78,18 @@ pthread_sources_smoke = [
...
@@ -65,10 +78,18 @@ pthread_sources_smoke = [
"$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_027.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/smoke/pthread_test_027.cpp",
]
]
pthread_sources_full = [
p
rocess_basic_p
thread_sources_full = [
"$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_001.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_001.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_002.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_002.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_004.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_004.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_005.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_005.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_014.cpp",
"$TEST_UNITTEST_DIR/process/basic/pthread/full/pthread_test_014.cpp",
]
]
# process basic pthread module
if (LOSCFG_USER_TEST_PROCESS_BASIC_PTHREAD == true) {
common_include_dirs += process_basic_pthread_include_dirs
sources_entry += process_basic_pthread_sources_entry
sources_smoke += process_basic_pthread_sources_smoke
sources_full += process_basic_pthread_sources_full
}
testsuites/unittest/process/basic/pthread/smoke/pthread_test_020.cpp
浏览文件 @
6c0b0dde
...
@@ -35,9 +35,9 @@ static int ChildProcess(void)
...
@@ -35,9 +35,9 @@ static int ChildProcess(void)
volatile
unsigned
int
count
=
0
;
volatile
unsigned
int
count
=
0
;
struct
sched_param
currSchedParam
=
{
0
};
struct
sched_param
currSchedParam
=
{
0
};
struct
sched_param
param
=
{
struct
sched_param
param
=
{
.
sched_deadline
=
4000000
,
/* 4000000, 4
s */
.
sched_deadline
=
1000000
,
/* 1000000, 1
s */
.
sched_runtime
=
20000
0
,
/* 200000, 20
0ms */
.
sched_runtime
=
20000
,
/* 20000, 2
0ms */
.
sched_period
=
5000000
,
/* 5000000, 5
s */
.
sched_period
=
1000000
,
/* 1000000, 1
s */
};
};
ret
=
sched_getparam
(
getpid
(),
&
currSchedParam
);
ret
=
sched_getparam
(
getpid
(),
&
currSchedParam
);
...
@@ -58,23 +58,23 @@ static int ChildProcess(void)
...
@@ -58,23 +58,23 @@ static int ChildProcess(void)
ret
=
sched_getparam
(
getpid
(),
&
currSchedParam
);
ret
=
sched_getparam
(
getpid
(),
&
currSchedParam
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
4000000
,
LOS_NOK
);
/* 4000000, 4
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
0
,
LOS_NOK
);
/* 200000, 20
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
,
LOS_NOK
);
/* 20000, 2
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
5000000
,
LOS_NOK
);
/* 5000000, 5
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
printf
(
"--- 1 edf thread start --
-
\n\r
"
);
printf
(
"--- 1 edf thread start --
\n\r
"
);
do
{
do
{
for
(
volatile
int
i
=
0
;
i
<
10000
0
;
i
++
)
{
/* 10
0000, no special meaning */
for
(
volatile
int
i
=
0
;
i
<
10000
;
i
++
)
{
/* 1
0000, no special meaning */
for
(
volatile
int
j
=
0
;
j
<
10
;
j
++
)
{
/* 10
, no special meaning */
for
(
volatile
int
j
=
0
;
j
<
5
;
j
++
)
{
/* 5
, no special meaning */
int
tmp
=
i
-
j
;
int
tmp
=
i
-
j
;
}
}
}
}
if
(
count
%
20
==
0
)
{
/* 20
, no special meaning */
if
(
count
%
3
==
0
)
{
/* 3
, no special meaning */
printf
(
"--- 2 edf thread running --
-
\n\r
"
);
printf
(
"--- 2 edf thread running --
\n\r
"
);
}
}
count
++
;
count
++
;
}
while
(
count
<=
100
);
/* 100
, no special meaning */
}
while
(
count
<=
6
);
/* 6
, no special meaning */
printf
(
"--- 3 edf thread end --
-
\n\r
"
);
printf
(
"--- 3 edf thread end --
\n\r
"
);
return
0
;
return
0
;
}
}
...
...
testsuites/unittest/process/basic/pthread/smoke/pthread_test_021.cpp
浏览文件 @
6c0b0dde
...
@@ -40,9 +40,9 @@ static void *ThreadFuncTest(void *args)
...
@@ -40,9 +40,9 @@ static void *ThreadFuncTest(void *args)
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currPolicy
,
&
currSchedParam
);
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currPolicy
,
&
currSchedParam
);
ICUNIT_GOTO_EQUAL
(
ret
,
0
,
LOS_NOK
,
EXIT
);
ICUNIT_GOTO_EQUAL
(
ret
,
0
,
LOS_NOK
,
EXIT
);
ICUNIT_GOTO_EQUAL
(
currPolicy
,
SCHED_DEADLINE
,
LOS_NOK
,
EXIT
);
ICUNIT_GOTO_EQUAL
(
currPolicy
,
SCHED_DEADLINE
,
LOS_NOK
,
EXIT
);
ICUNIT_GOTO_EQUAL
(
currSchedParam
.
sched_deadline
,
3000000
,
LOS_NOK
,
EXIT
);
/* 3000000, 3
s */
ICUNIT_GOTO_EQUAL
(
currSchedParam
.
sched_deadline
,
1000000
,
LOS_NOK
,
EXIT
);
/* 1000000, 1
s */
ICUNIT_GOTO_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
0
,
LOS_NOK
,
EXIT
);
/* 200000, 20
0ms */
ICUNIT_GOTO_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
,
LOS_NOK
,
EXIT
);
/* 20000, 2
0ms */
ICUNIT_GOTO_EQUAL
(
currSchedParam
.
sched_period
,
5000000
,
LOS_NOK
,
EXIT
);
/* 5000000, 5
s */
ICUNIT_GOTO_EQUAL
(
currSchedParam
.
sched_period
,
1000000
,
LOS_NOK
,
EXIT
);
/* 1000000, 1
s */
printf
(
"--- 1 edf Tid[%d] PTid[%d] thread start ---
\n\r
"
,
currTID
,
pt
);
printf
(
"--- 1 edf Tid[%d] PTid[%d] thread start ---
\n\r
"
,
currTID
,
pt
);
do
{
do
{
...
@@ -51,11 +51,11 @@ static void *ThreadFuncTest(void *args)
...
@@ -51,11 +51,11 @@ static void *ThreadFuncTest(void *args)
volatile
int
tmp
=
i
-
j
;
volatile
int
tmp
=
i
-
j
;
}
}
}
}
if
(
count
%
20
==
0
)
{
/* 20
, no special meaning */
if
(
count
%
3
==
0
)
{
/* 3
, no special meaning */
printf
(
"--- 2 edf Tid[%d] PTid[%d] thread running ---
\n\r
"
,
currTID
,
pt
);
printf
(
"--- 2 edf Tid[%d] PTid[%d] thread running ---
\n\r
"
,
currTID
,
pt
);
}
}
count
++
;
count
++
;
}
while
(
count
<=
100
);
/* 100
, no special meaning */
}
while
(
count
<=
6
);
/* 6
, no special meaning */
printf
(
"--- 3 edf Tid[%d] PTid[%d] thread end ---
\n\r
"
,
currTID
,
pt
);
printf
(
"--- 3 edf Tid[%d] PTid[%d] thread end ---
\n\r
"
,
currTID
,
pt
);
ret
=
LOS_OK
;
ret
=
LOS_OK
;
...
@@ -74,9 +74,9 @@ static int ChildProcess(void)
...
@@ -74,9 +74,9 @@ static int ChildProcess(void)
struct
sched_param
currSchedParam
=
{
0
};
struct
sched_param
currSchedParam
=
{
0
};
int
currTID
=
Syscall
(
SYS_gettid
,
0
,
0
,
0
,
0
);
int
currTID
=
Syscall
(
SYS_gettid
,
0
,
0
,
0
,
0
);
struct
sched_param
param
=
{
struct
sched_param
param
=
{
.
sched_deadline
=
3000000
,
/* 3000000, 3
s */
.
sched_deadline
=
1000000
,
/* 1000000, 1
s */
.
sched_runtime
=
20000
0
,
/* 200000, 20
0ms */
.
sched_runtime
=
20000
,
/* 20000, 2
0ms */
.
sched_period
=
5000000
,
/* 5000000, 5
s */
.
sched_period
=
1000000
,
/* 1000000, 1
s */
};
};
ret
=
sched_setscheduler
(
getpid
(),
SCHED_DEADLINE
,
&
param
);
ret
=
sched_setscheduler
(
getpid
(),
SCHED_DEADLINE
,
&
param
);
...
@@ -85,25 +85,25 @@ static int ChildProcess(void)
...
@@ -85,25 +85,25 @@ static int ChildProcess(void)
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currPolicy
,
&
currSchedParam
);
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currPolicy
,
&
currSchedParam
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
currPolicy
,
SCHED_DEADLINE
,
LOS_NOK
);
ICUNIT_ASSERT_EQUAL
(
currPolicy
,
SCHED_DEADLINE
,
LOS_NOK
);
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
3000000
,
LOS_NOK
);
/* 3000000, 3
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
0
,
LOS_NOK
);
/* 200000, 20
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
,
LOS_NOK
);
/* 20000, 2
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
5000000
,
LOS_NOK
);
/* 5000000, 5
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
ret
=
pthread_create
(
&
newUserThread
,
NULL
,
ThreadFuncTest
,
(
void
*
)
currTID
);
ret
=
pthread_create
(
&
newUserThread
,
NULL
,
ThreadFuncTest
,
(
void
*
)
currTID
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
printf
(
"--- 1 edf Tid[%d] thread start ---
\n\r
"
,
currTID
);
printf
(
"--- 1 edf Tid[%d] thread start ---
\n\r
"
,
currTID
);
do
{
do
{
for
(
volatile
int
i
=
0
;
i
<
10000
0
;
i
++
)
{
/* 10
0000, no special meaning */
for
(
volatile
int
i
=
0
;
i
<
10000
;
i
++
)
{
/* 1
0000, no special meaning */
for
(
volatile
int
j
=
0
;
j
<
5
;
j
++
)
{
/* 5, no special meaning */
for
(
volatile
int
j
=
0
;
j
<
5
;
j
++
)
{
/* 5, no special meaning */
int
tmp
=
i
-
j
;
int
tmp
=
i
-
j
;
}
}
}
}
if
(
count
%
20
==
0
)
{
/* 20
, no special meaning */
if
(
count
%
3
==
0
)
{
/* 3
, no special meaning */
printf
(
"--- 2 edf Tid[%d] thread running ---
\n\r
"
,
currTID
);
printf
(
"--- 2 edf Tid[%d] thread running ---
\n\r
"
,
currTID
);
}
}
count
++
;
count
++
;
}
while
(
count
<=
100
);
/* 100
, no special meaning */
}
while
(
count
<=
6
);
/* 6
, no special meaning */
printf
(
"--- 3 edf Tid[%d] thread end ---
\n\r
"
,
currTID
);
printf
(
"--- 3 edf Tid[%d] thread end ---
\n\r
"
,
currTID
);
ret
=
pthread_join
(
newUserThread
,
(
void
**
)
&
childThreadRetval
);
ret
=
pthread_join
(
newUserThread
,
(
void
**
)
&
childThreadRetval
);
...
...
testsuites/unittest/process/basic/pthread/smoke/pthread_test_022.cpp
浏览文件 @
6c0b0dde
...
@@ -40,22 +40,22 @@ static int EdfProcess(void)
...
@@ -40,22 +40,22 @@ static int EdfProcess(void)
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currPolicy
,
&
currSchedParam
);
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currPolicy
,
&
currSchedParam
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
currPolicy
,
SCHED_DEADLINE
,
LOS_NOK
);
ICUNIT_ASSERT_EQUAL
(
currPolicy
,
SCHED_DEADLINE
,
LOS_NOK
);
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
3000000
,
LOS_NOK
);
/* 3000000, 3
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
0
,
LOS_NOK
);
/* 200000, 20
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
,
LOS_NOK
);
/* 20000, 2
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
5000000
,
LOS_NOK
);
/* 5000000, 5
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
printf
(
"--- edf2 -- 1 -- Tid[%d] thread start ---
\n\r
"
,
currTID
);
printf
(
"--- edf2 -- 1 -- Tid[%d] thread start ---
\n\r
"
,
currTID
);
do
{
do
{
for
(
volatile
int
i
=
0
;
i
<
10000
0
;
i
++
)
{
/* 10
0000, no special meaning */
for
(
volatile
int
i
=
0
;
i
<
10000
;
i
++
)
{
/* 1
0000, no special meaning */
for
(
volatile
int
j
=
0
;
j
<
5
;
j
++
)
{
/* 5, no special meaning */
for
(
volatile
int
j
=
0
;
j
<
5
;
j
++
)
{
/* 5, no special meaning */
int
tmp
=
i
-
j
;
int
tmp
=
i
-
j
;
}
}
}
}
if
(
count
%
20
==
0
)
{
/* 20
, no special meaning */
if
(
count
%
3
==
0
)
{
/* 3
, no special meaning */
printf
(
"--- edf2 -- 2 -- Tid[%d] thread running ---
\n\r
"
,
currTID
);
printf
(
"--- edf2 -- 2 -- Tid[%d] thread running ---
\n\r
"
,
currTID
);
}
}
count
++
;
count
++
;
}
while
(
count
<=
100
);
/* 100
, no special meaning */
}
while
(
count
<=
6
);
/* 6
, no special meaning */
printf
(
"--- edf2 -- 3 -- Tid[%d] thread end ---
\n\r
"
,
currTID
);
printf
(
"--- edf2 -- 3 -- Tid[%d] thread end ---
\n\r
"
,
currTID
);
return
0
;
return
0
;
...
@@ -71,9 +71,9 @@ static int ChildProcess(void)
...
@@ -71,9 +71,9 @@ static int ChildProcess(void)
struct
sched_param
currSchedParam
=
{
0
};
struct
sched_param
currSchedParam
=
{
0
};
int
currTID
=
Syscall
(
SYS_gettid
,
0
,
0
,
0
,
0
);
int
currTID
=
Syscall
(
SYS_gettid
,
0
,
0
,
0
,
0
);
struct
sched_param
param
=
{
struct
sched_param
param
=
{
.
sched_deadline
=
3000000
,
/* 3000000, 3
s */
.
sched_deadline
=
1000000
,
/* 1000000, 1
s */
.
sched_runtime
=
20000
0
,
/* 200000, 20
0ms */
.
sched_runtime
=
20000
,
/* 20000, 2
0ms */
.
sched_period
=
5000000
,
/* 5000000, 5
s */
.
sched_period
=
1000000
,
/* 1000000, 1
s */
};
};
ret
=
sched_setscheduler
(
getpid
(),
SCHED_DEADLINE
,
&
param
);
ret
=
sched_setscheduler
(
getpid
(),
SCHED_DEADLINE
,
&
param
);
...
@@ -82,9 +82,9 @@ static int ChildProcess(void)
...
@@ -82,9 +82,9 @@ static int ChildProcess(void)
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currPolicy
,
&
currSchedParam
);
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currPolicy
,
&
currSchedParam
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
currPolicy
,
SCHED_DEADLINE
,
LOS_NOK
);
ICUNIT_ASSERT_EQUAL
(
currPolicy
,
SCHED_DEADLINE
,
LOS_NOK
);
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
3000000
,
LOS_NOK
);
/* 3000000, 3
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
0
,
LOS_NOK
);
/* 200000, 20
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
,
LOS_NOK
);
/* 20000, 2
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
5000000
,
LOS_NOK
);
/* 5000000, 5
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
pid
=
fork
();
pid
=
fork
();
if
(
pid
==
0
)
{
if
(
pid
==
0
)
{
...
@@ -96,14 +96,14 @@ static int ChildProcess(void)
...
@@ -96,14 +96,14 @@ static int ChildProcess(void)
}
else
if
(
pid
>
0
)
{
}
else
if
(
pid
>
0
)
{
printf
(
"--- edf1 -- 1 -- Tid[%d] thread start ---
\n\r
"
,
currTID
);
printf
(
"--- edf1 -- 1 -- Tid[%d] thread start ---
\n\r
"
,
currTID
);
do
{
do
{
for
(
volatile
int
i
=
0
;
i
<
50000
0
;
i
++
)
{
/* 50
0000, no special meaning */
for
(
volatile
int
i
=
0
;
i
<
50000
;
i
++
)
{
/* 5
0000, no special meaning */
int
tmp
=
i
+
1
;
int
tmp
=
i
+
1
;
}
}
if
(
count
%
20
==
0
)
{
/* 20
, no special meaning */
if
(
count
%
5
==
0
)
{
/* 5
, no special meaning */
printf
(
"--- edf1 -- 2 -- Tid[%d] thread running ---
\n\r
"
,
currTID
);
printf
(
"--- edf1 -- 2 -- Tid[%d] thread running ---
\n\r
"
,
currTID
);
}
}
count
++
;
count
++
;
}
while
(
count
<=
10
0
);
/* 10
0, no special meaning */
}
while
(
count
<=
10
);
/* 1
0, no special meaning */
printf
(
"--- edf1 -- 3 -- Tid[%d] thread end ---
\n\r
"
,
currTID
);
printf
(
"--- edf1 -- 3 -- Tid[%d] thread end ---
\n\r
"
,
currTID
);
waitpid
(
pid
,
&
status
,
0
);
waitpid
(
pid
,
&
status
,
0
);
}
else
{
}
else
{
...
...
testsuites/unittest/process/basic/pthread/smoke/pthread_test_023.cpp
浏览文件 @
6c0b0dde
...
@@ -46,9 +46,9 @@ static int ChildProcess(void)
...
@@ -46,9 +46,9 @@ static int ChildProcess(void)
struct
sched_param
currSchedParam
=
{
0
};
struct
sched_param
currSchedParam
=
{
0
};
int
currTID
=
Syscall
(
SYS_gettid
,
0
,
0
,
0
,
0
);
int
currTID
=
Syscall
(
SYS_gettid
,
0
,
0
,
0
,
0
);
struct
sched_param
param
=
{
struct
sched_param
param
=
{
.
sched_deadline
=
3000000
,
/* 3000000, 3
s */
.
sched_deadline
=
1000000
,
/* 1000000, 1
s */
.
sched_runtime
=
20000
0
,
/* 200000, 20
0ms */
.
sched_runtime
=
20000
,
/* 20000, 2
0ms */
.
sched_period
=
5000000
,
/* 5000000, 5
s */
.
sched_period
=
1000000
,
/* 1000000, 1
s */
};
};
ret
=
pthread_getschedparam
(
pthread_self
(),
&
oldPolicy
,
&
hpfparam
);
ret
=
pthread_getschedparam
(
pthread_self
(),
&
oldPolicy
,
&
hpfparam
);
...
@@ -60,9 +60,9 @@ static int ChildProcess(void)
...
@@ -60,9 +60,9 @@ static int ChildProcess(void)
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currPolicy
,
&
currSchedParam
);
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currPolicy
,
&
currSchedParam
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
currPolicy
,
SCHED_DEADLINE
,
LOS_NOK
);
ICUNIT_ASSERT_EQUAL
(
currPolicy
,
SCHED_DEADLINE
,
LOS_NOK
);
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
3000000
,
LOS_NOK
);
/* 3000000, 3
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
0
,
LOS_NOK
);
/* 200000, 20
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
,
LOS_NOK
);
/* 20000, 2
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
5000000
,
LOS_NOK
);
/* 5000000, 5
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
ret
=
pthread_attr_init
(
&
a
);
ret
=
pthread_attr_init
(
&
a
);
pthread_attr_setschedpolicy
(
&
a
,
SCHED_RR
);
pthread_attr_setschedpolicy
(
&
a
,
SCHED_RR
);
...
...
testsuites/unittest/process/basic/pthread/smoke/pthread_test_024.cpp
浏览文件 @
6c0b0dde
...
@@ -45,9 +45,9 @@ static int ChildProcess(void)
...
@@ -45,9 +45,9 @@ static int ChildProcess(void)
volatile
unsigned
int
count
=
0
;
volatile
unsigned
int
count
=
0
;
int
currTID
=
Syscall
(
SYS_gettid
,
0
,
0
,
0
,
0
);
int
currTID
=
Syscall
(
SYS_gettid
,
0
,
0
,
0
,
0
);
struct
sched_param
param
=
{
struct
sched_param
param
=
{
.
sched_deadline
=
3000000
,
/* 3000000, 3
s */
.
sched_deadline
=
1000000
,
/* 1000000, 1
s */
.
sched_runtime
=
20000
0
,
/* 200000, 20
0ms */
.
sched_runtime
=
20000
,
/* 20000, 2
0ms */
.
sched_period
=
5000000
,
/* 5000000, 5
s */
.
sched_period
=
1000000
,
/* 1000000, 1
s */
};
};
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currThreadPolicy
,
&
hpfparam
);
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currThreadPolicy
,
&
hpfparam
);
...
...
testsuites/unittest/process/basic/pthread/smoke/pthread_test_025.cpp
浏览文件 @
6c0b0dde
...
@@ -49,9 +49,9 @@ static int ChildProcess(void)
...
@@ -49,9 +49,9 @@ static int ChildProcess(void)
struct
sched_param
currSchedParam
=
{
0
};
struct
sched_param
currSchedParam
=
{
0
};
int
currTID
=
Syscall
(
SYS_gettid
,
0
,
0
,
0
,
0
);
int
currTID
=
Syscall
(
SYS_gettid
,
0
,
0
,
0
,
0
);
struct
sched_param
param
=
{
struct
sched_param
param
=
{
.
sched_deadline
=
3000000
,
/* 3000000, 3
s */
.
sched_deadline
=
1000000
,
/* 1000000, 1
s */
.
sched_runtime
=
20000
0
,
/* 200000, 20
0ms */
.
sched_runtime
=
20000
,
/* 20000, 2
0ms */
.
sched_period
=
5000000
,
/* 5000000, 5
s */
.
sched_period
=
1000000
,
/* 1000000, 1
s */
};
};
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currThreadPolicy
,
&
hpfparam
);
ret
=
pthread_getschedparam
(
pthread_self
(),
&
currThreadPolicy
,
&
hpfparam
);
...
...
testsuites/unittest/process/basic/pthread/smoke/pthread_test_026.cpp
浏览文件 @
6c0b0dde
...
@@ -36,9 +36,9 @@ static int ChildProcess(void)
...
@@ -36,9 +36,9 @@ static int ChildProcess(void)
volatile
unsigned
int
count
=
0
;
volatile
unsigned
int
count
=
0
;
struct
sched_param
currSchedParam
=
{
0
};
struct
sched_param
currSchedParam
=
{
0
};
struct
sched_param
param
=
{
struct
sched_param
param
=
{
.
sched_deadline
=
4000000
,
/* 4000000, 4
s */
.
sched_deadline
=
1000000
,
/* 1000000, 1
s */
.
sched_runtime
=
20000
0
,
/* 200000, 20
0ms */
.
sched_runtime
=
20000
,
/* 20000, 2
0ms */
.
sched_period
=
5000000
,
/* 5000000, 5
s */
.
sched_period
=
1000000
,
/* 1000000, 1
s */
};
};
ret
=
sched_getparam
(
getpid
(),
&
currSchedParam
);
ret
=
sched_getparam
(
getpid
(),
&
currSchedParam
);
...
@@ -59,22 +59,22 @@ static int ChildProcess(void)
...
@@ -59,22 +59,22 @@ static int ChildProcess(void)
ret
=
sched_getparam
(
getpid
(),
&
currSchedParam
);
ret
=
sched_getparam
(
getpid
(),
&
currSchedParam
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
4000000
,
LOS_NOK
);
/* 4000000, 4
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
0
,
LOS_NOK
);
/* 200000, 20
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
,
LOS_NOK
);
/* 20000, 2
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
5000000
,
LOS_NOK
);
/* 5000000, 5
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
printf
(
"--- 1 edf thread start ---
\n\r
"
);
printf
(
"--- 1 edf thread start ---
\n\r
"
);
do
{
do
{
for
(
volatile
int
i
=
0
;
i
<
10000
0
;
i
++
)
{
/* 10
0000, no special meaning */
for
(
volatile
int
i
=
0
;
i
<
10000
;
i
++
)
{
/* 1
0000, no special meaning */
for
(
volatile
int
j
=
0
;
j
<
10
;
j
++
)
{
/* 10
, no special meaning */
for
(
volatile
int
j
=
0
;
j
<
5
;
j
++
)
{
/* 5
, no special meaning */
int
tmp
=
i
-
j
;
int
tmp
=
i
-
j
;
}
}
}
}
if
(
count
%
20
==
0
)
{
/* 20
, no special meaning */
if
(
count
%
3
==
0
)
{
/* 3
, no special meaning */
printf
(
"--- 2 edf thread running ---
\n\r
"
);
printf
(
"--- 2 edf thread running ---
\n\r
"
);
}
}
count
++
;
count
++
;
}
while
(
count
<=
100
);
/* 100
, no special meaning */
}
while
(
count
<=
6
);
/* 6
, no special meaning */
printf
(
"--- 3 edf thread end ---
\n\r
"
);
printf
(
"--- 3 edf thread end ---
\n\r
"
);
return
0
;
return
0
;
...
...
testsuites/unittest/process/basic/pthread/smoke/pthread_test_027.cpp
浏览文件 @
6c0b0dde
...
@@ -36,9 +36,9 @@ static int ChildProcess(void)
...
@@ -36,9 +36,9 @@ static int ChildProcess(void)
volatile
unsigned
int
count
=
0
;
volatile
unsigned
int
count
=
0
;
struct
sched_param
currSchedParam
=
{
0
};
struct
sched_param
currSchedParam
=
{
0
};
struct
sched_param
param
=
{
struct
sched_param
param
=
{
.
sched_deadline
=
4000000
,
/* 4000000, 4
s */
.
sched_deadline
=
1000000
,
/* 1000000, 1
s */
.
sched_runtime
=
20000
0
,
/* 200000, 20
0ms */
.
sched_runtime
=
20000
,
/* 20000, 2
0ms */
.
sched_period
=
5000000
,
/* 5000000, 5
s */
.
sched_period
=
1000000
,
/* 1000000, 1
s */
};
};
ret
=
sched_getparam
(
getpid
(),
&
currSchedParam
);
ret
=
sched_getparam
(
getpid
(),
&
currSchedParam
);
...
@@ -59,9 +59,9 @@ static int ChildProcess(void)
...
@@ -59,9 +59,9 @@ static int ChildProcess(void)
ret
=
sched_getparam
(
getpid
(),
&
currSchedParam
);
ret
=
sched_getparam
(
getpid
(),
&
currSchedParam
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
ret
,
0
,
ret
);
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
4000000
,
LOS_NOK
);
/* 4000000, 4
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_deadline
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
0
,
LOS_NOK
);
/* 200000, 20
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_runtime
,
20000
,
LOS_NOK
);
/* 20000, 2
0ms */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
5000000
,
LOS_NOK
);
/* 5000000, 5
s */
ICUNIT_ASSERT_EQUAL
(
currSchedParam
.
sched_period
,
1000000
,
LOS_NOK
);
/* 1000000, 1
s */
return
0
;
return
0
;
}
}
...
...
testsuites/unittest/process/lock/BUILD.gn
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
...
testsuites/unittest/process/lock/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 202
2-2022
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -40,27 +40,29 @@ sources_smoke = []
...
@@ -40,27 +40,29 @@ sources_smoke = []
sources_full = []
sources_full = []
#
lock
module
#
process lock mutex
module
if (LOSCFG_USER_TEST_MUTEX == true) {
if (LOSCFG_USER_TEST_
PROCESS_LOCK_
MUTEX == true) {
import("./mutex/config.gni")
import("./mutex/config.gni")
common_include_dirs += mutex_include_dirs
common_include_dirs +=
process_lock_
mutex_include_dirs
sources_entry += mutex_sources_entry
sources_entry +=
process_lock_
mutex_sources_entry
sources_smoke += mutex_sources_smoke
sources_smoke +=
process_lock_
mutex_sources_smoke
sources_full += mutex_sources_full
sources_full +=
process_lock_
mutex_sources_full
}
}
if (LOSCFG_USER_TEST_RWLOCK == true) {
# process lock rwlock module
if (LOSCFG_USER_TEST_PROCESS_LOCK_RWLOCK == true) {
import("./rwlock/config.gni")
import("./rwlock/config.gni")
common_include_dirs += rwlock_include_dirs
common_include_dirs +=
process_lock_
rwlock_include_dirs
sources_entry += rwlock_sources_entry
sources_entry +=
process_lock_
rwlock_sources_entry
sources_smoke += rwlock_sources_smoke
sources_smoke +=
process_lock_
rwlock_sources_smoke
sources_full += rwlock_sources_full
sources_full +=
process_lock_
rwlock_sources_full
}
}
if (LOSCFG_USER_TEST_SPINLOCK == true) {
# process lock spinlock module
if (LOSCFG_USER_TEST_PROCESS_LOCK_SPINLOCK == true) {
import("./spinlock/config.gni")
import("./spinlock/config.gni")
common_include_dirs += spinlock_include_dirs
common_include_dirs +=
process_lock_
spinlock_include_dirs
sources_entry += spinlock_sources_entry
sources_entry +=
process_lock_
spinlock_sources_entry
sources_smoke += spinlock_sources_smoke
sources_smoke +=
process_lock_
spinlock_sources_smoke
sources_full += spinlock_sources_full
sources_full +=
process_lock_
spinlock_sources_full
}
}
testsuites/unittest/process/lock/mutex/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,14 +26,15 @@
...
@@ -26,14 +26,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
mutex_include_dirs = [ "$TEST_UNITTEST_DIR/process/lock/mutex" ]
process_lock_
mutex_include_dirs = [ "$TEST_UNITTEST_DIR/process/lock/mutex" ]
mutex_sources_entry =
process_lock_
mutex_sources_entry =
[ "$TEST_UNITTEST_DIR/process/lock/mutex/process_mutex_test.cpp" ]
[ "$TEST_UNITTEST_DIR/process/lock/mutex/process_mutex_test.cpp" ]
mutex_sources_smoke = [
process_lock_
mutex_sources_smoke = [
"$TEST_UNITTEST_DIR/process/lock/mutex/smoke/pthread_mutex_test_001.cpp",
"$TEST_UNITTEST_DIR/process/lock/mutex/smoke/pthread_mutex_test_001.cpp",
"$TEST_UNITTEST_DIR/process/lock/mutex/smoke/pthread_mutex_test_002.cpp",
"$TEST_UNITTEST_DIR/process/lock/mutex/smoke/pthread_mutex_test_002.cpp",
"$TEST_UNITTEST_DIR/process/lock/mutex/smoke/pthread_mutex_test_003.cpp",
"$TEST_UNITTEST_DIR/process/lock/mutex/smoke/pthread_mutex_test_003.cpp",
...
@@ -57,7 +58,7 @@ mutex_sources_smoke = [
...
@@ -57,7 +58,7 @@ mutex_sources_smoke = [
"$TEST_UNITTEST_DIR/process/lock/mutex/smoke/pthread_mutex_test_022.cpp",
"$TEST_UNITTEST_DIR/process/lock/mutex/smoke/pthread_mutex_test_022.cpp",
]
]
mutex_sources_full = [
process_lock_
mutex_sources_full = [
"$TEST_UNITTEST_DIR/process/lock/mutex/full/pthread_mutex_test_018.cpp",
"$TEST_UNITTEST_DIR/process/lock/mutex/full/pthread_mutex_test_018.cpp",
"$TEST_UNITTEST_DIR/process/lock/mutex/full/pthread_mutex_test_023.cpp",
"$TEST_UNITTEST_DIR/process/lock/mutex/full/pthread_mutex_test_023.cpp",
"$TEST_UNITTEST_DIR/process/lock/mutex/full/pthread_mutex_test_024.cpp",
"$TEST_UNITTEST_DIR/process/lock/mutex/full/pthread_mutex_test_024.cpp",
...
...
testsuites/unittest/process/lock/rwlock/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,17 +26,18 @@
...
@@ -26,17 +26,18 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
rwlock_include_dirs = [ "$TEST_UNITTEST_DIR/process/lock/rwlock" ]
process_lock_
rwlock_include_dirs = [ "$TEST_UNITTEST_DIR/process/lock/rwlock" ]
rwlock_sources_entry =
process_lock_
rwlock_sources_entry =
[ "$TEST_UNITTEST_DIR/process/lock/rwlock/process_rwlock_test.cpp" ]
[ "$TEST_UNITTEST_DIR/process/lock/rwlock/process_rwlock_test.cpp" ]
rwlock_sources_smoke = [
process_lock_
rwlock_sources_smoke = [
"$TEST_UNITTEST_DIR/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp",
"$TEST_UNITTEST_DIR/process/lock/rwlock/smoke/pthread_rwlock_test_001.cpp",
]
]
rwlock_sources_full = [
process_lock_
rwlock_sources_full = [
"$TEST_UNITTEST_DIR/process/lock/rwlock/full/pthread_rwlock_test_002.cpp",
"$TEST_UNITTEST_DIR/process/lock/rwlock/full/pthread_rwlock_test_002.cpp",
]
]
testsuites/unittest/process/lock/spinlock/config.gni
浏览文件 @
6c0b0dde
# Copyright (c) 2022-202
2
Huawei Device Co., Ltd. All rights reserved.
# Copyright (c) 2022-202
3
Huawei Device Co., Ltd. All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without modification,
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# are permitted provided that the following conditions are met:
...
@@ -26,13 +26,15 @@
...
@@ -26,13 +26,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import("//build/lite/config/test.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
import("//kernel/liteos_a/testsuites/unittest/config.gni")
spinlock_include_dirs = [ "$TEST_UNITTEST_DIR/process/lock/spinlock" ]
process_lock_spinlock_include_dirs =
[ "$TEST_UNITTEST_DIR/process/lock/spinlock" ]
spinlock_sources_entry =
process_lock_
spinlock_sources_entry =
[ "$TEST_UNITTEST_DIR/process/lock/spinlock/process_spinlock_test.cpp" ]
[ "$TEST_UNITTEST_DIR/process/lock/spinlock/process_spinlock_test.cpp" ]
spinlock_sources_smoke = [ "$TEST_UNITTEST_DIR/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp" ]
process_lock_
spinlock_sources_smoke = [ "$TEST_UNITTEST_DIR/process/lock/spinlock/smoke/pthread_spinlock_test_001.cpp" ]
spinlock_sources_full = []
process_lock_
spinlock_sources_full = []
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录