Can't get [profile.test] to function in workspace

I'm using a rust workspace. In the top-level Cargo.toml, I've got
[profile.test]
opt-level = 3
overflow-checks = false
I thought that would create a directory target/test, but it doesn't. So if these lines actually have an effect, where are the binaries going?

They go into target/debug if you run cargo test and into target/release if you run cargo test --release.

In general, non-dev, non-release profiles are odd. Of the top of my head, I don't remember when exactly the test profile applies.

Right, I see that changing [profile.test] lines and then running cargo test sometimes has an effect on files in target/debug, but it is not as expected. In particular using opt-level = 3 does not actually create an optimized executable in target/debug, unless it is in an unexpected location.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.