Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Connected Tests Results Directory

I have an android project where I run normal unit tests as well as instrumented tests.


Now the thing is that the results of the

  • unit tests are stored in build/reports/tests (./debug or ./release)
  • instrumented tests are stored in build/outputs/connected

Is it somehow possible to change the result directory of the instrumented tests to build/reports/tests/connected?

Thank you already!

like image 930
JDC Avatar asked Dec 07 '25 08:12

JDC


1 Answers

Found the answer myself, To change the directory for instrumented tests use:

android {
    testOptions {
        reportDir = "$project.buildDir/reports"
        resultsDir = "$project.buildDir/test-results"
    }

    # Or for lint if needed
    lintOptions {
        htmlOutput = file("$project.buildDir/reports/lint/LINT-results.html")
        xmlOutput = file("$project.buildDir/test-results/lint/LINT-results.xml")
    }
}
like image 69
JDC Avatar answered Dec 08 '25 21:12

JDC