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] features: the features a package's own tests are built with #941
What is needed. A manifest key naming the features a package's own tests are built with, e.g.
[features]
ktx2 = { sources = ["src/ktx2/*.cppm", "src/ktx2/native/*.cpp"] }
[feature-deps.ktx2]
mcpplibs.mwrap.basis_universal = "2.50.1"
[test]
features = ["ktx2"] # tests/ is built with these on (in addition to the defaults)
Why.mcpp test --workspace builds each member's tests with its default features, and --features applies to one invocation. So a part of a library behind a non-default feature can only be tested in one of two ways today:
make the feature a default — then every consumer compiles (and depends on) it unless each writes default-features = false; or
keep the part in a package of its own, whose tests are its tests.
A workspace that wants few packages (one per library or product, its optional parts as features: a decoder needing a large third-party library, a window front end of a game whose core must not link the UI) ends up with option 2 everywhere, purely so the tests run. In our workspace (179 members) this decides a good share of the package count.
Expected behaviour.[test] features adds those features to the package's own test build (its tests/ programs and the library they link), in mcpp test -p X and in mcpp test --workspace; consumers of the package are unaffected (they still get its defaults or what they ask for). A feature listed that the package does not declare is refused at load, as --features refuses it.
Related: required_features on targets (docs/04 §2.2), which already lets a program depend on a feature; this is the same for the test programs.
Implemented in mcpp 2026.11.16.1 (#940): [test] features names declared features that test builds activate; an undeclared name is refused. 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):
[test] featuresnames declared features that test builds activate; an undeclared name is refused. See docs/08-testing.md.test: the programs a test runs request no [test] features (#941 stand…