taiki-e / cargo-llvm-cov

Cargo subcommand to easily use LLVM source-based code coverage (-C instrument-coverage).
Apache License 2.0
933 stars 57 forks source link

llvm-cov and nextest arguments in "inverted" positions #151

Closed azriel91 closed 2 years ago

azriel91 commented 2 years ago

Heya, I'm trying cargo-llvm-cov 0.3.0 with nextest in a workspace, and it appears that:

Example:

nextest_args=(--workspace)
llvm_cov_args=(--workspace --open --output-dir ./target/coverage)

# Passes llvm_cov_args through to nextest, doesn't do what is expected
# This is how I would expect to write the command
cargo llvm-cov $llvm_cov_args[@] nextest $nextest_args[@]

# This does what is expected
cargo llvm-cov $nextest_args[@] nextest $llvm_cov_args[@]

I haven't managed to figure out whether it's by design by clap.

taiki-e commented 2 years ago

Yeah, support for passthrough arguments has some bugs: see also https://github.com/taiki-e/cargo-llvm-cov/pull/144#issuecomment-1072750780 and https://github.com/taiki-e/cargo-llvm-cov/pull/144#issuecomment-1072772281

The proposed (and accepted) fix is https://github.com/taiki-e/cargo-llvm-cov/pull/144#issuecomment-1072955602, but has not yet been implemented.

taiki-e commented 2 years ago

The fix has been published in 0.5.0