Code Coverage from Multiple .ec files

233 views
Skip to first unread message

khorro...@gmail.com

unread,
May 3, 2019, 2:24:28 AM5/3/19
to JaCoCo and EclEmma Users
Is there any way to get combined code coverage from multiple .ec files. I saw there is a way to merge multiple .exec files.

How can I merge .ec files?

Than you!

Marc Hoffmann

unread,
May 3, 2019, 2:48:15 AM5/3/19
to jac...@googlegroups.com
There is. Look for “merge" tasks/goals in the documentation: https://www.jacoco.org/jacoco/trunk/doc/index.html

Also some implementations like the Ant task can directly process multiple exec files as input.

Regards,
-marc
> --
> You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/123ad3bb-3379-4438-8b59-aa5e9f9eabc6%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Khorrom Khan

unread,
May 3, 2019, 3:29:35 AM5/3/19
to jac...@googlegroups.com
Thank you for your prompt response. I am testing the instrumented .apk using an automated test generation tool which is written in python. For each testcase the tool is generating an .ec file.  Instead of generating multiple .ec files, how can I generate one combined .ec file? Is it possible to add append property in my build.gradle file? 

task jacocoTestReport(type: JacocoReport) {
    group = "Reporting"
    description = "Generate Jacoco coverage reports"
    reports {
        xml.enabled = true
        html.enabled = true
    }
    classDirectories = fileTree(
            dir: './build/intermediates/classes/debug',
            excludes: ['**/R*.class',
                       '**/*$InjectAdapter.class',
                       '**/*$ModuleAdapter.class',
                       '**/*$ViewInjector*.class'
            ]
    )
    sourceDirectories = files(coverageSourceDirs)
    executionData = files("$buildDir/outputs/code-coverage/connected/coverage.ec")
    doFirst {
        new File("$buildDir/intermediates/classes/").eachFileRecurse { file ->
            if (file.name.contains('$$')) {
                file.renameTo(file.path.replace('$$', '$'))
            }
        }
    }


}



Marc Hoffmann

unread,
May 3, 2019, 8:30:41 AM5/3/19
to JaCoCo and EclEmma Users
Please understand that the JaCoCo integration for Gradle and Andoid SDK is developed by the respective projects itself. For support please contact these projects.


Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages