summaryrefslogtreecommitdiff
path: root/src/utest
AgeCommit message (Collapse)Author
10 days[kernel] fix calloc overflowluchenxu
13 days[utest][perf] Fix clock time dependency and test build guardCYFS
2026-08-21[kernel][ipc] Fix timeout wakeup ownership raceari.liu
Keep thread timer ownership when timer stop races with an in-flight timeout callback, and consume IPC resources only after a waiter is resumed successfully. Complete ownership cleanup in the generic and RT-Smart channel timeout callbacks. Add deterministic scheduler and LWP regressions for Event, Semaphore, Mailbox, Message Queue, sender, and receiver paths.
2026-07-22[mutex] 跨线程 rt_thread_delete 被删线程持有的mutex也一并释放蒙蒙plus
- 增加单元测试 Clarified mutex release conditions and added exception handling for closed owner threads.
2026-06-26utest: fix hooklist testcase reinitCYFS
2026-06-17fix: stabilize smp_bind_affinity_tc on SMP CIGuEe-GUI
This change fixes intermittent failures of the `core.smp_bind_affinity` utest across SMP CI targets. The original failure was a flaky assertion on unbound threads (`thread_inc[x] != thread_tic[x]` in thread_entry), not incorrect bind_cpu behavior. CI logs already showed T0 binding worked (thread_inc[0] == thread_tic[0] == 100) while the not_equal check failed. The root issue is that unbound-thread CPU placement is platform-dependent and outside the bind_cpu contract. On dual-core RISC-V/ARMv7 CI, an unbound thread may legitimately run all iterations on core 0 while T0 delays on the same core, so any assertion requiring cross-core migration (thread_inc != thread_tic, or core_mask with multiple bits) remains flaky. This patch narrows the test to what bind_affinity actually verifies: T0 bound to core 0 must always execute on core 0. Unbound threads only add scheduling pressure; their core_mask is printed for observation but not asserted. Changes: - Sample `rt_hw_cpu_id()` and update counters under `rt_sched_lock` to avoid migration skew between counting and CPU sampling. - Track `thread_core_mask` for diagnostics; assert only T0 binding via `thread_inc[0] == thread_tic[0]` and `thread_core_mask[0] == 1`. - Remove flaky unbound-thread assertions (`thread_inc != thread_tic` and multi-core core_mask checks). - Move T0 assertions to the main test thread after all workers finish. - Use atomic `finsh_flag`; reset counters and `threads[]` in `utest_tc_init`. - Spin in worker loops after `run_num` until cleanup deletes them (do not return from thread_entry or use `RT_WAITING_FOREVER` with `rt_thread_delay`). - Guard `rt_thread_delete` in cleanup with non-NULL checks. Signed-off-by: GuEe-GUI <[email protected]>
2026-06-08[bsp][zynqmp-a53-dfzu2eg] enable full dmGuEe-GUI
This is a builtin fdt example BSP Signed-off-by: GuEe-GUI <[email protected]>
2026-04-19[action][utest]:Expand kernel auto-run matrix and sync test configsCYFS
2026-01-31[components][clock_time] Refactor time subsystem around clock_time (#11111)Bernard Xiong
* [components][clock_time] Refactor time subsystem around clock_time Introduce the clock_time core with clock source/event separation, high-resolution scheduling, and boot-time helpers, plus clock_timer adapters for timer peripherals. Remove legacy ktime/cputime/hwtimer implementations and migrate arch and BSP time paths to the new subsystem while keeping POSIX time integration functional. Update drivers, Kconfig/SConscript wiring, documentation, and tests; add clock_time overview docs and align naming to clock_boottime/clock_hrtimer/clock_timer. * [components][clock_time] Use BSP-provided clock timer frequency on riscv64 * [risc-v] Use runtime clock timer frequency for tick and delays * [bsp] Add clock timer frequency hooks for riscv64 boards * [bsp] Update Renesas RA driver doc clock_timer link * [bsp] Sync zynqmp-r5-axu4ev rtconfig after config refresh * [bsp][rk3500] Update rk3500 clock configuration * [bsp][hpmicro] Add rt_hw_us_delay hook and update board delays * [bsp][stm32l496-st-nucleo] enable clock_time for hwtimer sample in ci * [bsp][hpmicro] Fix rtconfig include scope for hpm6750evk Move rtconfig.h include outside the ENET_MULTIPLE_PORT guard for hpm6750evk and hpm6750evk2 so configuration macros are available regardless of ENET settings. * [bsp][raspi3] select clock time for systimer * [bsp][hpm5300evk] Trim trailing blank line * [bsp][hpm5301evklite] Trim trailing blank line * [bsp][hpm5e00evk] Trim trailing blank line * [bsp][hpm6200evk] Trim trailing blank line * [bsp][hpm6300evk] Trim trailing blank line * [bsp][hpm6750evk] Trim trailing blank line * [bsp][hpm6750evk2] Trim trailing blank line * [bsp][hpm6750evkmini] Trim trailing blank line * [bsp][hpm6800evk] Trim trailing blank line * [bsp][hpm6e00evk] Trim trailing blank line * [bsp][nxp] switch lpc178x to gcc and remove mcx timer source * [bsp][stm32] fix the CONFIG_RT_USING_CLOCK_TIME issue. * [docs][clock_time] add clock time documentation * [docs][clock_time] Update clock time subsystem documentation - Update device driver index to use correct page reference - Clarify upper layer responsibilities in architecture overview - Update README to describe POSIX/libc, Soft RTC, and device driver usage - Refine architecture diagram with improved layout and color scheme - Remove obsolete clock_timer.md file * [kernel][utest] Trim trailing space * [clock_time] Fix hrtimer wrap handling * [clock_time] fix the static rt_inline issue * [clock_time] fix the rt_clock_hrtimer_control result issue
2026-01-15Add standardized utest documentation blockwestcity-YOLO
2025-12-14Most test cases in `src/utest` lack standardized functional documentation, ↵lhxj
as tracked in issue [#10895](https://github.com/RT-Thread/rt-thread/issues/10895). This leads to high maintenance costs, difficulty for new contributors, and inefficient code reviews. Solution: This patch adds the full, standardized documentation block to `sched_mtx_tc.c`, `sched_sem_tc.c`, `sched_thread_tc.c`, `sched_timed_mtx_tc.c` and `sched_timed_sem_tc.c` following the approved template. The documentation details: - Test Objectives and tested APIs - Test Scenarios - Verification Metrics - Dependencies - Test Execution command and Expected Results This makes the test case's purpose and behavior immediately clear to future maintainers and reviewers. Relates to [#10895](https://github.com/RT-Thread/rt-thread/issues/10895) Signed-off-by: lhxj <[email protected]>
2025-12-11 [utest][smp]Add descriptions for the SMP test cases (interrupt_pri and ↵Teng mengchen
spinlock) #11011
2025-12-10[docs][utest]:Add comments for smp_thread_preemptionTm-C-mT
Add comments for smp_thread_preemption. Signed-off-by: Mengchen Teng <[email protected]>
2025-12-10[utest]:Modify the execution logic of smp_thread_preemptionsTm-C-mT
Currently, the print information of this test case fails to demonstrate that the high-priority thread has preempted the low-priority thread. This is because when the high-priority thread prints the thread list, there is no information about the low-priority thread (tlow), as tlow has already completed execution and been destroyed. Therefore, the current execution logic cannot confirm the successful completion of the preemption operation. Solution: After the low-priority thread (tlow) releases the lock, add a busy-wait loop while(!finish_flag);. At this point, when the high-priority thread (thigh) prints the thread list information, tlow can be observed in the ready state, indicating that it has been preempted by thigh. Signed-off-by: Mengchen Teng <[email protected]>
2025-12-04[utest]: Solve the address misalignment issue of atomic operationsTm-C-mT
In smp_assigned_idle_cores_tc, the finish_flag involves atomic operations and thus requires address alignment. Signed-off-by: Mengchen Teng <[email protected]>
2025-11-26[docs][utest]:Add comments for smp_bind_affinityTm-C-mT
Add comments for smp_bind_affinity, And fixed some comment issues in smp_affinity_pri2_tc. Signed-off-by: Mengchen Teng <[email protected]>
2025-11-26[docs][utest]:Add comments for smp_affinity_pri2Tm-C-mT
Add comments for smp_affinity_pri2 Signed-off-by: Mengchen Teng <[email protected]>
2025-11-26[docs][utest]:Add comments for smp_affinity_pri1Tm-C-mT
Add comments for smp_affinity_pri1 Signed-off-by: Mengchen Teng <[email protected]>
2025-11-23docs(utest):Add standardized documentation for Mailbox TestChuan
Signed-off-by: ChuanN-sudo <[email protected]>
2025-11-22[docs]:Add standardized function comment blocks for mutex_tc4444x
2025-11-21[utest]Refactor object_tc.c, add stress and error-path coverage (#10961)R b b666
2025-11-19[docs][utest]:Add explanatory comments for the utest of thread allocation ↵Tm-C-mT
for idle harts Add explanatory comments for the utest of smp_assigned_idle_cores. Signed-off-by: Mengchen Teng <[email protected]>
2025-11-19[utest]: Modify the utest logic for thread allocation of idle hartsTm-C-mT
Currently, this utest cannot determine whether threads are evenly distributed across idle harts by observing the result of list_thread(). This is because the presence of rt_thread_delay(5); causes all other threads to be in the suspended state when thread information is printed. For example, if RT_CPUS_NR=4, T0 executes list_thread() to print information, while T1~T3 are in hibernation and thus it is impossible to observe which hart they are running on. Solution:Here, the completion judgment condition has been modified. For example, when RT_CPUS_NR=4, only RT_CPUS_NR-1 threads will be created (i.e., T0 to T2), because running the utest occupies one hart. The execution is judged as completed when finish_flag=0x0007, and the thread running the utest will call list_thread() to print the information. Observe whether T0 to T2 are running on different harts simultaneously. Signed-off-by: Mengchen Teng <[email protected]>
2025-11-19feature: utest: add standardized utest documentation to messagequeue_tcZe-Hou
Signed-off-by: Ze-Hou <[email protected]>
2025-11-19feature: utest: add standardized utest documentation to timer_tcZe-Hou
Signed-off-by: Ze-Hou <[email protected]>
2025-11-18[utest]Fixed assertion failure in the smp_affinity_pri2_tc use case caused ↵R b b666
by improper priority configuration. (#10956)
2025-11-18[utest]Fixed assertion failure in the smp_affinity_pri1_tc use case caused ↵Rbb666
by improper priority configuration.
2025-11-18[docs]utest]:Add standardized utest documentation to atomic_tc and ↵David Frisbee
mtsafe_kprint_tc #10945
2025-11-18[utest]Fixed compilation warning issues in smp/smp_affinity_prix_tc.Rbb666
2025-11-18feature: utest: add standardized utest documentation to event_tcZe-Hou
Signed-off-by: Ze-Hou <[email protected]>
2025-11-17[fix][utest] correct spelling of 'pref_test' to 'perf_test' (#10937)David Frisbee
* [fix][utest] correct spelling of ''pref_test' to 'perf_test'
2025-11-14[docs][utest]:Add standardized utest documentation block for slab_tcCYFS
2025-11-14[docs][utest]:Add standardized utest documentation block for object_tcCYFS
2025-11-14[docs][utest]:Add standardized utest documentation block for mem_tcCYFS
2025-11-14[docs][utest]:Add standardized utest documentation block for memheap_tcCYFS
2025-11-13feature: utest: add standardized utest documentation to thread_tcZe-Hou
Signed-off-by: Ze-Hou <[email protected]>
2025-11-13feature: utest: add standardized utest documentation to hooklist_tcZe-Hou
Signed-off-by: Ze-Hou <[email protected]>
2025-11-11[utest]: [signal]: Add Standardized function comment blocks. (#10914)Teng mengchen
* [utest]: [signal]:Standardized function comment blocks have been added. Added comments to the utest for the signal module, including: test purpose, usage scenarios, dependency configurations, expected outcomes, and expected behaviors. Signed-off-by: Mengchen Teng <[email protected]> * [utest]: [signal]:Correct issues including grammatical errors, spelling mistakes, and ambiguities in function names. Fixed the issue of grammatical errors in words; changed the variable 'recive_sig' to 'receive_sig'. Originally, rt_signal_unmask_test was testing the masking function of rt_signal_mask, while rt_signal_mask_test was verifying whether signals could be sent correctly during unmasking——the function names were exactly opposite to their functions. Now the two function names have been swapped, and the corresponding comments have also been updated accordingly.After modification, it has been verified that the signal-related utests can be executed correctly. Signed-off-by: Mengchen Teng <[email protected]> --------- Signed-off-by: Mengchen Teng <[email protected]>
2025-11-10docs(utest): Add standardized documentation for core.irq (irq_tc.c) (#10913)lhxj
* docs(utest): Add standardized documentation for core.irq (irq_tc.c) Most test cases in `src/utest` lack standardized functional documentation, as tracked in issue #10895. This leads to high maintenance costs, difficulty for new contributors, and inefficient code reviews. Solution: This patch adds the full, standardized documentation block to `src/utest/irq_tc.c`, following the approved template. The documentation details: - Test Objectives and tested APIs - Test Scenarios (for `irq_test` and `interrupt_test`) - Verification Metrics (the `uassert` criteria) - Dependencies (Kconfig options and hardware) - Test Execution command and Expected Results This makes the test case's purpose and behavior immediately clear to future maintainers and reviewers. Relates to #10895 Signed-off-by: lhxj <[email protected]> * Update src/utest/irq_tc.c Co-authored-by: Copilot <[email protected]> --------- Signed-off-by: lhxj <[email protected]> Co-authored-by: Copilot <[email protected]>
2025-11-10action:Fixed assertion failure when running utest/messagequeue_tc multiple ↵Rbb666
times.
2025-11-08utest:Fix signal info node leak in signal_tc when running multiple times.Rbb666
2025-10-16utest: UTEST_MEMPOOL_TC -> RT_UTEST_MEMPOOLChen Wang
Which is missed in PR #10808 "utest: unify configname", add it. Signed-off-by: Chen Wang <[email protected]>
2025-10-16utest: Improve the strings displayed in the menuChen Wang
Use "Test" instead of "Unit Testcases" to make string shorter. Use uppercase to make it look more eye-catching. Signed-off-by: Chen Wang <[email protected]>
2025-10-16utest: reorg menu itemsChen Wang
The original project display was completely flat, now it is organized into a tree-like hierarchical structure based on the layout of the code. mm & tmpfs test are still keep as pervious bcos we have not move the source for these two components. Signed-off-by: Chen Wang <[email protected]>
2025-10-15utest: UTEST_SMP_THREAD_PREEMPTION_TC -> RT_UTEST_SMP_THREAD_PREEMPTIONChen Wang
Signed-off-by: Chen Wang <[email protected]>
2025-10-15utest: UTEST_SMP_SPINLOCK_TC -> RT_UTEST_SMP_SPINLOCKChen Wang
Signed-off-by: Chen Wang <[email protected]>
2025-10-15utest: UTEST_SMP_INTERRUPT_PRI_TC -> RT_UTEST_SMP_INTERRUPT_PRIChen Wang
Signed-off-by: Chen Wang <[email protected]>
2025-10-15utest: UTEST_SMP_ASSIGNED_IDLE_CORE_TC -> RT_UTEST_SMP_ASSIGNED_IDLE_COREChen Wang
Signed-off-by: Chen Wang <[email protected]>
2025-10-15utest: UTEST_SMP_AFFFINITY_TC -> RT_UTEST_SMP_AFFFINITYChen Wang
Signed-off-by: Chen Wang <[email protected]>
2025-10-15utest: UTEST_SCHEDULER_TC -> RT_UTEST_SCHEDULERChen Wang
Signed-off-by: Chen Wang <[email protected]>