I'm trying to check my unit test coverage, all my tests are passing, but when I run the tests with 'Run Tests With Coverage' by right clicking on my test file, when it completes, everything comes back as 0%?
Looks like it's supposed to just work reading https://developer.android.com/studio/test/index.html and can't find anything saying why it would be returning 0% for everything?
Is there some hidden setting I'm missing to get this working?
Go to Run->Edit Configuration->Code coverage
.
Add your package/class for which you want to run tests, in Packages and classes to record coverage data section.
Also, check Enable coverage in test folders option.
Click Apply
and Ok
. Re-run your tests with coverage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With