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
But this won't actually apply the opt-level = 2 to the dependencies when invoking cargo test, instead if one needs dependencies to be optimized for the tests the following should be specified
Create some tests that requires dependencies to be optimized to run
Use Cargo.toml with [profile.test.package."*"]
Check that the tests are still not running due to non-optimized dependencies
Use Cargo.toml with [profile.dev.package."*"]
Verify that the tests are now running due to optimized dependencies
Possible Solution(s)
I'm guessing this happens since the dependencies used by cargo test is compiled with dev such that the same dependencies can be reused for debug builds and for testing, which seems fine.
Having a warning be triggered to note users that [profile.test.package."*"] doesn't do anything seems like a fair fix
Alternatively allowing [profile.test.package."*"] and applying it to test dependencies instead of [profile.dev.package."*"]
Notes
Output of cargo version: cargo 1.48.0 (65cbdd2 2020-10-14)
The text was updated successfully, but these errors were encountered:
Problem
When specifying overrides for
cargo test
to optimise tests in some workspace member on would expect to useBut this won't actually apply the
opt-level = 2
to the dependencies when invokingcargo test
, instead if one needs dependencies to be optimized for the tests the following should be specifiedSteps
Cargo.toml
with[profile.test.package."*"]
Cargo.toml
with[profile.dev.package."*"]
Possible Solution(s)
I'm guessing this happens since the dependencies used by
cargo test
is compiled withdev
such that the same dependencies can be reused for debug builds and for testing, which seems fine.Having a warning be triggered to note users that
[profile.test.package."*"]
doesn't do anything seems like a fair fixAlternatively allowing
[profile.test.package."*"]
and applying it to test dependencies instead of[profile.dev.package."*"]
Notes
Output of
cargo version
: cargo 1.48.0 (65cbdd2 2020-10-14)The text was updated successfully, but these errors were encountered: