setTestClassesDirs

open fun setTestClassesDirs(testClassesDirs: FileCollection)(source)

Sets the directories to scan for compiled test sources. Typically, this would be configured to use the output of a source set:

plugins {
    id 'java'
}

sourceSets {
   integrationTest {
      compileClasspath += main.output
      runtimeClasspath += main.output
   }
}

task integrationTest(type: Test) {
    // Runs tests from src/integrationTest
    testClassesDirs = sourceSets.integrationTest.output.classesDirs
    classpath = sourceSets.integrationTest.runtimeClasspath
}

Since

4.0

Parameters

testClassesDirs

All test class directories to be used.