diff --git a/Device-Tests-&-Coverage-Report.md b/Device-Tests-&-Coverage-Report.md index b20463d..b6a35ba 100644 --- a/Device-Tests-&-Coverage-Report.md +++ b/Device-Tests-&-Coverage-Report.md @@ -53,10 +53,16 @@ Enable ``apply from: 'coverage.gradle'`` in ``usbSerialForAndroid/build.gradle`` Remove previous test results with ``gradle clean`` or *Android Studio : Menu -> Build -> Clean Project* -For each **device** *flavor* defined in ``coverage.gradle`` execute the corresponding gradle task +## Run unit tests +Disable ``testCoverageEnabled true`` and execute gradle task *usb-serial-for-android -> usbSerialForAndroid -> verification -> testAnyDeviceDebugTest*. + +Note: with enabled ``testCoverageEnabled true`` the test fails or creates an empty __*.exec__ report file. You can check this by loading *usbSerialForAndroid/build/jacoco/testAnyDeviceDebugUnitTest.exec* with *Android Studio -> Run -> Show Code Coverage Data*. + +## Run device tests +Enable ``testCoverageEnabled true`` and for each **device** *flavor* defined in ``coverage.gradle`` execute the corresponding gradle task *usb-serial-for-android -> usbSerialForAndroid -> verification -> create***Device***DebugCoverageReport* or *usb-serial-for-android -> usbSerialForAndroid -> other -> create***Device***DebugAndroidTestCoverageReport*. -Both tasks create the required *.ec report files but html reports do not contain annotated source code. +Both tasks create the required __*.ec__ report files but html reports do not contain annotated source code. Test reports are created even if tests fail. Nevertheless you should check that it didn't fail completely.