when I try to do this I get:
Unrecognized option: 'x'
but in usage section of the cargo test
is reported:
Usage: cargo.exe test [OPTIONS] [TESTNAME] [-- [args]...]
when I try to do this I get:
Unrecognized option: 'x'
but in usage section of the cargo test
is reported:
Usage: cargo.exe test [OPTIONS] [TESTNAME] [-- [args]...]
That separates arguments to cargo test
and arguments to libtest
, the default Rust test harness.
Here are some usage examples:
Thank you, as I understood, it's not possible to pass arguments to my test files?
Not in the default test harness, but you have several options:
include_str!
and include_bin!
to include test data filesstd::env::current_exe
#[ignored]
tests and std::process::env
to obtain your inputsPlease keep your default cargo test
clean with no additional inputs required so that your project is included in ecosystem-wide regression testing!
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.