Skip to content

Consider normalizing paths for --sources (and --modules) #17

@horenmar

Description

@horenmar

OpenCppCoverage is currently sensitive to differences between '' and '/' in --sources arguments.

This means that called like this
OpenCppCoverage --export_type cobertura --quiet --sources C:\projects\Catch2 -- C:\projects\Catch2\Build\Debug\SelfTest.exe
will result in the expected report, but this
OpenCppCoverage --export_type cobertura --quiet --sources C:/projects/Catch2 -- C:/projects/Catch2/Build/Debug/SelfTest.exe
will run the SelfTest, but filter out everything, creating an empty report.

I ran into this when I was integrating OpenCppCoverage with our project's CI on AppVeyor. Since we use CMake and CTest I had to redirect CTest and it provides the target path using forward slashes... this meant that I ended up with the tests providing proper output, but empty files, which took awhile to diagnose.

This probably also applies to --modules

Tested with v 0.9.6.1 release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions