-
Notifications
You must be signed in to change notification settings - Fork 30
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
Out of source builds produce coverage for generated files #33
Comments
Are the generated source files in |
When cmake+ctest+fastcov are invoked from When cmake+ctest+fastcov are invoked from I would like to be able to build in |
In that case you should be able to do Alternatively, you can whitelist the source files you want with If that doesn't help I'll need to know a few more details on the directory layout of your project. |
|
Fastcov will never automatically ignore source files that are linked to test binaries, so if it is not including them, either one of the CLI flags is filtering them, or there is a different reason behind it. A minimum example would be great, I would be able to tell exactly what is happening. |
I have modified the example project in a fork of this repo: https://github.com/PhilipMourdjis/fastcov/tree/Ignore_build_directory
The ignore_me.cpp file generated by cmake is included in the example.json output even after attempts to exclude the build directory |
I see what the problem is. This is actually related to #17 . It is a quirk with CMake/Ninja where it appears that files in the build directory use relative paths while paths outside of the build directory (sometimes?) use absolute paths. Switching the build system to use Make instead of Ninja "fixes" the issue. However, I still consider this a bug in fastcov, so I will fix it so that fastcov converts all paths to absolute before filtering. |
Could you please try the latest on master and see if it fixes your issues? I won't release/push to pypi until then. |
Works great! Thanks |
When running fastcov in
project/src/build
no coverage info is produced for generated source files that are created in this build directory. This is expected.When running fastcov from a build directory that is a sibling of a source directory (
project/build
). Generated source files are included in the coverage report and I do not know how to exclude them from the report (adding ../build/ to the exclude folders list has no effect).The text was updated successfully, but these errors were encountered: