You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate a task that runs unit tests and instrumentation tests for a module and combines their execution data in a single report. Add the option to include instrumentation tests in the global merged report.
Copy file name to clipboardExpand all lines: README.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,28 @@ Gradle plugin that generates Jacoco reports from a Gradle Project. Android Appli
4
4
5
5
### Android project
6
6
7
+
*JVM Unit-Tests*
7
8
- Task `jacocoTestReport<Flavor><BuildType>`
8
9
- Executes the `test<Flavor><BuildType>UnitTest` task before
9
10
- Gets executed when the `check` task is executed
10
11
- Generated Jacoco reports can be found under `build/reports/jacoco/<Flavor>/<BuildType>`.
11
12
13
+
*Instrumented tests*
14
+
- Task `combinedTestReport<Flavor><BuildType>`
15
+
- Executes the `test<Flavor><BuildType>UnitTest` and `create<Flavor><BuildType>CoverageReports` tasks before (JVM and instrumented tests)
16
+
- Gets executed when the `check` task is executed
17
+
- Generated Jacoco reports can be found under `build/reports/jacocoCombined/<Flavor>/<BuildType>`.
18
+
Note that this task is only generated, if you set `testCoverageEnabled = true` for your [build type](https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.BuildType.html#com.android.build.gradle.internal.dsl.BuildType:testCoverageEnabled), e.g.
19
+
```groovy
20
+
android {
21
+
buildTypes {
22
+
debug {
23
+
testCoverageEnabled true
24
+
}
25
+
}
26
+
}
27
+
```
28
+
12
29
Where `<BuildType>` is usually `debug` & `release` unless additional build types where specified.
13
30
`<Flavor>` is optional and will be ignored if not specified.
14
31
@@ -75,6 +92,7 @@ junitJacoco {
75
92
ignoreProjects = [] // type String array
76
93
excludes // type String List
77
94
includeNoLocationClasses = false // type boolean
95
+
includeInstrumentationCoverageInMergedReport = false // type boolean
0 commit comments