New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
horenmar opened this Issue Dec 2, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@horenmar
Copy link

horenmar commented Dec 2, 2017

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.

@OpenCppCoverage

This comment has been minimized.

Copy link
Owner

OpenCppCoverage commented Dec 4, 2017

Hello,

Unfortunately, this is a very common pitfall.
--sources and --modules accept patterns and not paths. For example, --sources Pr*ject* is a valid option. A full path works as long as it match exactly the full path in the pdb.

I will make the documentation more explicit about it.
I am also going to add a warning in the next release.

I hope it will help,

OpenCppCoverage

@OpenCppCoverage

This comment has been minimized.

Copy link
Owner

OpenCppCoverage commented Mar 5, 2018

Hello,

The error messages are improved in OpenCppCoverage 0.9.7.0 and the documentation was updated.

OpenCppCoverage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment