Skip to content

Not idempotent when generating lcov output for cover commandΒ #136

@ogechno

Description

@ogechno

When generating lcov output using cargo ziggy cover, the operation is not idempotent. If the output file already exists from a previous run, the command fails instead of overwriting the existing file. Ideally, the command should overwrite the existing output. This was tested on MacOS.

Steps to Reproduce

  1. Fuzz the url example for a few seconds

  2. Run the command for the first time:

cargo ziggy cover --output-types lcov --output ./output/url-fuzz/cover_lcov

Output:

Generating coverage
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.01s
Now running file ./output/url-fuzz/corpus/init for coverage
Continuing execution in parent process, new child has pid: 92453
Child is done, moving on
Finished reading all files
  1. Run the same command again without deleting the output directory:
cargo ziggy cover --output-types lcov --output ./output/url-fuzz/cover_lcov

Output:

Generating coverage
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.00s
Now running file ./output/url-fuzz/corpus/init for coverage
Continuing execution in parent process, new child has pid: 92475
Child is done, moving on
Finished reading all files
Error: Failure generating coverage

Caused by:
    not a directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions