Emma code coverage for lib on Android

I currently have separate tests for an Android application that calls the library jar file calls. I would like to see code coverage for jar, but when I run ant emma and look at cover.html, it only reports the scope of the application project.

Is there any way to indicate that I would like to see the can cover?

+4
source share
2 answers

ADT r20-preview solves this problem by providing access to the full trajectory of classes of tested projects and their projects in the library:

http://tools.android.com/download/adt-20-preview

Fixed in Ant:

  • Tested projects now have access to the full path to the classes from the tested projects, including library projects and a third-party bank
  • Application implementation tests can now be deployed and tested, including with code coverage, such as test applications.

This will give you reports on code coverage in your library projects, but you will need to make some changes to the test target of build.xml to attach the source files. See Attach the source code of the Android library project to the Emma (ant, emma) report for more information on how to enable emma check coverage for your library projects for now.

+3
source

Emma's documentation mentions tool banks ( http://emma.sourceforge.net/ ), so this seems possible, maybe you need to play around with the configuration settings a bit.

Good luck.

0
source

Source: https://habr.com/ru/post/1398102/


All Articles