Android Studio test report / test results not found

I followed the instructions below: https://developer.android.com/studio/test/index.html . I added this block to android block in app-module gradle file:

testOptions {
// Changes the directory where Gradle saves test reports. By default, Gradle saves test reports
// in the path_to_your_project/module_name/build/outputs/reports/ directory.
// '$rootDir' sets the path relative to the root directory of the current project.
reportDir "$rootDir/test-reports"
// Changes the directory where Gradle saves test results. By default, Gradle saves test results
// in the path_to_your_project/module_name/build/outputs/test-results/ directory.
// '$rootDir' sets the path relative to the root directory of the current project.
resultsDir "$rootDir/test-results"

      

}

However, I could not find the test results / report in my project folder (I searched the entire folder and found nothing.

I have a test running on Android (not unit tests). Doc says this block works for all types of tests, so ... why doesn't it work?

+4


source to share


1 answer


You seem to be out of luck with that. I just ran into the same problem now. I solved it with this.

android {
...
    testOptions {
        unitTests.all {
            testResultsDirName = "$rootDir/build/test-reports"
        }
    }
}

      



Let this help someone ... :)

0


source







All Articles