How to generate Code Coverage report of Instrumentation test cases in Android Studio

1.1k views Asked by At

What currently working is the Code Coverage report of the functional Unit Test cases.

  1. Updated to the latest Android Studio (1.2.1)
  2. Updated the Android Plugin in Android Studio (1.2.3)
  3. Updated the Gradle Version (2.2.1)
  4. Changed the Build Variant to Unit Test

Now I am able to get the Code Coverage report (using default IntelliJ Idea Code coverage tool) of the unit tests I wrote extending TestCase class. But when I write a class extending AndroidInstrumentatioTestCase2 or ActivityTestCase, I am gettting a null when I call getActivity(). And When I switch the Build Variants to Instrumentation, the Run with Code Coverage button is disabled.

So, in simple words, I want to know is how to get Code Coverage report in the test cases which are both functional unit test cases as well as Instrumentation test cases.


PS: Any other code coverage plugin (like JaCoCo) can also be used.

0

There are 0 answers