Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Rust code coverage staticstics in Clion 2021.1

It looks like CLion 2021.1 has source-based code coverage working with the Rust plugin because I can see the green/red line annotations in the code view:

example annotations

But if I go to the Coverage panel, I see the following:

enter image description here

Clicking the Edit button does not guide me in how to fix configuration settings.

Summary

I'd like to be able to view Rust code coverage statistics with CLion 2021.1, anyone know how to do this?

like image 300
karobar Avatar asked Oct 28 '25 17:10

karobar


1 Answers

Try these steps, they fixed it for me:

  1. Close CLion and delete the folder .idea in the project directory (yes, really)
  2. Update grcov by running cargo install --force grcov
  3. Start CLion and try it again
like image 73
Patrick Avatar answered Oct 31 '25 11:10

Patrick