Commit Graph

244 Commits

Author SHA1 Message Date
Old-Ding 50c6853d38 rt-link: reject frame offset at frame limit
The receive sequence filter maps incoming data-frame sequence numbers to zero-based frame offsets. RT_LINK_FRAMES_MAX is the maximum number of split frames, so valid offsets are 0 through RT_LINK_FRAMES_MAX - 1.

Reject offset == RT_LINK_FRAMES_MAX before frame handling instead of letting it reach long-frame assembly.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-07 19:55:21 +08:00
CYFS e97530fea8 [components][spi] add utest cases 2026-07-04 16:45:24 +08:00
Old-Ding b118fcab2e [components][ulog] include stdlib.h for atoi 2026-06-30 16:12:41 +08:00
CYFS 659023b98c [utest] fix testcase init failure summary 2026-06-23 15:00:23 +08:00
CYFS f922adeb07
[utest][pin] add pin loopback utest (#11445)
* [utest][pin] add pin loopback utest

* [utest][pin] add BSP CI coverage

* [utest][pin] fix BSP CI config

* [utest][pin] fix ra8p1 utest link section
2026-06-22 16:03:58 +08:00
GuEe-GUI 6fc3e18912 fix: stabilize smp_bind_affinity_tc on SMP CI
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 <2991707448@qq.com>
2026-06-17 09:51:13 +08:00
CYFS 38c5ff0e56 utest: move ci configs to github directory
Signed-off-by: CYFS <2805686936@qq.com>
2026-06-12 14:22:53 +08:00
CYFS bb4aace00f utest: move utestcases Kconfig to utest component
Signed-off-by: CYFS <2805686936@qq.com>
2026-06-12 14:22:53 +08:00
wdfk-prog 94df46c5fd Modify the ymodem component to support multi-file reception
Co-authored-by: CUGLIJIE
2026-05-07 12:59:14 +08:00
wdfk-prog d8546a9a0f fix(ymodem): improve send read loop and unify session cleanup
- Accumulate short reads, mark finishing on EOF
- Track begin/end callback states and cleanup on error paths
- Add ACK handling with retry/error counting in send flow
2026-02-27 09:54:28 +08:00
wdfk-prog e5e29350b8 fix(ulog): Avoid async ulog empty wakeups and missed notifications 2026-02-13 11:00:13 +08:00
wdfk-prog cbc759d6a5 refactor(ulog): Unify ulog warning output with ulog_warn_once 2026-02-13 11:00:13 +08:00
Bernard Xiong f7b3a8fedd
[rt-link] fix the compiling issue under 64bit arch #11018 2025-12-08 09:15:41 +08:00
wdfk-prog e1f609fe3a feat(ulog): Add a one-time warning when the log line buffer is insufficient 2025-11-18 09:55:37 +08:00
wdfk-prog 4ee00eba9b feat[ulog]: 增加 Kconfig 选项以控制 Finsh/MSH 命令 2025-11-07 11:16:46 +08:00
wdfk-prog e5556be19f fix:[ulog][backend]filter不应与ULOG_USING_COLOR及ULOG_USING_SYSLOG配置有关 2025-10-27 17:09:09 +08:00
Yuqiang Wang 8816a9dc1b
utest/msh: supports autocomplete of utest cases for utest_run (#10701)
* utest/msh: supports autocomplete of utest cases for utest_run

* docs/utest: explanation of adding the automatic completion function for utest_run

* fix[utest]: Improvement of annotation description

* remove outdated code
2025-10-20 12:46:44 +08:00
Chen Wang c1363c77d6 utest: Improve the strings displayed in the menu
Use "Test" instead of "Unit Testcases" to make string shorter.
Use uppercase to make it look more eye-catching.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-10-16 18:34:43 +08:00
Chen Wang df4fdc0087 utest: UTEST_SELF_PASS_TC -> RT_UTEST_SELF_PASS
Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-10-15 09:43:16 +08:00
Chen Wang 495c8cfc25 utest: remove RT_UTEST_USING_ALL_CASES
Many modules' utests currently don't support enabling all
tests at once. Furthermore, some modules' tests are complex,
for example due to their numerous dependencies on other
modules. This makes it nearly impossible to enable all
tests with a single global switch. Consequently, the
previously defined `RT_UTEST_USING_ALL_CASES` has lost
its original meaning.

We recommend deprecating this configuration switch. If a
module needs to enable a group of functional tests through
its own configuration, this local enable all switch should
be implemented by the module itself, and a global RTT enable
switch will no longer be provided.

If such a requirement arises in the future, we recommend
careful design, especially considering how to ensure that
turning on a single switch enables all dependencies for
all involved modules for ease of use.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-09-26 09:57:54 +08:00
Yonggang Luo 66b2bcc080 RT_TIMER_CTRL_SET_TIME only accept rt_tick_t, pass rt_tick_t instead int/rt_int32_t 2025-09-24 18:12:36 +08:00
Chen Wang b03bb709b9 utest: update naems using new rule
The names of the utest cases defined in their respective
modules have been updated.

Some utest case names are not yet in their respective modules
because their paths need to be finalized before their unique
names can be determined. Currently, these names do not
appear to conflict with the unified names. These include:

- utest cases still in examples
- bsp/qemu-virt64-riscv/applications/test/test_vector/test_vector.c.
  The entire test case should probably be placed in libcpu/risc-v
  rather than bsp.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-09-15 19:40:31 +08:00
wdfk-prog 6881f96ea5 feat: Initialize local variables to prevent GCC compilation warnings 2025-09-06 10:51:57 +08:00
Chen Wang c0142c786e
utest/utest: intergare testcases into utest framework (#10665)
* utest: move testcases of Utest from example to Utest folder

Create unit-test-cases for the Utest framework subsystem
according to "How to add utest cases into RT-Thread for your module." [1]

Link:
https://rt-thread.github.io/rt-thread/page_component_utest.html#autotoc_md804
[1]

The original `components/utilities/utest` directory already has unit
testcases, which are more comprehensive than the testcases in
`examples/utest/testcases/utest/`. Therefore, simply deleted
the test cases in `examples` and used the existing testcases
in the utest framework.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>

* utest/utest: rename name and add license text

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>

---------

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-09-02 18:48:07 +08:00
maosql 9567564e86 fix: warnings generated by Kconfig. 2025-09-01 11:50:41 +08:00
Chen Wang 01ca3911ec componnets: utest: fix case-name matching problem
There is a problem with the matching of case names
in the original code. Due to original code use memcmp
with len, if the input case name and the existing
case name have an inclusion relationship, for example,
if the actual case name is "gpip_irq", and run
`utest_run gpio` will also match successfully, but it's
not expected.

Modify the logic of exact matching and use strcmp instead.
Keep the original wildcard logic, that is,
`utest_run gpio*` can match both "gpio_irq" and "gpio".

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-06-10 19:22:25 +08:00
Bernard Xiong 50998f4e43
[building] rename the group name: LIBADT to Utilities. (#10267)
* [building] rename the group name: LIBADT to Utilities.
2025-05-16 07:31:18 +08:00
Yuqiang Wang ad79383fa3
feat: ci script associated with auto_utest. (#9933)
* feat: ci script associated with auto_utest.
2025-03-10 11:08:21 +08:00
Rbb666 91beec4239 [ulog]Fix the problem of file_buf being released incorrectly 2025-02-18 14:31:03 +08:00
Meco Man da6c62c293 [utest] fix twice operation of uassert 2025-01-15 10:26:40 +08:00
Meco Man bdd9447d70 [utest] make RT_USING_CI_ACTION to be clear
RT_USING_CI_ACTION will select RT_UTEST_USING_AUTO_RUN and RT_UTEST_USING_ALL_CASES
2025-01-09 17:45:15 -05:00
Meco Man 88920fd814 [utest] 修复UTEST_UNIT_RUN嵌套宏时将宏直接输出的问题 2025-01-07 20:44:29 -05:00
Meco Man 0a25fcffab [utest] add float operators
uassert_float_equal and uassert_float_not_equal
2025-01-07 20:44:29 -05:00
Meco Man d583615afe [utest] add rt_memset test case 2025-01-03 13:42:21 +08:00
Meco Man 26828a175e [utest] implement uassert_ptr_equal and uassert_ptr_not_equal 2024-12-24 13:42:04 +08:00
Meco Man a9746edc08 [utest] optimize the utest to support new CI 2024-12-21 14:57:17 -05:00
Meco Man 7772d4619a [klibc] format code 2024-12-21 14:57:17 -05:00
Chen Wang 7c7ff6e532 kernel: cleanup debug APIs
- `dbg_log` is a “NOT RECOMMENDED API”, convert the calling of this
  API to LOG_x and remove this API.

- `dbg_here`/`dbg_enter`/`dbg_exit`: no one use these APIs, remove
  them directly.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2024-12-20 17:50:00 -05:00
ligr ca1d4e6dea [components][ulog]add some comments to ulog for supplement. 2024-11-26 20:05:09 +08:00
Meco Man 8e10983c9b [klibc] add rt_vsnprintf_std.c and rename RT_KLIBC_USING_VSNPRINTF_LONGLONG 2024-11-24 11:29:28 +08:00
Meco Man 09f47c55a9 [utest] format code and remove duplicate header file 2024-11-18 09:58:55 +08:00
sulfurandcu 85bd74640e [Bug] [ymodem] last frame's data_sz issue, fixed. 2024-10-07 23:13:41 -04:00
wdfk-prog ff6d5b13f0
[components][ulog] ULOG_OUTPUT_LEVEL未定义时,level_output_info产生警告 2024-10-03 19:19:24 -04:00
张衍 0e3c4bd26b [BSP/Phytium]适配最新裸机驱动 2024-07-22 02:33:39 +00:00
Rui 3b1d4e9222
fix Compilation error in "driver.c", "completion_up.c", "syslog.c" and "dlmodule.c". (#9093) 2024-06-26 23:25:23 +08:00
latercomer d58c29d23e 除了bsp之外的Kconfig使用rsource替代source 2024-06-20 14:40:42 +08:00
Shell 540370e4de
[utest] remove delay for on thread testing (#9053)
* [utest] remove delay for on thread testing

The delay is introduced from 0dc7b9a5a2.

Though this is unnecessary for on sync utest.
So this is removed by a new entry and delay for asynchronous utest only.

Signed-off-by: Shell <smokewood@qq.com>

* fixup: msh cmd prototype

---------

Signed-off-by: Shell <smokewood@qq.com>
2024-06-12 19:48:51 +08:00
latercomer 6bfe740f27 解决LOG_RAW异步输出多条文本的时候会被截断,原因是rt_vsnprintf会在字符串最后添加\0,ulog.c中的do_output()将\0也压入到ulog.async_rb,当LOG_RAW没有及时输出,那么rb中的字符串被\0截断了,导致没法正确输出LOG_RAW信息 2024-04-19 22:27:33 -04:00
Eric LGF 58ecde786f
[ymodem] fix the cmd "sy" without close file 2024-04-13 08:11:31 -04:00
Shell 83e95bdff4
sync smart & dfs (#8672)
Signed-off-by: xqyjlj <xqyjlj@126.com>
Signed-off-by: Shell <smokewood@qq.com>
Co-authored-by: xqyjlj <xqyjlj@126.com>
2024-03-28 23:42:56 +08:00