If you enter the command line cargo test --help
, the following message is shown:
The test filtering argument TESTNAME and all the arguments following the two dashes (
--
) are passed to the test binaries and thus to libtest (rustc's built in unit-test and micro-benchmarking framework). If you're passing arguments to both Cargo and the binary, the ones after--
go to the binary, the ones before go to Cargo. For details about libtest's arguments see the output ofcargo test -- --help
.
I do not understand the principle idea of that. Is libtest
not included in cargo test
execution? What's the difference between both? Can someone explain how it works with examples and the main idea of passing arguments using two dashes?