OSDN Git Service

Add code coverage support for robolectric tests
authorAjay Nadathur <ajayns@google.com>
Wed, 22 Feb 2017 01:44:10 +0000 (17:44 -0800)
committerAjay Nadathur <ajayns@google.com>
Wed, 22 Feb 2017 01:45:41 +0000 (17:45 -0800)
- To run robolectric tests with code coverage, run:
    make RunSettingsRoboTests-jacoco -j44
- Generated reports are placed under
   $OUT/obj/FAKE/RunSettingsRoboTests_intermediates/coverage

bug:32617403
Test: Ran manually, verified that reports are generated.

Change-Id: Ie51ab86c5fbaa9297d717167fda04a555dadbfe8

tests/robotests/Android.mk

index 3fc034d..b448433 100644 (file)
@@ -38,4 +38,6 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
 
 LOCAL_TEST_PACKAGE := Settings
 
+LOCAL_INSTRUMENT_SOURCE_DIRS := $(dir $(LOCAL_PATH))../src
+
 include prebuilts/misc/common/robolectric/run_robotests.mk
\ No newline at end of file