-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: always building in "test mode" #1214
Comments
If we're concerned about integration tests, we can pass |
Confirmed that this causes problems in #1448. |
I have mixed feelings about this one. I'm curious to know more about the motivation here. In some cases, users might want to use test code in their harnesses. Like extra assertions and sanity checks. Some dev-dependencies might be relevant while writing harnesses. On the other hand, building things in test mode will compile things like the std test library which we don't use. Not all dev-dependencies and test code are desirable or suitable for verification. E.g.: crates like pretty_assertions. If we force the test mode, now users will have to guard them with I would prefer that we keep supporting both modes (test and regular build) until we have strong use cases that makes one undesirable. I have a soft preference to using |
I would be surprised if test mode is less common than regular mode. If regular mode is still desired Note that not enabling test is crazy-counter-intuitive since all other testing infrastructure does enable it. |
In short: build with
cargo test --no-run
notcargo build
, making the current--tests
option the default (and only) build mode.There are three currently open issues related to this proposal:
no_mangle
attribute #661 This would be resolved by having#[kani::proof]
expand to include#[test]
undercargo kani
. This would ensure that the function always gets codegen'd.--tests
re-causes the issue. We need to figure out how to accommodate this.What are the drawbacks?
./test/
. Given that Kani just flat links everything together, this might cause problems? (Have these ever been observed?) So a prerequisite might be to do proper linking of multiple binaries (stemming from multiple "integration tests"), before we switch to this.The text was updated successfully, but these errors were encountered: