Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos M
提交
e5179be5
K
Kernel Liteos M
项目概览
OpenHarmony
/
Kernel Liteos M
大约 1 年 前同步成功
通知
20
Star
28
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos M
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e5179be5
编写于
7月 01, 2021
作者:
O
openharmony_ci
提交者:
Gitee
7月 01, 2021
浏览文件
操作
浏览文件
下载
差异文件
!208 feat: L0 测试用例支持risc-v qemu 编译运行
Merge pull request !208 from zhushengle/test
上级
c56f5bc7
2dd6c080
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
130 addition
and
104 deletion
+130
-104
testsuits/BUILD.gn
testsuits/BUILD.gn
+1
-1
testsuits/include/osTest.h
testsuits/include/osTest.h
+9
-5
testsuits/sample/kernel/event/It_los_event.c
testsuits/sample/kernel/event/It_los_event.c
+6
-0
testsuits/sample/kernel/event/It_los_event_034.c
testsuits/sample/kernel/event/It_los_event_034.c
+1
-1
testsuits/sample/kernel/hwi/it_los_hwi.h
testsuits/sample/kernel/hwi/it_los_hwi.h
+1
-1
testsuits/sample/kernel/hwi/it_los_hwi_005.c
testsuits/sample/kernel/hwi/it_los_hwi_005.c
+1
-1
testsuits/sample/kernel/hwi/it_los_hwi_013.c
testsuits/sample/kernel/hwi/it_los_hwi_013.c
+2
-2
testsuits/sample/kernel/hwi/it_los_hwi_032.c
testsuits/sample/kernel/hwi/it_los_hwi_032.c
+1
-1
testsuits/sample/kernel/mem/It_los_tick_001.c
testsuits/sample/kernel/mem/It_los_tick_001.c
+3
-1
testsuits/sample/kernel/mux/BUILD.gn
testsuits/sample/kernel/mux/BUILD.gn
+7
-0
testsuits/sample/kernel/mux/It_los_mux.c
testsuits/sample/kernel/mux/It_los_mux.c
+7
-1
testsuits/sample/kernel/queue/It_los_queue.c
testsuits/sample/kernel/queue/It_los_queue.c
+4
-0
testsuits/sample/kernel/sem/It_los_sem.c
testsuits/sample/kernel/sem/It_los_sem.c
+6
-0
testsuits/sample/kernel/swtmr/BUILD.gn
testsuits/sample/kernel/swtmr/BUILD.gn
+14
-16
testsuits/sample/kernel/swtmr/It_los_swtmr.c
testsuits/sample/kernel/swtmr/It_los_swtmr.c
+18
-1
testsuits/sample/kernel/swtmr/It_los_swtmr_001.c
testsuits/sample/kernel/swtmr/It_los_swtmr_001.c
+3
-28
testsuits/sample/kernel/swtmr/It_los_swtmr_022.c
testsuits/sample/kernel/swtmr/It_los_swtmr_022.c
+1
-1
testsuits/sample/kernel/swtmr/It_los_swtmr_023.c
testsuits/sample/kernel/swtmr/It_los_swtmr_023.c
+1
-1
testsuits/sample/kernel/swtmr/It_los_swtmr_033.c
testsuits/sample/kernel/swtmr/It_los_swtmr_033.c
+1
-1
testsuits/sample/kernel/swtmr/It_los_swtmr_043.c
testsuits/sample/kernel/swtmr/It_los_swtmr_043.c
+1
-1
testsuits/sample/kernel/swtmr/It_los_swtmr_061.c
testsuits/sample/kernel/swtmr/It_los_swtmr_061.c
+2
-1
testsuits/sample/kernel/task/It_los_task.c
testsuits/sample/kernel/task/It_los_task.c
+22
-0
testsuits/sample/kernel/task/It_los_task_054.c
testsuits/sample/kernel/task/It_los_task_054.c
+1
-1
testsuits/sample/kernel/task/It_los_task_081.c
testsuits/sample/kernel/task/It_los_task_081.c
+9
-3
testsuits/sample/kernel/task/It_los_task_087.c
testsuits/sample/kernel/task/It_los_task_087.c
+3
-3
testsuits/src/osTest.c
testsuits/src/osTest.c
+5
-33
未找到文件。
testsuits/BUILD.gn
浏览文件 @
e5179be5
...
...
@@ -10,7 +10,7 @@ config("include") {
]
}
s
ource_set
("test_init") {
s
tatic_library
("test_init") {
sources = [
"src/osTest.c",
...
...
testsuits/include/osTest.h
浏览文件 @
e5179be5
...
...
@@ -67,13 +67,19 @@ extern "C" {
}
while
(
0
)
#define LITEOS_BASE_TEST 1
#ifndef LOS_KERNEL_TEST_NOT_SMOKE
#define LOS_KERNEL_TEST_NOT_SMOKE 1
#endif
#define LOS_KERNEL_CORE_TASK_TEST 1
#define LOS_KERNEL_IPC_MUX_TEST 1
#define LOS_KERNEL_IPC_SEM_TEST 1
#define LOS_KERNEL_IPC_EVENT_TEST 1
#define LOS_KERNEL_IPC_QUEUE_TEST 1
#define LOS_KERNEL_CORE_SWTMR_TEST 1
#ifndef LOS_KERNEL_HWI_TEST
#define LOS_KERNEL_HWI_TEST 1
#endif
#define LOS_KERNEL_FS_TEST 0
#define LOS_KERNEL_MEM_TEST 1
#define LOS_KERNEL_TICKLESS_TEST 0
...
...
@@ -213,7 +219,7 @@ extern EVENT_CB_S g_exampleEvent;
#define LOS_MS_PER_TICK (LOS_SYS_MS_PER_SECOND / LOSCFG_BASE_CORE_TICK_PER_SECOND)
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
#define OS_TSK_TEST_STACK_SIZE 0x9000
#else
#define OS_TSK_TEST_STACK_SIZE 0x1000
...
...
@@ -276,7 +282,7 @@ extern EVENT_CB_S g_exampleEvent;
#define HWI_NUM_INT72 72
#define HWI_NUM_INT73 73
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
#define HWI_NUM_TEST 32
#define HWI_NUM_TEST0 33
#define HWI_NUM_TEST1 34
...
...
@@ -308,7 +314,7 @@ extern UINT32 TestHwiDelete(UINT32 hwiNum);
extern
VOID
TEST_HwiDeleteAll
(
VOID
);
extern
VOID
TestHwiTrigger
(
UINT32
hwiNum
);
extern
VOID
TestHwiClear
(
UINT32
hwiNum
);
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
extern
UINT64
LosCpuCycleGet
(
VOID
);
#else
typedef
struct
tagHwiHandleForm
{
...
...
@@ -317,7 +323,6 @@ typedef struct tagHwiHandleForm {
}
HWI_HANDLE_FORM_S
;
#endif
#define TEST_HwiCreate(ID, prio, mode, Func, arg) HalHwiCreate(ID, prio, mode, Func, arg)
#define LOS_HwiCreate(ID, prio, mode, Func, arg) HalHwiCreate(ID, prio, mode, Func, arg)
#define uart_printf_func printf
extern
VOID
ItSuiteLosTask
(
void
);
...
...
@@ -362,7 +367,6 @@ extern UINT32 g_taskMaxNum;
extern
LITE_OS_SEC_BSS_INIT
LOS_DL_LIST
g_stUnusedSemList
;
extern
VOID
HalHwiDefaultHandler
(
VOID
);
extern
LosTask
g_losTask
;
extern
VOID
LOS_Schedule
(
VOID
);
extern
LosTaskCB
*
g_taskCBArray
;
...
...
testsuits/sample/kernel/event/It_los_event.c
浏览文件 @
e5179be5
...
...
@@ -59,8 +59,10 @@ VOID ItSuiteLosEvent()
ItLosEvent020
();
ItLosEvent021
();
ItLosEvent022
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosEvent023
();
ItLosEvent024
();
#endif
ItLosEvent026
();
ItLosEvent027
();
ItLosEvent028
();
...
...
@@ -69,11 +71,15 @@ VOID ItSuiteLosEvent()
ItLosEvent031
();
ItLosEvent032
();
ItLosEvent033
();
#if (LOS_KERNEL_TEST_NOT_SMOKE == 1)
ItLosEvent034
();
#endif
ItLosEvent035
();
ItLosEvent036
();
ItLosEvent037
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosEvent038
();
#endif
ItLosEvent039
();
ItLosEvent040
();
ItLosEvent041
();
...
...
testsuits/sample/kernel/event/It_los_event_034.c
浏览文件 @
e5179be5
...
...
@@ -65,7 +65,7 @@ static UINT32 Testcase(VOID)
LOS_SwtmrStart
(
swTmrID
);
LOS_TaskDelay
(
1
0
);
// 10
, set delay time.
LOS_TaskDelay
(
1
1
);
// 11
, set delay time.
ICUNIT_GOTO_EQUAL
(
g_testCount
,
10
,
g_testCount
,
EXIT
);
// 10, Here, assert that g_testCount is equal to 10.
EXIT:
...
...
testsuits/sample/kernel/hwi/it_los_hwi.h
浏览文件 @
e5179be5
...
...
@@ -39,7 +39,7 @@ extern "C" {
#endif
/* __cplusplus */
#endif
/* __cplusplus */
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
#define OS_USER_HWI_MAX (26)
#define OS_HWI_MAX_USED_NUM (26)
#define OS_USER_HWI_MIN OS_RISCV_SYS_VECTOR_CNT
...
...
testsuits/sample/kernel/hwi/it_los_hwi_005.c
浏览文件 @
e5179be5
...
...
@@ -33,7 +33,7 @@
#include "it_los_hwi.h"
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
#define HWI_NUM_INT0 HWI_NUM_TEST2
#define HWI_NUM_INT1 HWI_NUM_TEST3
#endif
...
...
testsuits/sample/kernel/hwi/it_los_hwi_013.c
浏览文件 @
e5179be5
...
...
@@ -60,7 +60,7 @@ static VOID HwiF01(VOID)
static
UINT32
Testcase
(
VOID
)
{
UINT32
ret
;
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
HWI_PRIOR_T
hwiPrio
=
3
;
#else
HWI_PRIOR_T
hwiPrio
=
1
;
...
...
@@ -78,7 +78,7 @@ static UINT32 Testcase(VOID)
ret
=
LOS_HwiCreate
(
HWI_NUM_TEST2
,
hwiPrio
,
mode
,
(
HWI_PROC_FUNC
)
HwiF02
,
arg
);
ICUNIT_GOTO_EQUAL
(
ret
,
LOS_OK
,
ret
,
EXIT1
);
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
hwiPrio
=
1
;
#else
hwiPrio
=
3
;
// set new hwi priority is 3
...
...
testsuits/sample/kernel/hwi/it_los_hwi_032.c
浏览文件 @
e5179be5
...
...
@@ -34,7 +34,7 @@
static
int
g_uwIndex
;
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
#define HWI_NUM_INT0 HWI_NUM_TEST
#ifdef LOS_HIFONEV320_RV32
#define TEST_MAX_NUMBER_HWI 5
...
...
testsuits/sample/kernel/mem/It_los_tick_001.c
浏览文件 @
e5179be5
...
...
@@ -44,7 +44,9 @@ static UINT32 TestCase(VOID)
tickcnt2
=
LOS_TickCountGet
();
temp
=
tickcnt2
-
tickcnt1
;
ICUNIT_ASSERT_EQUAL
(
temp
,
30
,
temp
);
// 30, assert temp is equal to 30.
if
((
temp
!=
30
)
&&
(
temp
!=
31
))
{
// assert temp is equal to 30 or 31
ICUNIT_ASSERT_EQUAL
(
temp
,
0
,
temp
);
// 0, assert temp is equal to 0
}
return
LOS_OK
;
}
...
...
testsuits/sample/kernel/mux/BUILD.gn
浏览文件 @
e5179be5
...
...
@@ -28,6 +28,13 @@ static_library("test_mux") {
"It_los_mutex_023.c",
"It_los_mutex_024.c",
"It_los_mutex_025.c",
"It_los_mutex_026.c",
"It_los_mutex_027.c",
"It_los_mutex_029.c",
"It_los_mutex_030.c",
"It_los_mutex_031.c",
"It_los_mutex_033.c",
"It_los_mutex_034.c",
"It_los_mux.c",
]
...
...
testsuits/sample/kernel/mux/It_los_mux.c
浏览文件 @
e5179be5
...
...
@@ -49,14 +49,20 @@ VOID ItSuiteLosMux(void)
ItLosMux010
();
ItLosMux011
();
ItLosMux012
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosMux013
();
#endif
ItLosMux014
();
ItLosMux015
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosMux016
();
ItLosMux017
();
#endif
ItLosMux018
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosMux019
();
#ifndef LOS_HIMIDEER_RV32
#endif
#ifndef __RISC_V__
ItLosMux020
();
#endif
ItLosMux021
();
...
...
testsuits/sample/kernel/queue/It_los_queue.c
浏览文件 @
e5179be5
...
...
@@ -75,12 +75,14 @@ VOID ItSuiteLosQueue(VOID)
ItLosQueue041
();
ItLosQueue042
();
ItLosQueue043
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosQueue044
();
ItLosQueue045
();
ItLosQueue046
();
ItLosQueue047
();
ItLosQueue048
();
ItLosQueue050
();
#endif
ItLosQueue051
();
ItLosQueue052
();
ItLosQueue053
();
...
...
@@ -121,7 +123,9 @@ VOID ItSuiteLosQueue(VOID)
ItLosQueue104
();
ItLosQueue106
();
ItLosQueue107
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosQueue108
();
#endif
ItLosQueue109
();
ItLosQueue114
();
ItLosQueueHead001
();
...
...
testsuits/sample/kernel/sem/It_los_sem.c
浏览文件 @
e5179be5
...
...
@@ -54,19 +54,25 @@ VOID ItSuiteLosSem(void)
ItLosSem020
();
ItLosSem021
();
ItLosSem022
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosSem023
();
#endif
ItLosSem024
();
ItLosSem025
();
ItLosSem026
();
ItLosSem027
();
ItLosSem028
();
ItLosSem029
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosSem030
();
#endif
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == YES)
ItLosSem031
();
#endif
ItLosSem032
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosSem033
();
#endif
ItLosSem034
();
ItLosSem035
();
ItLosSem036
();
...
...
testsuits/sample/kernel/swtmr/BUILD.gn
浏览文件 @
e5179be5
...
...
@@ -65,22 +65,20 @@ static_library("test_swtmr") {
"It_los_swtmr_061.c",
"It_los_swtmr_062.c",
"It_los_swtmr_063.c",
#"It_los_swtmr_064.c",
#"It_los_swtmr_065.c",
#"It_los_swtmr_066.c",
#"It_los_swtmr_067.c",
#"It_los_swtmr_068.c",
#"It_los_swtmr_069.c",
#"It_los_swtmr_070.c",
#"It_los_swtmr_071.c",
#"It_los_swtmr_072.c",
#"It_los_swtmr_073.c",
#"It_los_swtmr_074.c",
#"It_los_swtmr_075.c",
#"It_los_swtmr_076.c",
#"It_los_swtmr_077.c",
#"It_los_swtmr_078.c",
#"It_los_swtmr_111.c",
"It_los_swtmr_064.c",
"It_los_swtmr_065.c",
"It_los_swtmr_066.c",
"It_los_swtmr_067.c",
"It_los_swtmr_068.c",
"It_los_swtmr_069.c",
"It_los_swtmr_071.c",
"It_los_swtmr_072.c",
"It_los_swtmr_073.c",
"It_los_swtmr_074.c",
"It_los_swtmr_075.c",
"It_los_swtmr_076.c",
"It_los_swtmr_077.c",
"It_los_swtmr_078.c",
"It_los_swtmr_Align_001.c",
"It_los_swtmr_Align_002.c",
"It_los_swtmr_Align_003.c",
...
...
testsuits/sample/kernel/swtmr/It_los_swtmr.c
浏览文件 @
e5179be5
...
...
@@ -60,27 +60,37 @@ VOID ItSuiteLosSwtmr(void)
ItLosSwtmr019
();
ItLosSwtmr020
();
ItLosSwtmr021
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosSwtmr022
();
ItLosSwtmr023
();
#endif
ItLosSwtmr024
();
ItLosSwtmr025
();
#if (LOS_KERNEL_TEST_NOT_SMOKE == 1)
ItLosSwtmr026
();
#endif
ItLosSwtmr027
();
ItLosSwtmr029
();
ItLosSwtmr030
();
ItLosSwtmr031
();
ItLosSwtmr032
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosSwtmr033
();
ItLosSwtmr034
();
#endif
ItLosSwtmr035
();
ItLosSwtmr036
();
ItLosSwtmr037
();
ItLosSwtmr038
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosSwtmr039
();
ItLosSwtmr040
();
ItLosSwtmr041
();
#endif
ItLosSwtmr042
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosSwtmr043
();
#endif
ItLosSwtmr044
();
ItLosSwtmr045
();
ItLosSwtmr046
();
...
...
@@ -101,17 +111,22 @@ VOID ItSuiteLosSwtmr(void)
ItLosSwtmr061
();
ItLosSwtmr062
();
ItLosSwtmr063
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosSwtmr064
();
ItLosSwtmr065
();
#endif
ItLosSwtmr066
();
ItLosSwtmr067
();
#if (LOS_KERNEL_TEST_NOT_SMOKE == 1)
ItLosSwtmr068
();
ItLosSwtmr069
();
#endif
ItLosSwtmr071
();
ItLosSwtmr072
();
ItLosSwtmr073
();
#if (LOS_KERNEL_TEST_NOT_SMOKE == 1)
ItLosSwtmr074
();
#endif
ItLosSwtmr075
();
ItLosSwtmr076
();
ItLosSwtmr077
();
...
...
@@ -121,7 +136,9 @@ VOID ItSuiteLosSwtmr(void)
ItLosSwtmrAlign002
();
ItLosSwtmrAlign003
();
ItLosSwtmrAlign004
();
#if (LOS_KERNEL_TEST_NOT_SMOKE == 1)
ItLosSwtmrAlign005
();
#endif
ItLosSwtmrAlign006
();
ItLosSwtmrAlign007
();
ItLosSwtmrAlign008
();
...
...
testsuits/sample/kernel/swtmr/It_los_swtmr_001.c
浏览文件 @
e5179be5
...
...
@@ -47,7 +47,7 @@ static UINT32 Testcase(VOID)
{
UINT32
ret
;
UINT32
swTmrID
;
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
UINT16
swtmrId2
;
UINT32
tick
;
#endif
...
...
@@ -78,7 +78,7 @@ static UINT32 Testcase(VOID)
ICUNIT_ASSERT_EQUAL
(
ret
,
LOS_OK
,
ret
);
#endif
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
// 4, Timeout interval of a periodic software timer.
ret
=
LOS_SwtmrCreate
(
4
,
LOS_SWTMR_MODE_NO_SELFDELETE
,
Case1
,
&
swtmrId2
,
0xffff
#if (LOSCFG_BASE_CORE_SWTMR_ALIGN == 1)
...
...
@@ -103,35 +103,10 @@ static UINT32 Testcase(VOID)
ret
=
LOS_SwtmrTimeGet
(
swtmrId2
,
&
tick
);
ICUNIT_GOTO_EQUAL
(
ret
,
LOS_ERRNO_SWTMR_NOT_STARTED
,
ret
,
EXIT
);
ret
=
LOS_SwtmrStart
(
swtmrId2
);
ICUNIT_GOTO_EQUAL
(
ret
,
LOS_OK
,
ret
,
EXIT
);
#ifdef LOS_HIMIDEER_RV32
OsSwtmrAdjust
(
ret
);
#endif
ret
=
LOS_SwtmrStop
(
swtmrId2
);
ICUNIT_GOTO_EQUAL
(
ret
,
LOS_OK
,
ret
,
EXIT
);
ret
=
LOS_TaskDelay
(
3
);
// 3, set delay time.
ICUNIT_GOTO_EQUAL
(
ret
,
LOS_OK
,
ret
,
EXIT
);
// 2, Here, assert that g_testCount is equal to this .
ICUNIT_GOTO_EQUAL
(
g_testCount
,
2
,
g_testCount
,
EXIT
);
OsSwtmrAdjust
(
ret
);
// 2, Here, assert that g_testCount is equal to this .
ICUNIT_GOTO_EQUAL
(
g_testCount
,
2
,
g_testCount
,
EXIT
);
ret
=
LOS_SwtmrStop
(
swtmrId2
);
ICUNIT_GOTO_EQUAL
(
ret
,
LOS_ERRNO_SWTMR_NOT_STARTED
,
ret
,
EXIT
);
ret
=
LOS_SwtmrStop
(
swtmrId2
+
LOSCFG_BASE_CORE_SWTMR_LIMIT
);
ICUNIT_GOTO_EQUAL
(
ret
,
LOS_ERRNO_SWTMR_ID_INVALID
,
ret
,
EXIT
);
#endif
EXIT:
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
ret
=
LOS_SwtmrDelete
(
swtmrId2
);
#endif
ICUNIT_ASSERT_EQUAL
(
ret
,
LOS_OK
,
ret
);
...
...
testsuits/sample/kernel/swtmr/It_los_swtmr_022.c
浏览文件 @
e5179be5
...
...
@@ -33,7 +33,7 @@
#include "It_los_swtmr.h"
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
#define HWI_NUM_INT31 HWI_NUM_TEST
#define HWI_NUM_INT14 HWI_NUM_TEST
#endif
...
...
testsuits/sample/kernel/swtmr/It_los_swtmr_023.c
浏览文件 @
e5179be5
...
...
@@ -33,7 +33,7 @@
#include "It_los_swtmr.h"
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
#define HWI_NUM_INT31 HWI_NUM_TEST
#define HWI_NUM_INT14 HWI_NUM_TEST
#endif
...
...
testsuits/sample/kernel/swtmr/It_los_swtmr_033.c
浏览文件 @
e5179be5
...
...
@@ -33,7 +33,7 @@
#include "It_los_swtmr.h"
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
#define HWI_NUM_INT11 HWI_NUM_TEST
#endif
...
...
testsuits/sample/kernel/swtmr/It_los_swtmr_043.c
浏览文件 @
e5179be5
...
...
@@ -33,7 +33,7 @@
#include "It_los_swtmr.h"
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
#define HWI_NUM_INT12 HWI_NUM_TEST
#endif
...
...
testsuits/sample/kernel/swtmr/It_los_swtmr_061.c
浏览文件 @
e5179be5
...
...
@@ -61,7 +61,8 @@ static UINT32 Testcase(VOID)
ret
=
LOS_SwtmrTimeGet
((
LOSCFG_BASE_CORE_SWTMR_LIMIT
+
1
),
&
tick
);
ICUNIT_GOTO_NOT_EQUAL
(
ret
,
LOS_OK
,
ret
,
EXIT
);
#ifdef LOS_HIMIDEER_RV32
#ifdef __RISC_V__
#define OS_SWTMR_MAX_TIMERID ((0xFFFFFFFF / LOSCFG_BASE_CORE_SWTMR_LIMIT) * LOSCFG_BASE_CORE_SWTMR_LIMIT)
ret
=
LOS_SwtmrTimeGet
((
OS_SWTMR_MAX_TIMERID
+
1
),
&
tick
);
ICUNIT_GOTO_EQUAL
(
ret
,
LOS_ERRNO_SWTMR_ID_INVALID
,
ret
,
EXIT
);
#endif
...
...
testsuits/sample/kernel/task/It_los_task.c
浏览文件 @
e5179be5
...
...
@@ -84,24 +84,34 @@ VOID ItSuiteLosTask()
ItLosTask050
();
ItLosTask051
();
ItLosTask052
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosTask053
();
ItLosTask054
();
#endif
ItLosTask055
();
ItLosTask056
();
ItLosTask057
();
ItLosTask058
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosTask059
();
#endif
ItLosTask060
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosTask061
();
#endif
ItLosTask062
();
ItLosTask063
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosTask064
();
#endif
ItLosTask065
();
ItLosTask066
();
ItLosTask067
();
ItLosTask068
();
ItLosTask069
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosTask070
();
#endif
ItLosTask071
();
ItLosTask072
();
ItLosTask073
();
...
...
@@ -111,12 +121,16 @@ VOID ItSuiteLosTask()
ItLosTask077
();
ItLosTask078
();
ItLosTask079
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosTask080
();
#endif
ItLosTask081
();
ItLosTask082
();
ItLosTask083
();
ItLosTask085
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosTask086
();
#endif
ItLosTask087
();
ItLosTask088
();
ItLosTask089
();
...
...
@@ -130,11 +144,15 @@ VOID ItSuiteLosTask()
ItLosTask099
();
ItLosTask100
();
ItLosTask101
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosTask102
();
#endif
ItLosTask103
();
ItLosTask104
();
ItLosTask105
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosTask106
();
#endif
ItLosTask107
();
ItLosTask108
();
ItLosTask109
();
...
...
@@ -142,9 +160,13 @@ VOID ItSuiteLosTask()
ItLosTask111
();
ItLosTask112
();
ItLosTask113
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosTask114
();
#endif
ItLosTask115
();
ItLosTask116
();
#if (LOS_KERNEL_HWI_TEST == 1)
ItLosTask117
();
#endif
}
testsuits/sample/kernel/task/It_los_task_054.c
浏览文件 @
e5179be5
...
...
@@ -68,7 +68,7 @@ static VOID TaskF01(VOID)
ret
=
LOS_TaskCreate
(
&
g_testTaskID02
,
&
task1
);
ICUNIT_ASSERT_EQUAL_VOID
(
ret
,
LOS_OK
,
ret
);
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
ret
=
LOS_HwiCreate
(
HWI_NUM_TEST
,
1
,
0
,
HwiF01
,
0
);
#else
ret
=
LOS_HwiCreate
(
HWI_NUM_TEST
,
1
,
0
,
HwiF01
,
1
);
...
...
testsuits/sample/kernel/task/It_los_task_081.c
浏览文件 @
e5179be5
...
...
@@ -44,8 +44,11 @@ static VOID TaskF01(VOID)
tick1
=
LOS_TickCountGet
();
LOS_TaskDelay
(
10
);
// 10, set delay time
tick2
=
LOS_TickCountGet
();
tick2
=
tick2
-
tick1
;
ICUNIT_GOTO_EQUAL
((
tick2
-
tick1
),
10
,
(
tick2
-
tick1
),
EXIT
);
// 10, Here, assert that result is equal to 10.
if
((
tick2
!=
10
)
&&
(
tick2
!=
11
))
{
// 10, 11 delay time
ICUNIT_GOTO_EQUAL
(
tick2
,
0
,
tick2
,
EXIT
);
// 0, Here, assert that result is equal to 0.
}
ICUNIT_GOTO_EQUAL
(
g_testCount
,
2
,
g_testCount
,
EXIT
);
// 2, Here, assert that g_testCount is equal to 2.
g_testCount
++
;
...
...
@@ -74,8 +77,10 @@ static VOID TaskF02(VOID)
tick2
=
LOS_TickCountGet
();
ICUNIT_GOTO_EQUAL
(
ret
,
LOS_ERRNO_SEM_TIMEOUT
,
ret
,
EXIT
);
ICUNIT_GOTO_EQUAL
((
tick2
-
tick1
),
10
,
(
tick2
-
tick1
),
EXIT
);
// 10, Here, assert that result is equal to 10.
tick2
=
tick2
-
tick1
;
if
((
tick2
!=
10
)
&&
(
tick2
!=
11
))
{
// 10, 11 delay time
ICUNIT_GOTO_EQUAL
(
tick2
,
0
,
tick2
,
EXIT
);
// 0, Here, assert that result is equal to 0.
}
ICUNIT_GOTO_EQUAL
(
g_testCount
,
5
,
g_testCount
,
EXIT
);
// 5, Here, assert that g_testCount is equal to 5.
g_testCount
++
;
...
...
@@ -83,6 +88,7 @@ static VOID TaskF02(VOID)
ICUNIT_GOTO_EQUAL
(
ret
,
LOS_OK
,
ret
,
EXIT
);
EXIT:
LOS_SemDelete
(
semHandle
);
LOS_TaskDelete
(
g_testTaskID01
);
return
;
}
...
...
testsuits/sample/kernel/task/It_los_task_087.c
浏览文件 @
e5179be5
...
...
@@ -39,7 +39,7 @@ static VOID TaskF01(VOID)
return
;
}
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
static
UINT32
OsShellCmdTaskCntGet
(
VOID
)
{
UINT32
loop
;
...
...
@@ -69,7 +69,7 @@ static UINT32 TestCase(VOID)
UINT8
pro
;
CHAR
acName
[
TASK_NAME_NUM
];
UINT32
auwTestTaskID
[
LOSCFG_BASE_CORE_TSK_LIMIT
];
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
UINT32
taskCnt
;
taskCnt
=
OsShellCmdTaskCntGet
();
#endif
...
...
@@ -77,7 +77,7 @@ static UINT32 TestCase(VOID)
task1
.
pfnTaskEntry
=
(
TSK_ENTRY_FUNC
)
TaskF01
;
task1
.
uwStackSize
=
LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE
;
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
g_leavingTaskNum
=
LOSCFG_BASE_CORE_TSK_LIMIT
-
taskCnt
;
#else
g_leavingTaskNum
=
LOSCFG_BASE_CORE_TSK_LIMIT
-
TASK_EXISTED_NUM
;
...
...
testsuits/src/osTest.c
浏览文件 @
e5179be5
...
...
@@ -79,9 +79,6 @@ UINT32 g_usSemID3[LOSCFG_BASE_IPC_SEM_CONFIG + 1];
#define TST_RAMADDRSTART 0x20000000
#define TST_RAMADDREND 0x20010000
#if (CMSIS_OS_VER == 2)
extern
SWTMR_CTRL_S
*
g_swtmrCBArray
;
UINT32
SwtmrCountGetTest
(
VOID
)
...
...
@@ -206,7 +203,7 @@ UINT32 LosAppInit()
return
LOS_OK
;
}
#ifdef
LOS_HIMIDEER_RV32
#ifdef
__RISC_V__
#ifdef LOS_HIMIDEERV100
#define HWI_TRIG_BASE 0x20c20
#define HWI_CLEAN_TRI 0x20c20
...
...
@@ -220,43 +217,17 @@ UINT32 LosAppInit()
VOID
TestHwiTrigger
(
UINT32
hwiNum
)
{
LOS_InterruptUnmask
(
hwiNum
);
volatile
UINT32
val
;
#ifdef LOS_HIMIDEERV100
val
=
*
(
volatile
UINT32
*
)
HWI_TRIG_BASE
;
val
|=
(
1
<<
(
hwiNum
-
OS_RISCV_SYS_VECTOR_CNT
));
#elif defined(LOS_HIFONEV320_RV32)
val
=
hwiNum
-
HIW_SYS_COUNT
;
#endif
*
(
volatile
UINT32
*
)
HWI_TRIG_BASE
=
val
;
mb
();
HalIrqEnable
(
hwiNum
);
}
UINT32
TestHwiDelete
(
UINT32
hwiNum
)
{
volatile
UINT32
val
;
#ifdef LOS_HIMIDEERV100
val
=
*
(
volatile
UINT32
*
)
0x20c20
;
val
&=
~
(
1
<<
(
hwiNum
-
OS_RISCV_SYS_VECTOR_CNT
));
#elif defined(LOS_HIFONEV320_RV32)
val
=
hwiNum
-
HIW_SYS_COUNT
;
#endif
*
(
volatile
UINT32
*
)
HWI_CLEAN_TRI
=
val
;
LOS_HwiDelete
(
hwiNum
,
NULL
);
return
LOS_OK
;
return
;
}
VOID
TestHwiClear
(
UINT32
hwiNum
)
{
volatile
UINT32
val
;
#ifdef LOS_HIMIDEERV100
val
=
*
(
volatile
UINT32
*
)
HWI_CLEAN_TRI
;
val
&=
~
(
1
<<
(
hwiNum
-
OS_RISCV_SYS_VECTOR_CNT
));
#elif defined(LOS_HIFONEV320_RV32)
val
=
hwiNum
-
HIW_SYS_COUNT
;
#endif
*
(
volatile
UINT32
*
)
HWI_CLEAN_TRI
=
val
;
mb
();
return
;
}
#define HIGH_SHIFT 32
...
...
@@ -279,6 +250,7 @@ VOID TestHwiTrigger(UINT32 hwiNum)
{
*
(
volatile
UINT32
*
)(
OS_NVIC_SETPEND
+
((
hwiNum
>>
HWI_SHIFT_NUM
)
<<
HWI_BIT
))
=
1
<<
(
hwiNum
&
0x1F
);
}
VOID
TestHwiUnTrigger
(
UINT32
hwiNum
)
{
*
(
volatile
UINT32
*
)(
OS_NVIC_CLRPEND
+
((
hwiNum
>>
HWI_SHIFT_NUM
)
<<
HWI_BIT
))
=
1
<<
(
hwiNum
&
0x1F
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录