Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f28f692 authored by Chaohui Wang's avatar Chaohui Wang
Browse files

Add Jacoco coverage report task for SpaLib

Bug: 260441791
Test: Gradle Sync
Test: Generate Jacoco coverage report
Change-Id: I31259be00ec52defff6a2dbe55724cd05757f417
parent 90d4a5a5
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -56,6 +56,11 @@ android {
    composeOptions {
        kotlinCompilerExtensionVersion jetpack_compose_compiler_version
    }
    buildTypes {
        debug {
            testCoverageEnabled = true
        }
    }
}

dependencies {
@@ -63,3 +68,15 @@ dependencies {
    androidTestImplementation project(":testutils")
    androidTestImplementation "com.linkedin.dexmaker:dexmaker-mockito:2.28.1"
}

task coverageReport(type: JacocoReport, dependsOn: "connectedDebugAndroidTest") {
    group = "Reporting"
    description = "Generate Jacoco coverage reports after running tests."

    sourceDirectories.from = files("../spa/src")
    classDirectories.from = fileTree(
            dir: "../spa/build/tmp/kotlin-classes/debug",
            excludes: ["com/android/settingslib/spa/debug/**"],
    )
    executionData.from = fileTree(dir: "$buildDir/outputs/code_coverage/debugAndroidTest/connected")
}