[CLion 2021.3] Test Coverage greyed out / unavailable

Answered

Hello community!

 

I tried several available tutorials as well as the CLion docs (which are very sparse in details) but cannot seem to enable test coverage.

This is my environment:

- working on CLion 2021.3.2 for Windows

- using catch2 for the unit tests

- using Visual Studio toolchain and building for x86 for local development and testing

- using GCC toolchain and building for arm7v which is the target architecture

- the settings in Build, Execution, Deployment -> Coverage are as officially documented

- I have installed the C/C++ Coverage plugin, the run with coverage option is also greyed out

- I have tried restarting CLion, invalidating caches, resetting caches and reloading the cmake project, deleting the build folders, using the "repair IDE" tool, and freshly cloning the repository from git

 

It is probably some prerequisite that is not obvious to me. What bugs me most is that there is no indication for what exactly is missing, CLion just greys out the "run with coveration" menu option and button aside the configuration dropdown. There are no errors in the cmake, build messages, or event log tabs.

I would really appreciate some help, I've already invested too much time in this. Thanks so much in advance!

1 comment
Comment actions Permalink

Hello!

>I have installed the C/C++ Coverage plugin

Please note that it's a third-party plugin and therefore we can't advise you about it.

  1. Is it a CMake project?
  2. What toolchain is default (is at the top of the list in `File | Settings | Build, Execution, Deployment | Toolchains`)?

If the default toolchain is MSVC, then this is the expected behavior since Coverage is available only for GCC and Clang/Clang-cl. More info - https://www.jetbrains.com/help/clion/code-coverage-clion.html.

0

Please sign in to leave a comment.