jeudi 24 septembre 2015

Configuring Gradle Test tasks for Android to log events

When I execute Android tests on the command-line using Gradle, I would like to see test log output. I followed the suggestion in this post but events are not being logged.

My app/build.gradle:

apply plugin: 'com.android.application'

...

//Test Logging
tasks.withType(Test) {
    testLogging {
        events "started", "passed", "skipped", "failed"
    }
}

My project has multiple product flavors (free, paid) and build types (debug, release). I expected this would configure these tasks for test logging:

connectedAndroidTestPaidDebug
connectedAndroidTestFreeDebug
connectedAndroidTestPaidRelease
...

In Android Studio, I see warnings:

Cannot resolve symbol 'testLogging'
Cannot resolve symbol 'events'

Aucun commentaire:

Enregistrer un commentaire