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

`cargo llvm-cov nextest run` skips tests #233

Closed aaronenberg closed 1 year ago

aaronenberg commented 1 year ago

cargo-llvm-cov v0.5.3

Maybe I'm misunderstanding, but the tests are not skipped when running either cargo llvm-cov or cargo nextest run alone, so my expectations are the tests should not be skipped in this scenario.

Steps to reproduce:

cargo new foo
cd foo
echo '
#[cfg(test)]
mod test {
    #[test]
    fn test_foo() {
        assert_eq!(1 + 1, 2);
    }
}' >> src/main.rs
cargo llvm-cov nextest run
taiki-e commented 1 year ago

cargo llvm-cov nextest internally calls cargo nextest run, so run in cargo llvm-cov nextest run is treated as a filter to the test. https://github.com/taiki-e/cargo-llvm-cov/blob/7e531da0c6ae171eb018ee77155daf6bc7484674/src/main.rs#L335

The help message indicates that the cargo nextest run's options (not cargo nextest's options) are acceptable, but we probably should be able to make the help message clearer.

https://github.com/taiki-e/cargo-llvm-cov/blob/7e531da0c6ae171eb018ee77155daf6bc7484674/docs/cargo-llvm-cov-nextest.txt#L9

aaronenberg commented 1 year ago

Ah, yeah that makes sense. Thanks for being so responsive. Feel free to close.

Would you consider updating the subcommands help displayed by cargo llvm-cov --help

SUBCOMMANDS:
...
    nextest
                Run tests with cargo nextest
                This internally calls `cargo nextest run`

Thoughts?

taiki-e commented 1 year ago

Would you consider updating the subcommands help displayed by cargo llvm-cov --help

Thoughts?

Sounds good to me.