diff --git a/Device-Tests-&-Coverage-Report.md b/Device-Tests-&-Coverage-Report.md index 0e1b86c..154d272 100644 --- a/Device-Tests-&-Coverage-Report.md +++ b/Device-Tests-&-Coverage-Report.md @@ -54,12 +54,11 @@ Enable ``apply from: 'coverage.gradle'`` in ``usbSerialForAndroid/build.gradle`` Remove previous test results with ``gradle clean`` or *Android Studio : Menu -> Build -> Clean Project* ## 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 *usb-serial-for-android -> usbSerialForAndroid -> verification -> testAnyDeviceDebugUnitTest* ## Run device tests -Enable ``testCoverageEnabled true`` and for each **device** *flavor* defined in ``coverage.gradle`` execute the corresponding gradle task +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__ and __*.xml__ report files but html reports do not contain annotated source code. @@ -68,13 +67,15 @@ Test reports are created even if tests fail. Nevertheless you should check that ## Create coverage report -Create summary __*.xml__ report with gradle task *usb-serial-for-android -> usbSerialForAndroid -> other -> jacocoTestReport*. This also creates a local __*.html__ report with annotated source code. +Create summary __*.xml__ report with gradle task *usb-serial-for-android -> usbSerialForAndroid -> other -> jacocoTestReport*. + +This also creates a local __*.html__ report with annotated source code. ## Upload coverage report Upload coverage reports to [codecov.io](https://codecov.io/gh/mik3y/usb-serial-for-android) using the uploader program. On Windows execute in ``command prompt`` (cmd.exe), e.g. cd c:\work\AndroidStudioProjects\usb-serial-for-android - ..\codecov.exe -t -f usbSerialForAndroid/build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml + ..\codecov.exe -t