-
Notifications
You must be signed in to change notification settings - Fork 2
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
No llvm-profdata specified to accompany llvm-cov on macOS #17
Comments
Something must have gone wrong when trying to find it. It will look in different places including the PATH however. Either way you can always change your settings by going to Settings -> Language & Frameworks -> C/C++ Coverage where you can set the needed tools for each of your toolchains |
It seems Apple Clang gets detected as GCC by the plugin. Default clang path on macOS is actually for the C-Cpp-Coverage-for-CLion/src/main/kotlin/net/zero9178/cov/settings/CoverageGeneratorSettings.kt Line 219 in 7923276
|
I am not sure how to handle this as c++ is also a common name for GCC and people also still that on MacOS too. I could try doing --version first on the compiler. Biggest problem is probably that I do not have a mac to test however. The gcov field there is actually not fixed however and you can replace the path with llvm-cov and afterwards the llvm-profdata and optional demangler fields will appear. In hand sight I probably shouldn't make the label display either gcov or llvm-cov but rather both to avoid such problems |
@zero9178, yeah, --version check would be more reliable. |
@khrykin I had the same issue as you. Changing the C++ compiler in "Build, Execution, Deployment" → "Toolchains" to However, now after running my Google Tests with Coverage I receive an error: "Coverage could not be generated due to following error: No executable specified" (see this line). The configuration I use to run the tests looks as follow: I also tried to run a normal (non-testing) configuration with the coverage. However, it returns the same error. Did you have the same issue and if yes, how did you solve it? Thanks a lot! |
@pjattke on macOS I use Clang provided by XCode, which is if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_compile_options(-fprofile-instr-generate -fcoverage-mapping)
add_link_options(-fprofile-instr-generate)
#Uncomment in case of linker errors
#link_libraries(clang_rt.profile-x86_64)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(--coverage)
#Uncomment in case of linker errors
#link_libraries(gcov)
endif () This probably causes your issue. |
@khrykin Thank you, now it works! The |
I'm getting this error on macOS 10.14.5 with Apple Clang:
However, both
lvm-profdata
andllvm-cov
are in my PATH, and I'm able to generate coverage manually in terminal.Can you please point me to a solution here?
The text was updated successfully, but these errors were encountered: