mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-25 14:28:20 +08:00
[action][utest]:Expand kernel auto-run matrix and sync test configs
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / A9 :components/dfs.cfg (push) Has been cancelled
utest_auto_run / A9 :components/lwip.cfg (push) Has been cancelled
utest_auto_run / A9 :components/netdev.cfg (push) Has been cancelled
utest_auto_run / A9 :components/sal.cfg (push) Has been cancelled
utest_auto_run / A9 :cpp11/cpp11.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9-smp :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9-smp :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / A9-smp :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :kernel/mem.cfg (push) Has been cancelled
ToolsCI / Tools (push) Has been cancelled
doc_doxygen / doxygen_doc generate (push) Has been cancelled
doc_doxygen / deploy (push) Has been cancelled
Weekly CI Scheduler / Trigger and Monitor CIs (push) Has been cancelled
Weekly CI Scheduler / Create Discussion Report (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / A9 :components/dfs.cfg (push) Has been cancelled
utest_auto_run / A9 :components/lwip.cfg (push) Has been cancelled
utest_auto_run / A9 :components/netdev.cfg (push) Has been cancelled
utest_auto_run / A9 :components/sal.cfg (push) Has been cancelled
utest_auto_run / A9 :cpp11/cpp11.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9-smp :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9-smp :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / A9-smp :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :kernel/mem.cfg (push) Has been cancelled
ToolsCI / Tools (push) Has been cancelled
doc_doxygen / doxygen_doc generate (push) Has been cancelled
doc_doxygen / deploy (push) Has been cancelled
Weekly CI Scheduler / Trigger and Monitor CIs (push) Has been cancelled
Weekly CI Scheduler / Create Discussion Report (push) Has been cancelled
This commit is contained in:
+22
-3
@@ -77,6 +77,7 @@
|
||||
#define TEST_RT_NAME_MAX RT_NAME_MAX
|
||||
#define OBJECT_STRESS_BATCH 24
|
||||
#define OBJECT_STRESS_ROUNDS 3
|
||||
#define OBJECT_THREAD_STACK_SIZE 1024
|
||||
|
||||
#ifndef ARRAY_SIZE
|
||||
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||
@@ -140,6 +141,16 @@ static rt_err_t generate_unique_name(char *buf,
|
||||
return -RT_ENOMEM;
|
||||
}
|
||||
|
||||
static void object_find_test_thread_entry(void *parameter)
|
||||
{
|
||||
RT_UNUSED(parameter);
|
||||
|
||||
while (1)
|
||||
{
|
||||
rt_thread_mdelay(10);
|
||||
}
|
||||
}
|
||||
|
||||
static void test_object_name_handling(void)
|
||||
{
|
||||
struct rt_object static_obj;
|
||||
@@ -187,6 +198,7 @@ static void test_object_find_operations(void)
|
||||
rt_thread_t found_thread;
|
||||
rt_object_t found;
|
||||
char missing_name[] = "object.not.exists";
|
||||
rt_err_t ret;
|
||||
|
||||
uassert_true(generate_unique_name(name, sizeof(name), "sobj", RT_Object_Class_Thread) == RT_EOK);
|
||||
rt_object_init(&static_obj, RT_Object_Class_Thread, name);
|
||||
@@ -197,14 +209,21 @@ static void test_object_find_operations(void)
|
||||
rt_object_detach(&static_obj);
|
||||
|
||||
uassert_true(generate_unique_name(name, sizeof(name), "thr", RT_Object_Class_Thread) == RT_EOK);
|
||||
thread = rt_thread_create(name, RT_NULL, RT_NULL, 512, RT_THREAD_PRIORITY_MAX / 2, 10);
|
||||
thread = rt_thread_create(name, object_find_test_thread_entry, RT_NULL,
|
||||
OBJECT_THREAD_STACK_SIZE, RT_THREAD_PRIORITY_MAX / 2, 10);
|
||||
uassert_not_null(thread);
|
||||
ret = rt_thread_startup(thread);
|
||||
uassert_int_equal(ret, RT_EOK);
|
||||
found_thread = rt_thread_find(name);
|
||||
uassert_not_null(found_thread);
|
||||
uassert_ptr_equal(found_thread, thread);
|
||||
uassert_str_equal(found_thread->parent.name, name);
|
||||
rt_thread_delete(thread);
|
||||
rt_thread_mdelay(10);
|
||||
ret = rt_thread_delete(thread);
|
||||
uassert_int_equal(ret, RT_EOK);
|
||||
for (int i = 0; i < 10 && rt_thread_find(name) != RT_NULL; i++)
|
||||
{
|
||||
rt_thread_mdelay(100);
|
||||
}
|
||||
uassert_null(rt_thread_find(name));
|
||||
|
||||
#ifdef RT_USING_DEVICE
|
||||
|
||||
@@ -81,7 +81,6 @@ static void perf_thread_mbox1(void *parameter)
|
||||
static void perf_thread_mbox2(void *parameter)
|
||||
{
|
||||
rt_perf_t *perf = (rt_perf_t *)parameter;
|
||||
rt_err_t ret = RT_EOK;
|
||||
while (1)
|
||||
{
|
||||
if (perf->count >= RT_UTEST_SYS_PERF_TC_COUNT)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "utest.h"
|
||||
|
||||
#define UTEST_NAME "thread_overflow_tc"
|
||||
#define TEST_STACK_SIZE 512
|
||||
#define TEST_STACK_SIZE UTEST_THR_STACK_SIZE
|
||||
|
||||
/* Test thread stack overflow */
|
||||
static rt_thread_t test_thread = RT_NULL;
|
||||
@@ -34,7 +34,7 @@ static rt_err_t stack_overflow_hook(struct rt_thread *thread)
|
||||
static void stack_usage_test(void)
|
||||
{
|
||||
rt_thread_t current_thread;
|
||||
rt_uint32_t total_stack, used_stack;
|
||||
rt_uintptr_t total_stack, used_stack;
|
||||
|
||||
current_thread = rt_thread_self();
|
||||
uassert_not_null(current_thread);
|
||||
@@ -49,10 +49,10 @@ static void stack_usage_test(void)
|
||||
|
||||
#ifdef ARCH_CPU_STACK_GROWS_UPWARD
|
||||
/* For upward growing stacks */
|
||||
used_stack = (rt_uint32_t)current_thread->sp - (rt_uint32_t)current_thread->stack_addr;
|
||||
used_stack = (rt_uintptr_t)current_thread->sp - (rt_uintptr_t)current_thread->stack_addr;
|
||||
#else
|
||||
/* For downward growing stacks (most common) */
|
||||
used_stack = (rt_uint32_t)current_thread->stack_addr + total_stack - (rt_uint32_t)current_thread->sp;
|
||||
used_stack = (rt_uintptr_t)current_thread->stack_addr + total_stack - (rt_uintptr_t)current_thread->sp;
|
||||
#endif
|
||||
|
||||
rt_kprintf("Used stack: %d bytes (%d%%)\n",
|
||||
@@ -142,11 +142,11 @@ static void stack_overflow_hook_test(void)
|
||||
/* Fake thread test entry function */
|
||||
static void fake_thread_entry(void *parameter)
|
||||
{
|
||||
/* This function should never actually run */
|
||||
rt_kprintf("Fake thread is running - this should not happen!\n");
|
||||
RT_UNUSED(parameter);
|
||||
|
||||
while (1)
|
||||
{
|
||||
rt_thread_mdelay(1000);
|
||||
rt_thread_mdelay(100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,14 +178,18 @@ static void fake_thread_stack_overflow_test(void)
|
||||
}
|
||||
|
||||
rt_kprintf("Fake thread created successfully\n");
|
||||
uassert_int_equal(rt_thread_startup(fake_thread), RT_EOK);
|
||||
rt_thread_mdelay(10);
|
||||
|
||||
rt_kprintf("Corrupting fake thread stack with pattern 0x11...\n");
|
||||
rt_memset(fake_thread->stack_addr, 0x11, fake_thread->stack_size);
|
||||
|
||||
/* Also corrupt the magic number area if stack checking is enabled */
|
||||
rt_kprintf("Corrupting fake thread stack sentinel...\n");
|
||||
#ifdef RT_USING_OVERFLOW_CHECK
|
||||
/* For downward growing stacks, magic is typically at the beginning */
|
||||
rt_memset(fake_thread->stack_addr, 0x11, 4); /* Corrupt first 4 bytes */
|
||||
/* Only corrupt the sentinel bytes used by overflow detection. */
|
||||
#ifdef ARCH_CPU_STACK_GROWS_UPWARD
|
||||
rt_memset((rt_uint8_t *)fake_thread->stack_addr + fake_thread->stack_size - sizeof(rt_ubase_t),
|
||||
0x11, sizeof(rt_ubase_t));
|
||||
#else
|
||||
rt_memset(fake_thread->stack_addr, 0x11, sizeof(rt_ubase_t));
|
||||
#endif
|
||||
rt_kprintf("Stack magic number area corrupted\n");
|
||||
#endif
|
||||
|
||||
@@ -204,6 +208,11 @@ static void fake_thread_stack_overflow_test(void)
|
||||
if (fake_thread != RT_NULL)
|
||||
{
|
||||
rt_thread_delete(fake_thread);
|
||||
for (int i = 0; i < 10 && rt_thread_find("fake_thread") != RT_NULL; i++)
|
||||
{
|
||||
rt_thread_mdelay(10);
|
||||
}
|
||||
uassert_null(rt_thread_find("fake_thread"));
|
||||
fake_thread = RT_NULL;
|
||||
rt_kprintf("Fake thread deleted\n");
|
||||
}
|
||||
@@ -250,6 +259,10 @@ static rt_err_t utest_tc_cleanup(void)
|
||||
if (fake_thread != RT_NULL)
|
||||
{
|
||||
rt_thread_delete(fake_thread);
|
||||
for (int i = 0; i < 10 && rt_thread_find("fake_thread") != RT_NULL; i++)
|
||||
{
|
||||
rt_thread_mdelay(10);
|
||||
}
|
||||
fake_thread = RT_NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user