diff --git a/.github/workflows/action_utest.yml b/.github/workflows/action_utest.yml index 2ff0bd8185..197537a9b4 100644 --- a/.github/workflows/action_utest.yml +++ b/.github/workflows/action_utest.yml @@ -13,6 +13,8 @@ jobs: legs: - {UTEST: "kernel/mem", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", CONFIG_FILE: "kernel/mem.conf", SD_FILE: "sd.bin"} - {UTEST: "kernel/ipc", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", CONFIG_FILE: "kernel/ipc.conf", SD_FILE: "sd.bin"} + - {UTEST: "kernel/irq", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", CONFIG_FILE: "kernel/irq.conf", SD_FILE: "sd.bin"} + - {UTEST: "kernel/timer", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", CONFIG_FILE: "kernel/timer.conf", SD_FILE: "sd.bin"} - {UTEST: "components/utest", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "arm", QEMU_MACHINE: "vexpress-a9", CONFIG_FILE: "utest_self/self.conf", SD_FILE: "sd.bin"} - {UTEST: "kernel/mem/riscv64", RTT_BSP: "bsp/qemu-riscv-virt64", QEMU_ARCH: "riscv64", QEMU_MACHINE: "virt", CONFIG_FILE: "kernel/mem.conf", SD_FILE: "None"} env: diff --git a/components/utilities/utest/utest.c b/components/utilities/utest/utest.c index 937f156b85..7103efb89c 100644 --- a/components/utilities/utest/utest.c +++ b/components/utilities/utest/utest.c @@ -54,8 +54,8 @@ static struct utest local_utest = {UTEST_PASSED, 0, 0}; #endif #define TC_FAIL_LIST_SIZE (RT_ALIGN(tc_num, 8) / 8) -#define TC_FAIL_LIST_MARK_FAILED(index) (tc_fail_list[RT_ALIGN(index, 8) / 8] |= (1UL << (index % 8))) -#define TC_FAIL_LIST_IS_FAILED(index) (tc_fail_list[RT_ALIGN(index, 8) / 8] & (1UL << (index % 8))) +#define TC_FAIL_LIST_MARK_FAILED(index) (tc_fail_list[index / 8] |= (1UL << (index % 8))) +#define TC_FAIL_LIST_IS_FAILED(index) (tc_fail_list[index / 8] & (1UL << (index % 8))) void utest_log_lv_set(rt_uint8_t lv) { diff --git a/examples/utest/configs/kernel/irq.conf b/examples/utest/configs/kernel/irq.conf new file mode 100644 index 0000000000..83fe485638 --- /dev/null +++ b/examples/utest/configs/kernel/irq.conf @@ -0,0 +1,2 @@ +CONFIG_UTEST_IRQ_TC=y +# dependencies diff --git a/examples/utest/configs/kernel/timer.conf b/examples/utest/configs/kernel/timer.conf new file mode 100644 index 0000000000..20696f065f --- /dev/null +++ b/examples/utest/configs/kernel/timer.conf @@ -0,0 +1,4 @@ +CONFIG_UTEST_TIMER_TC=y + +# dependencies +CONFIG_RT_USING_TIMER_SOFT=y diff --git a/examples/utest/testcases/kernel/timer_tc.c b/examples/utest/testcases/kernel/timer_tc.c index e965abe49b..e7fffcb617 100644 --- a/examples/utest/testcases/kernel/timer_tc.c +++ b/examples/utest/testcases/kernel/timer_tc.c @@ -103,7 +103,7 @@ static void test_static_timer_init(void) } /* wait for timerout */ - rt_thread_mdelay(time_out + 5); + rt_thread_delay(time_out + 1); /* detach timer */ result = rt_timer_detach(&timer.static_timer); @@ -145,7 +145,7 @@ static void test_static_timer_init(void) } /* wait for timerout */ - rt_thread_mdelay(time_out + 5); + rt_thread_delay(time_out + 1); /* detach timer */ result = rt_timer_detach(&timer.static_timer); @@ -238,7 +238,7 @@ static void test_static_timer_control(void) return; } - rt_thread_mdelay(set_data + 5); + rt_thread_delay(set_data + 1); /* detach timer */ result = rt_timer_detach(&timer.static_timer); @@ -329,7 +329,7 @@ static void test_dynamic_timer_create(void) } /* wait for timerout */ - rt_thread_mdelay(time_out + 5); + rt_thread_delay(time_out + 1); /* detach timer */ result = rt_timer_delete(timer.dynamic_timer); @@ -370,7 +370,7 @@ static void test_dynamic_timer_create(void) } /* wait for timerout */ - rt_thread_mdelay(time_out + 5); + rt_thread_delay(time_out + 1); /* detach timer */ result = rt_timer_delete(timer.dynamic_timer); @@ -462,7 +462,7 @@ static void test_dynamic_timer_control(void) return; } - rt_thread_mdelay(set_data + 5); + rt_thread_delay(set_data + 1); /* detach timer */ result = rt_timer_delete(timer.dynamic_timer);