api / org.gradle.tooling / TestLauncher

TestLauncher

interface TestLauncher : ConfigurableLauncher<TestLauncher>

A TestLauncher allows you to execute tests in a Gradle build.

Since
2.6

Functions

run

abstract fun run(): Unit

Executes the tests, blocking until complete.

abstract fun run(handler: ResultHandler<in Void>): Unit

Starts executing the tests. This method returns immediately, and the result is later passed to the given handler.

If the operation fails, the handler's ResultHandler#onFailure(GradleConnectionException) method is called with the appropriate exception. See #run() for a description of the various exceptions that the operation may fail with.

withJvmTestClasses

abstract fun withJvmTestClasses(vararg testClasses: String): TestLauncher
abstract fun withJvmTestClasses(testClasses: MutableIterable<String>): TestLauncher

Adds tests to be executed declared by class name.

withJvmTestMethods

abstract fun withJvmTestMethods(testClass: String, vararg methods: String): TestLauncher

Adds tests to be executed declared by class and method name.

abstract fun withJvmTestMethods(testClass: String, methods: MutableIterable<String>): TestLauncher

Adds tests to be executed declared by class and methods name.

withTests

abstract fun withTests(vararg descriptors: TestOperationDescriptor): TestLauncher
abstract fun withTests(descriptors: MutableIterable<TestOperationDescriptor>): TestLauncher

Adds tests to be executed by passing test descriptors received from a previous Gradle Run.

Inherited Functions

addProgressListener

abstract fun addProgressListener(listener: ProgressListener): T
abstract fun addProgressListener(listener: ProgressListener): T
abstract fun addProgressListener(listener: ProgressListener, eventTypes: MutableSet<OperationType>): T
abstract fun addProgressListener(listener: ProgressListener, vararg operationTypes: OperationType): T

{@inheritDoc}

setColorOutput

abstract fun setColorOutput(colorOutput: Boolean): T

{@inheritDoc}

setEnvironmentVariables

abstract fun setEnvironmentVariables(envVariables: MutableMap<String, String>): T

{@inheritDoc}

setJavaHome

abstract fun setJavaHome(javaHome: File): T

{@inheritDoc}

setJvmArguments

abstract fun setJvmArguments(vararg jvmArguments: String): T
abstract fun setJvmArguments(jvmArguments: MutableIterable<String>): T

{@inheritDoc}

setStandardError

abstract fun setStandardError(outputStream: OutputStream): T

{@inheritDoc}

setStandardInput

abstract fun setStandardInput(inputStream: InputStream): T

{@inheritDoc}

setStandardOutput

abstract fun setStandardOutput(outputStream: OutputStream): T

{@inheritDoc}

withArguments

abstract fun withArguments(vararg arguments: String): T
abstract fun withArguments(arguments: MutableIterable<String>): T

{@inheritDoc}

withCancellationToken

abstract fun withCancellationToken(cancellationToken: CancellationToken): T

{@inheritDoc}