Skip to content

Support TESTING sidebar. - #337

Open
Meha555 wants to merge 3 commits into
xmake-io:devfrom
Meha555:feat/testing
Open

Support TESTING sidebar.#337
Meha555 wants to merge 3 commits into
xmake-io:devfrom
Meha555:feat/testing

Conversation

@Meha555

@Meha555 Meha555 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Resolve: #334

image

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces comprehensive test explorer integration and CodeLens support for XMake tests in VS Code, adding test discovery, execution, and result parsing capabilities. Key feedback includes checking the exit code of the pre-test build process to handle build failures, checking cancellation tokens before spawning child processes, and avoiding copying memory in 'bytes2string' by referencing the underlying array buffer. Additionally, the reviewer recommends awaiting 'xmake.start()' instead of using a fragile 'setTimeout' delay for startup test discovery, resolving regex inconsistencies in the test result parser to support integer durations, and declaring helper functions in the Lua test runner as 'local' to prevent global namespace pollution.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/testRunner.ts Outdated
Comment thread src/process.ts Outdated
Comment thread src/bytes2string.ts Outdated
Comment thread src/extension.ts Outdated
Comment thread src/testResultParser.ts Outdated
Comment thread assets/test_run.lua Outdated
Meha555 added 2 commits June 6, 2026 01:49
Remove some meaningless tests.
Make corrections based on review comments.
Comment thread assets/test_discover.lua
{
function()
config.load()
config_loaded = true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config.load() will not throw an exception, so a try-catch block is meaningless.

Comment thread assets/test_run.lua
-- generate report
spent = os.mclock() - spent
report.spent = spent
report.passed_rate = math.floor(report.passed * 100 / report.total)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a direct port of the test/main.lua implementation, but this is difficult to maintain; xmake's implementation changes with each version upgrade. Why not just call xmake test directly, which can test specific test suites?

@waruqi

waruqi commented Jun 6, 2026

Copy link
Copy Markdown
Member

I don't have time to review large patches, so I try to break them down into the smallest possible set of patches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

鏀寔Testing椤电

2 participants