!223 add testsuites/kernel to build
Merge pull request !223 from lnlan/ktest_fixed
This commit is contained in:
commit
bcf7a0701a
6
Kconfig
6
Kconfig
|
@ -322,6 +322,12 @@ menu "Security"
|
||||||
source "../../kernel/liteos_a/security/Kconfig"
|
source "../../kernel/liteos_a/security/Kconfig"
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
|
menu "Test"
|
||||||
|
config ENABLE_KERNEL_TEST
|
||||||
|
bool "Enable Kernel Test"
|
||||||
|
default n
|
||||||
|
endmenu
|
||||||
|
|
||||||
menu "Stack Smashing Protector (SSP) Compiler Feature"
|
menu "Stack Smashing Protector (SSP) Compiler Feature"
|
||||||
|
|
||||||
choice
|
choice
|
||||||
|
|
|
@ -117,7 +117,6 @@
|
||||||
#include "los_hilog.h"
|
#include "los_hilog.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
STATIC SystemRebootFunc g_rebootHook = NULL;
|
STATIC SystemRebootFunc g_rebootHook = NULL;
|
||||||
|
|
||||||
VOID OsSetRebootHook(SystemRebootFunc func)
|
VOID OsSetRebootHook(SystemRebootFunc func)
|
||||||
|
@ -373,7 +372,12 @@ STATIC UINT32 OsSystemInitTaskCreate(VOID)
|
||||||
TSK_INIT_PARAM_S sysTask;
|
TSK_INIT_PARAM_S sysTask;
|
||||||
|
|
||||||
(VOID)memset_s(&sysTask, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S));
|
(VOID)memset_s(&sysTask, sizeof(TSK_INIT_PARAM_S), 0, sizeof(TSK_INIT_PARAM_S));
|
||||||
|
#ifndef LOSCFG_ENABLE_KERNEL_TEST
|
||||||
sysTask.pfnTaskEntry = (TSK_ENTRY_FUNC)SystemInit;
|
sysTask.pfnTaskEntry = (TSK_ENTRY_FUNC)SystemInit;
|
||||||
|
#else
|
||||||
|
extern void TestSystemInit(void);
|
||||||
|
sysTask.pfnTaskEntry = (TSK_ENTRY_FUNC)TestSystemInit;
|
||||||
|
#endif
|
||||||
sysTask.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
|
sysTask.uwStackSize = LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE;
|
||||||
sysTask.pcName = "SystemInit";
|
sysTask.pcName = "SystemInit";
|
||||||
sysTask.usTaskPrio = LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO;
|
sysTask.usTaskPrio = LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO;
|
||||||
|
|
|
@ -92,7 +92,6 @@ $(LITEOS_TEST_LIBC): $(KERNEL)
|
||||||
|
|
||||||
$(KERNEL): $(LITEOS_TEST_AUTOCONFIG_H)
|
$(KERNEL): $(LITEOS_TEST_AUTOCONFIG_H)
|
||||||
$(HIDE)$(MAKE) -C ../ lib || exit 1
|
$(HIDE)$(MAKE) -C ../ lib || exit 1
|
||||||
#echo "LITEOS_CFLAGS : $(LITEOS_CFLAGS)"
|
|
||||||
|
|
||||||
##### make test menuconfig #####
|
##### make test menuconfig #####
|
||||||
export CONFIG_=LOSCFG_
|
export CONFIG_=LOSCFG_
|
||||||
|
|
|
@ -94,7 +94,7 @@ extern "C" {
|
||||||
testTask.pcName = task_name; \
|
testTask.pcName = task_name; \
|
||||||
testTask.usTaskPrio = prio; \
|
testTask.usTaskPrio = prio; \
|
||||||
testTask.uwResved = LOS_TASK_STATUS_DETACHED; \
|
testTask.uwResved = LOS_TASK_STATUS_DETACHED; \
|
||||||
} while (0)
|
} while (0);
|
||||||
|
|
||||||
#if (LOSCFG_KERNEL_SMP == YES)
|
#if (LOSCFG_KERNEL_SMP == YES)
|
||||||
#define TEST_TASK_PARAM_INIT_AFFI(testTask, task_name, entry, prio, affi) \
|
#define TEST_TASK_PARAM_INIT_AFFI(testTask, task_name, entry, prio, affi) \
|
||||||
|
|
|
@ -40,7 +40,7 @@ extern "C" {
|
||||||
static void TaskF01(void)
|
static void TaskF01(void)
|
||||||
{
|
{
|
||||||
while (1) {
|
while (1) {
|
||||||
Wfi();
|
WFI;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ extern "C" {
|
||||||
static void TaskF01(void)
|
static void TaskF01(void)
|
||||||
{
|
{
|
||||||
while (1) {
|
while (1) {
|
||||||
Wfi();
|
WFI;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ static void TaskF01(void)
|
||||||
{
|
{
|
||||||
LOS_AtomicInc(&g_testCount);
|
LOS_AtomicInc(&g_testCount);
|
||||||
while (1) {
|
while (1) {
|
||||||
Wfi();
|
WFI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ static VOID TaskF01(VOID)
|
||||||
|
|
||||||
g_testCount++;
|
g_testCount++;
|
||||||
|
|
||||||
ret = LOS_EventRead(&g_event, 0x11, LOS_WAITMODE_AND, 2); // 2, The timeout period for reading events.
|
ret = LOS_EventRead(&g_event, 0x11, LOS_WAITMODE_AND, 200); // 200, The timeout period for reading events.
|
||||||
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
ICUNIT_GOTO_EQUAL(ret, 0, ret, EXIT);
|
||||||
ICUNIT_GOTO_EQUAL(g_event.uwEventID, 0, g_event.uwEventID, EXIT);
|
ICUNIT_GOTO_EQUAL(g_event.uwEventID, 0, g_event.uwEventID, EXIT);
|
||||||
|
|
||||||
|
@ -98,6 +98,7 @@ static UINT32 Testcase(VOID)
|
||||||
|
|
||||||
LOS_TaskUnlock();
|
LOS_TaskUnlock();
|
||||||
|
|
||||||
|
LOS_TaskDelay(1);
|
||||||
ICUNIT_GOTO_EQUAL(g_testCount, 2, g_testCount, EXIT); // 2, Here, assert that g_testCount is equal to 2.
|
ICUNIT_GOTO_EQUAL(g_testCount, 2, g_testCount, EXIT); // 2, Here, assert that g_testCount is equal to 2.
|
||||||
|
|
||||||
EXIT:
|
EXIT:
|
||||||
|
|
|
@ -98,11 +98,6 @@ VOID ItSuiteLosSem(void)
|
||||||
ItLosSem017();
|
ItLosSem017();
|
||||||
ItLosSem019();
|
ItLosSem019();
|
||||||
ItLosSem020();
|
ItLosSem020();
|
||||||
#if (LOSCFG_KERNEL_SMP != YES)
|
|
||||||
ItLosSem018();
|
|
||||||
ItLosSem021();
|
|
||||||
ItLosSem025();
|
|
||||||
#endif
|
|
||||||
ItLosSem022();
|
ItLosSem022();
|
||||||
ItLosSem023();
|
ItLosSem023();
|
||||||
ItLosSem026();
|
ItLosSem026();
|
||||||
|
|
|
@ -294,7 +294,7 @@ VOID TestBusyTaskDelay(UINT32 tick)
|
||||||
if (runtime <= TestTickCountByCurrCpuid()) {
|
if (runtime <= TestTickCountByCurrCpuid()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Wfi();
|
WFI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ VOID TestAssertBusyTaskDelay(UINT32 timeout, UINT32 flag)
|
||||||
if ((runtime <= TestTickCountGet()) || (g_testCount == flag)) {
|
if ((runtime <= TestTickCountGet()) || (g_testCount == flag)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Wfi();
|
WFI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue