api / org.gradle.testkit.runner / GradleRunner / withTestKitDir

withTestKitDir

abstract fun withTestKitDir(testKitDir: File): GradleRunner

Sets the directory to use for TestKit's working storage needs.

This directory is used internally to store various files required by the runner. If no explicit Gradle user home is specified via the build arguments (i.e. the -g «dir» option}), this directory will also be used for the Gradle user home for the test build.

If no value has been specified when the build is initiated, a directory unique to the current operating system user will be created and used within the JVM's temporary directory as advertised by the java.io.tmpdir system property. This directory is not deleted by the runner after the test build.

You may wish to specify a location that is within your project and regularly cleaned, such as the project's build directory.

The actual contents of this directory are an internal implementation detail and may change at any time.

Parameters

testKitDir - the TestKit directory

Return
this

Since
2.7