2

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'
Community
  • 1
  • 1
sidecarcat
  • 482
  • 5
  • 12

1 Answers1

-1

have you tried using :

testOptions.unitTests.all {
    testLogging {
        events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
    }
}
SimoT
  • 41
  • 4