Skip to content
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

clang support? #30

Open
suurjaak opened this issue Apr 27, 2021 · 4 comments
Open

clang support? #30

suurjaak opened this issue Apr 27, 2021 · 4 comments

Comments

@suurjaak
Copy link

Is this package expected to work with clang? When following the instructions, the result of a coverage run is:

/usr/bin/lcov -c -i -d . -o my_package_coverage_report.base
Capturing coverage data from .
Found gcov version: 9.3.0
Using intermediate gcov format
Scanning . for .gcno files ...
Found 9 graph files in .
Processing test_mytest.dir/test/test_mytest.cpp.gcno
/home/user/dev/build/my_package/CMakeFiles/test_mytest.dir/test/test_mytest.cpp.gcno:version '402*', prefer 'A93*'
geninfo: ERROR: GCOV failed for /home/user/dev/build/my_package/CMakeFiles/test_mytest.dir/test/test_mytest.cpp.gcno!
make[3]: *** [CMakeFiles/my_package_coverage_report_cleanup_cpp.dir/build.make:59: CMakeFiles/my_package_coverage_report_cleanup_cpp] Error 255

And when I do gcov /home/user/dev/build/my_package/CMakeFiles/test_mytest.dir/test/test_mytest.cpp.gcno manually, I get

/home/user/dev/build/my_package/CMakeFiles/test_mytest.dir/test/test_mytest.cpp.gcno:version '402*', prefer 'A93*'
Segmentation fault (core dumped)

But when I do llvm-cov gcov /home/user/dev/build/my_package/CMakeFiles/test_mytest.dir/test/test_mytest.cpp.gcno, it does display some coverage info.

Or is this just a local workspace configuration problem?

@ebadeauxSCWX
Copy link

Was this resolved? I am also encountering the same issue.

@suurjaak
Copy link
Author

No, the author has not reacted in any way.

I made myself a small patch for this package, which forces lcov to use llvm-cov: patch.txt.

And a script to put somewhere in path as llvm-gcov.sh:

#!/bin/bash
exec llvm-cov gcov "$@"

@mikeferguson
Copy link
Owner

No, the author has not reacted in any way.

I don't personally have any insight into llvm or clang issues. If a PR can be created (that doesn't break existing workflows), happy to review, merge and re-release.

@suurjaak
Copy link
Author

Made a pull request for this (#33).

Went with requiring a specific option only when using Clang coverage tools:

APPEND_COVERAGE_COMPILER_FLAGS(COMPILER clang)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants