How to generate an integration test binary without rust_test? #913
-
Hi, I want to know how to generate an integration test binary without
I want to run an integration test with setup() # setup for integration test
run_integration_test Hence, I want to run I know I can get the binary of
However, running How to do that? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Would you be able to build a |
Beta Was this translation helpful? Give feedback.
-
This sounds like a weird use case, can you tell us more about why you need to do this? Are you using rust_test only so you can use Would something like this work? #[test]
fn test() {
run_test(|| {
let ret_value = function_under_test();
assert!(ret_value);
})
} On the side, Rust test harness can run tests in parallel, you can get nondeterminism if one of the tests messes up with the environment, or if one of the tests is using resources in the environment. |
Beta Was this translation helpful? Give feedback.
Would you be able to build a
rust_binary
withrustc_flags = ["--test"]
? I think this would enable the libtest harness and produce a binary that would match the binary created byrust_test
but allow you to pass it to yoursh_binary
.