Coverage tool for cmake

Hello,

We have a lot of lines of code in cmake, maintained by multiple teams. I was wondering if there is some kind of a coverage tool for cmake itself, which helps to identify dead code.

Thanks

IMHO: this is not realy needed.

pip install gcovr

see for config file example gcovr.cfg

Thanks for the reply.

I was just wondering if there are tools to identify dead cmake code and prevents code rot. I think it will be useful in some cases.

1 Like

Thanks for the link, it’s useful.

Maybe I was not being clear enough, just like there is gcov for C/C++, coverage.py for python, jacoco for java, I was wondering if there is such a tool for cmake language.

There isn’t. I suppose one could be built out of --trace or --trace-expand output though. However, results over all configurations of interest would really be needed to avoid removing Windows support code because only coverage from Linux is considered.

1 Like

thanks for the response, even just for linux, it could be useful. Just an idea.