You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[test] by target: a package's test programs selected by cfg, as sources are #942
A package's test programs cannot be selected by target. [target.'cfg(...)'.build] sources gates library sources per target, but every file under tests/ is built and run on every target the package builds for.
Why it matters
A package that runs on the Web (platforms lists emscripten) cannot hold a test that needs a native-only dev-dependency (an SDL window host, a GPU backend on SDL_GPU, a native muxer). The only way today is a second package beside it, native only, holding those tests and programs. In one workspace (177 packages) this accounts for a good share of the packages that exist only for that reason, for example:
a game whose rules and headless runtime run on the Web, and whose window test needs the native headless host: two packages;
a simulation kernel, its suite and presenter (Web), and the same suite run on SDL_GPU (native): a 29-line package of its own;
a library on the Web whose native tool is a separate package.
Asked
Test programs selectable by target, the way sources are, for example:
(target-specific dev-dependencies may already work; the missing half is the test files). Together with #941 ([test] features), this lets a package hold its own tests for each target and feature set instead of one package per combination.
Implemented in mcpp 2026.11.16.1 (#940): [target.'<cfg>'.test] discover adds test programs per target, with the same ! semantics as [test] discover. See docs/08-testing.md.
Activity
A package's tests are selected by target and built with the features …
2026.11.16.1: ecosystem gap supplement -- launchers, naming, build de…
speak-agent commentedon Nov 16, 2026
Implemented in mcpp 2026.11.16.1 (#940):
[target.'<cfg>'.test] discoveradds test programs per target, with the same!semantics as[test] discover. See docs/08-testing.md.