Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run 'app' with Code Coverage in Android Studio

There is a Run with Coverage button in Android Studio (Check attached image) , but it's always disabled, how can I enabled it?

enter image description here

like image 873
AVEbrahimi Avatar asked Mar 29 '15 06:03

AVEbrahimi


People also ask

How do I run code coverage?

To calculate the code coverage percentage, simply use the following formula: Code Coverage Percentage = (Number of lines of code executed by a testing algorithm/Total number of lines of code in a system component) * 100.

What is run with coverage?

Run test with coverageIt will display what percentage of the code has been covered by the test. You can see the the coverage result on class, methods or line basis.


1 Answers

You need to run a "junit" run configuration, like this one

AS junit run configuration

Only apply when you pass your unit tests

like image 149
ffgiraldez Avatar answered Oct 07 '22 02:10

ffgiraldez