Adding sub-path to output-path option does not create the directory path
Closed this issue ยท 5 comments
Hello, when I run the following command and the directory coverage
does not exist:
grcov . --binary-path ./target/debug/deps -s . -t html --branch --ignore-not-existing --ignore ../* --ignore /* --ignore tools/xtask/* --ignore */src/tests/* -o coverage/subpath
The tool does not give any html output and neither warns the user about the missing directory (I also tried with the option --log-level INFO
I think the tool should either create the directory path or either panic.
Environment
Windows 11
rustc version: 1.64.0
grcov version: 0.8.13
@marco-c I saw that you added a the tag as good-first-bug, if I can help solving the bug let me know, with some guidance I think I could fix it.
@GioPat I was going to give you a pointer to the function where we output the HTML, but I noticed we should already be handling the absence of the directory, see
Line 528 in b2a26f0
To fix this, I would suggest either using a debugger or adding a bit of logging to see exactly which paths we take in the code (in src/main.rs and around
Line 528 in b2a26f0
Thanks for the checks:
I was reading the rust doc for the path and I found this
Reference: https://doc.rust-lang.org/std/path/struct.Path.html#method.exists
They advice to use try_exists since some errors might be suppressed even though the result, in case of error, should be false ๐
What's the fastest way to add log and re-run the command?
Thanks!
What's the fastest way to add log and re-run the command?
Just add println in some places in src/main.rs and src/output.rs to see which branches we are taking and where we end up