Skip to content

Conversation

@westcity-YOLO
Copy link
Contributor

@westcity-YOLO westcity-YOLO commented Nov 30, 2025

为什么提交这份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):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/ALL_BSP_COMPILE.json 详细请参考链接BSP自查

@github-actions github-actions bot added the Kernel PR has src relate code label Nov 30, 2025
@github-actions
Copy link

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。
To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page
    点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  • 将目标分支设置为 \ Set the target branch to:doc
  • 设置PR number为 \ Set the PR number to:10985
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将自动推送至你的分支。
    The formatted code will be automatically pushed to your branch.

完成后,提交将自动更新至 doc 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the doc branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐
If you have any questions, feel free to reach out. Thanks again for your contribution!

@github-actions
Copy link

📌 Code Review Assignment

🏷️ Tag: kernel

Reviewers: @GorrayLi @ReviewSun @hamburger-os @lianux-mm @wdfk-prog @xu18838022837

Changed Files (Click to expand)
  • src/utest/mempool_tc.c
  • 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
  • src/utest/semaphore_tc.c

📊 Current Review Status (Last Updated: 2025-11-30 22:25 CST)


📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

Copy link
Contributor

Copilot AI left a 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
Copy link

Copilot AI Dec 7, 2025

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"

Suggested change
* - Execute via: `utest_run core.mempool` in msh
* - Executable via: `utest_run core.mempool` in msh

Copilot uses AI. Check for mistakes.
*/

/**
* Test Case Name: Kernel Core MemPool Functional Test
Copy link

Copilot AI Dec 7, 2025

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"

Suggested change
* Test Case Name: Kernel Core MemPool Functional Test
* Test Case Name: Kernel Core Memory Pool Functional Test

Copilot uses AI. Check for mistakes.
* 2025-11-30 westcity-YOLO Add standardized utest documentation block
*/

/*
Copy link

Copilot AI Dec 7, 2025

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: ...
Suggested change
/*
/**

Copilot uses AI. Check for mistakes.
* 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
Copy link

Copilot AI Dec 7, 2025

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"

Suggested change
* - Test runs via: `utest_run core.perf_test` in msh
* - Executable via: `utest_run core.perf_test` in msh

Copilot uses AI. Check for mistakes.
* - Test runs via: `utest_run core.perf_test` in msh
*/


Copy link

Copilot AI Dec 7, 2025

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 编码标准,要求代码整洁,不包含不必要的空格。

请删除此行的尾随空格。

Suggested change

Copilot uses AI. Check for mistakes.
* [ 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
Copy link

Copilot AI Dec 7, 2025

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"

Suggested change
* - Test executed via: `utest_run core.context_switch` in msh
* - Executable via: `utest_run core.context_switch` in msh

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Kernel PR has src relate code

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

1 participant