Generated XCTest cases from build tool plugins are skipped or not discovered
## Summary
Build-tool-plugin-generated XCTest methods are not handled consistently by the VS Code Swift extension.
Using the attached reproduction package structure, generated tests may either:
- be discovered but shown as **Skipped**
- or not be discovered at all
## Reproduction
Repository:
https://github.com/tothambrus11/swift-vscode-test-discovery-problem-reproduction
This mirrors `hylo-new` closely:
- `CompilerTests` is an `XCTestCase` driver class
- fixture directories under `Tests/CompilerTests/negative` and `Tests/CompilerTests/positive` are excluded from the test target
- a `.buildTool` plugin generates `CompilerTests+GeneratedTests.swift` into the plugin work directory
- the generated file adds `test_negative_*` / `test_positive_*` methods in an extension of `CompilerTests`
## Steps
1. Open the reproduction folder as the VS Code workspace root.
2. Enable the Swift extension.
3. Wait for package/test discovery.
4. Inspect the Testing sidebar.
## Actual behavior
- Sometimes the generated tests are discovered but marked **Skipped**.
- Sometimes the generated tests are not discovered.
<img width="361" height="226" alt="Image" src="https://github.com/user-attachments/assets/03a35787-a5c2-4cb2-a409-6f55fb68fbc2" />
<img width="364" height="291" alt="Image" src="https://github.com/user-attachments/assets/8a02de8f-b04f-443b-b6ab-f18920fbf2b7" />
## Expected behavior
- The generated `test_negative_*` / `test_positive_*` XCTest methods should be discovered normally and should be runnable like regular XCTest methods.
## Notes
- `swift test` on the CLI discovers and runs the generated tests successfully.
- Reloading the VS Code window or cleaning the build folder may be needed to observe the change.
1 条评论