-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[docs][utest]:Add standardized documentation for semaphore Test、Memory Pool Test and Performance Test #10985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: kernelReviewers: @GorrayLi @ReviewSun @hamburger-os @lianux-mm @wdfk-prog @xu18838022837 Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2025-11-30 22:25 CST)
📝 Review Instructions
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds standardized documentation blocks to 9 utest test case files, improving code documentation for semaphore tests, memory pool tests, and various performance tests.
Key Changes:
- Added comprehensive test case documentation blocks to all 9 files with test objectives, scenarios, verification metrics, dependencies, and expected results
- Updated Change Logs with new contributor entry for documentation additions
- Standardized documentation format across functional and performance test files
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/utest/semaphore_tc.c |
Added documentation block describing semaphore functional test objectives, scenarios (static/dynamic init, ISR tests), and verification metrics |
src/utest/mempool_tc.c |
Added documentation block for memory pool functional test covering static/dynamic operations, exhaustion tests, and stress scenarios |
src/utest/perf/thread_sem_tc.c |
Added documentation block for semaphore performance test measuring synchronization latency with priority inheritance |
src/utest/perf/thread_mq_tc.c |
Added documentation block for message queue performance test measuring message passing latency |
src/utest/perf/thread_mbox_tc.c |
Added documentation block for mailbox performance test measuring mailbox object synchronization |
src/utest/perf/thread_event_tc.c |
Added documentation block for event performance test measuring event flag handling latency |
src/utest/perf/perf_tc.c |
Added documentation block for comprehensive performance benchmark suite covering context switch and IPC mechanisms |
src/utest/perf/irq_latency_tc.c |
Added documentation block for IRQ latency performance test measuring interrupt-to-thread response time |
src/utest/perf/context_switch_tc.c |
Added documentation block for context switch performance test measuring thread switching overhead |
| * - All 7 scenarios pass | ||
| * - 0 memory leaks | ||
| * - Stress test <10ms | ||
| * - Execute via: `utest_run core.mempool` in msh |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] 🟡 [spelling]: Inconsistent terminology / 术语不一致
English: The term "Execute via" is used here, while other documentation blocks in the same PR use "Executable via". For consistency across all test documentation, please use the same wording. Recommended: "Executable via: utest_run core.mempool in msh"
中文: 此处使用了 "Execute via",而同一 PR 中的其他文档块使用 "Executable via"。为了所有测试文档的一致性,请使用相同的措辞。建议使用:"Executable via: utest_run core.mempool in msh"
| * - Execute via: `utest_run core.mempool` in msh | |
| * - Executable via: `utest_run core.mempool` in msh |
| */ | ||
|
|
||
| /** | ||
| * Test Case Name: Kernel Core MemPool Functional Test |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] 🟡 [naming]: Inconsistent naming with RT-Thread conventions / 命名与 RT-Thread 约定不一致
English: The test case name uses "MemPool" instead of the full term "Memory Pool" which is used elsewhere in RT-Thread documentation and in other test files. For consistency and clarity, use "Memory Pool" in the title.
Current: "Kernel Core MemPool Functional Test"
Suggested: "Kernel Core Memory Pool Functional Test"
中文: 测试用例名称使用了 "MemPool" 而不是在 RT-Thread 文档和其他测试文件中使用的完整术语 "Memory Pool"。为了保持一致性和清晰度,标题中应使用 "Memory Pool"。
当前:"Kernel Core MemPool Functional Test"
建议:"Kernel Core Memory Pool Functional Test"
| * Test Case Name: Kernel Core MemPool Functional Test | |
| * Test Case Name: Kernel Core Memory Pool Functional Test |
| * 2025-11-30 westcity-YOLO Add standardized utest documentation block | ||
| */ | ||
|
|
||
| /* |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟠 [documentation]: Incorrect comment block format / 注释块格式错误
English: The documentation block uses /* instead of /** for the opening delimiter. RT-Thread code documentation should use Doxygen-style comment blocks starting with /** for proper documentation generation.
Please change:
/*
* Test Case Name: ...To:
/**
* Test Case Name: ...中文: 文档块使用了 /* 而不是 /** 作为开始分隔符。RT-Thread 代码文档应使用以 /** 开头的 Doxygen 风格注释块,以便正确生成文档。
请将:
/*
* Test Case Name: ...改为:
/**
* Test Case Name: ...| /* | |
| /** |
| * Test No | Test Name | Count | Total/Max/Min/Avg Time (us) | ||
| * - Final line: "=== Performance Test Results End ===" | ||
| * - utest framework reports: [ PASSED ] [ result ] testcase (core.perf_test) | ||
| * - Test runs via: `utest_run core.perf_test` in msh |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] 🟡 [spelling]: Inconsistent terminology / 术语不一致
English: The term "Test runs via" is used here, while other documentation blocks in the same PR use "Executable via". For consistency across all test documentation, please use the same wording. Recommended: "Executable via: utest_run core.perf_test in msh"
中文: 此处使用了 "Test runs via",而同一 PR 中的其他文档块使用 "Executable via"。为了所有测试文档的一致性,请使用相同的措辞。建议使用:"Executable via: utest_run core.perf_test in msh"
| * - Test runs via: `utest_run core.perf_test` in msh | |
| * - Executable via: `utest_run core.perf_test` in msh |
| * - Test runs via: `utest_run core.perf_test` in msh | ||
| */ | ||
|
|
||
|
|
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 [best_practices]: Trailing whitespace / 尾随空格
English: Line 50 contains trailing whitespace. This violates RT-Thread coding standards which require clean code without unnecessary whitespace.
Please remove the trailing space on this line.
中文: 第 50 行包含尾随空格。这违反了 RT-Thread 编码标准,要求代码整洁,不包含不必要的空格。
请删除此行的尾随空格。
| * [ PASSED ] [ result ] testcase (core.context_switch) | ||
| * - Performance data printed in structured table format | ||
| * - Final line: "=== Context Switch Test Results End ===" | ||
| * - Test executed via: `utest_run core.context_switch` in msh |
Copilot
AI
Dec 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] 🟡 [spelling]: Inconsistent terminology / 术语不一致
English: The term "Test executed via" is used here, while other documentation blocks in the same PR use "Executable via". For consistency across all test documentation, please use the same wording. Recommended: "Executable via: utest_run core.context_switch in msh"
中文: 此处使用了 "Test executed via",而同一 PR 中的其他文档块使用 "Executable via"。为了所有测试文档的一致性,请使用相同的措辞。建议使用:"Executable via: utest_run core.context_switch in msh"
| * - Test executed via: `utest_run core.context_switch` in msh | |
| * - Executable via: `utest_run core.context_switch` in msh |
为什么提交这份PR (why to submit this PR)
Relates to #10895
一共完成三个注释九分文件如下:
Memory Pool Test:
src/utest/mempool_tc.c
semaphore Test:
src/utest/semaphore_tc.c
Performance Test:
src/utest/perf/context_switch_tc.c
src/utest/perf/irq_latency_tc.c
src/utest/perf/perf_tc.c
src/utest/perf/thread_event_tc.c
src/utest/perf/thread_mbox_tc.c
src/utest/perf/thread_mq_tc.c
src/utest/perf/thread_sem_tc.c
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up