`-t html` works with `-o ./target/debug/coverage/`, but `-t lcov` doesn't
saurabh-sm opened this issue · comments
From README:
Generate a html coverage report like this:
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/
N.B.: The
--binary-path
argument is only necessary for source-based coverage.You can see the report in
target/debug/coverage/index.html
.(or alternatively with
-t lcov
grcov will output a lcov compatible coverage report that you could then feed into lcov'sgenhtml
command).
indicates that using
grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o ./target/debug/coverage/
will create an LCOV file in directory ./target/debug/coverage/
, but the directory doesn't actually get created.
The above command throws error:
[ERROR] A panic occurred at /home/saurabh/.local/share/rust/cargo/registry/src/github.com-1ecc6299db9ec823/grcov-0.8.18/src/output.rs:59: Cannot create the file ./target/debug/coverage/ to dump coverage data.
Steps to reproduce
rustup component add llvm-tools-preview
export RUSTFLAGS="-Cinstrument-coverage"
cargo test
grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o ./target/debug/coverage/
In case of lcov
, the path must be a file and not a directory.
I tried running
grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o ./target/debug/
and it works. The path is a directory.
I replaced the 4th command in Steps to reproduce with the above.