Closed cpick closed 3 months ago
When testing of the other, similar cargo-zigbuild
subcommands ("clippy", "run", and "rustc") I see that they don't provide a way to us a single --
argument to pass options to the underlying cargo
subcommand. Instead, they parse the arguments, re-add the appropriate ones, then inject the --
separator between those subcommand arguments and any, unknown others that are intended for the underlying command (eg: rustc
, clippy, or the newly-compiled binary).
cargo-zigbuild test
just seems to be behaving differently than those others.
I believe https://github.com/messense/cargo-options/pull/12 fixes (and explains the root cause of) the issue.
Regular
cargo test
behaves in the following way:An unadorned
-h
goes to the "test" subcommand itself:Inserting a
--
separator passes the-h
through to the test program:Inserting a second, spurious
--
causes the-h
to be ignored:By contrast,
cargo-zigbuild test
behaves in the following way:An unadorned
-h
goes tocargo-zigbuild
s "test" subcommand:Inserting a
--
separator passes the-h
through tocargo
s "test" subcommand:Inserting a second
--
causes the-h
to be ignored:Issue
The issue is that this prevents arguments from being passed through
cargo-zigbuild test
to the test program. This includes test name filters, the--nocapture
flag, etc.