mozilla / grcov

Rust tool to collect and aggregate code coverage data for multiple source files
Mozilla Public License 2.0
1.15k stars 148 forks source link

Output Location Seems Inconsistent #1166

Open baxterjo opened 6 months ago

baxterjo commented 6 months ago

I'm new to this tool so this may have been answered before, but it seems like the output for the coverage report is nesting when it should overwrite. If I start from a point of no target/ directory an run these commands:

        RUST_LOG=DEBUG CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='./target/coverage_temp/cargo-test-%p-%m.profraw' cargo test

    grcov ./target/coverage_temp \
    --binary-path ./target/debug/deps/ \
    -s . \
    -t html \
    --branch \
    --keep-only "*${app_name}*" \
    --ignore "*target/debug/build*" \
    -o ./target/coverage/html/

The first time it generates the html directory in the expected location:

./target/coverage/
└── html
    ├── badges
    └── src
        └── files

Then when I run the exact two commands for a second time when the html dir already exists:

./target/coverage/
└── html
    ├── badges
    ├── html
    │   ├── badges
    │   └── src
    │       └── files
    └── src
        └── files

Is this expected?