13

When I run my unit tests in the android studio with code coverage and select to see the source from the Coverage toolbar, I cannot see the code coverage information in the gutter(sidebar) of the editor as shown here. There is no information about the number of hits or color indicators in the gutter.

enter image description here enter image description here

This is what I am using:

Android Studio 3.2.1
Build #AI-181.5540.7.32.5056338, built on October 9, 2018
JRE: 1.8.0_152-release-1136-b06 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.15.0-34-generic

Zoe
  • 27,060
  • 21
  • 118
  • 148
hushed_voice
  • 3,161
  • 3
  • 34
  • 66

2 Answers2

3

http://tutorials.webtecho.com/code-coverage-in-android-studio/

Go to configuration -> Unit test , click the drop down then click the project module you would like to enable coverage on then click code coverage and enable tracing . Also click on Analyze then Show code coverage data .

0
  1. Run tests with Code coverage
  2. Go to that class you write a test for
  3. You can see the coverage indication on gutter
moiz ahmed
  • 41
  • 6