Sample project to show how compute code coverage of tests on multi-module Android project written in Kotlin.
App it self contains several business modules to provide Google MLKit functionality.
Branch | Status on CircleCI | Status on TravisCI | Code coverage |
---|---|---|---|
develop |
Look at slides from my talk on Android meetup:
Codebase is written using STRV code schema.
Preferences -> Editor -> Codestyle -> Kotlin -> extras/code-schema/strv.xml
Open source in Android Studio 3.3 Canary 13
(or newer)
Use mockDebug Build Variant.
Use MOCK flavour to run application without need to register app to fabric.
Use DEBUG variant to run application without need to configure app signing.
Run sh jacoco.sh
in the root of project.
If you run it on MacOs it will open Chrome and display generated HTMLs.
Otherwise you will find html files in build directories:
./module-core/build/reports/jacocoUnitTestReport/html/index.html
./module-face-detection/build/reports/jacocoUnitTestReport/html/index.html
./module-text-recognition/build/reports/jacocoUnitTestReport/html/index.html
./mobile/build/reports/jacocoUnitTestReport/html/index.html
I have been working on adding UI testing for isolated fragments.
Then I would like to connect code coverage also for that UI tests.
Every work in progress is available in feature branches.
Multi module navigation with the Android Architec¬ture component