Support TESTING sidebar. - #337
Conversation
Resolve: xmake-io#334
There was a problem hiding this comment.
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.
Remove some meaningless tests.
Make corrections based on review comments.
| { | ||
| function() | ||
| config.load() | ||
| config_loaded = true |
There was a problem hiding this comment.
config.load() will not throw an exception, so a try-catch block is meaningless.
| -- generate report | ||
| spent = os.mclock() - spent | ||
| report.spent = spent | ||
| report.passed_rate = math.floor(report.passed * 100 / report.total) |
There was a problem hiding this comment.
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?
|
I don't have time to review large patches, so I try to break them down into the smallest possible set of patches. |
Resolve: #334