abstract class AbstractTestTask : ConventionTask, VerificationTask, Reporting<TestTaskReports>
Abstract class for all test task.
Note: This abstract class is not intended for implementation by build script or plugin authors.
Since
4.4
AbstractTestTask() |
open fun addTestListener(listener: TestListener): Unit
Registers a test listener with this task. Consider also the following handy methods for quicker hooking into test execution: This listener will NOT be notified of tests executed by other tasks. To get that behavior, use |
|
open fun addTestOutputListener(listener: TestOutputListener): Unit
Registers a output listener with this task. Quicker way of hooking into output events is using the |
|
open fun afterSuite(closure: Closure<Any>): Unit
Adds a closure to be notified after a test suite has executed. A TestDescriptor and TestResult instance are passed to the closure as a parameter. This method is also called after all test suites are executed. The provided descriptor will have a null parent suite. |
|
open fun afterTest(closure: Closure<Any>): Unit
Adds a closure to be notified after a test has executed. A TestDescriptor and TestResult instance are passed to the closure as a parameter. |
|
open fun beforeSuite(closure: Closure<Any>): Unit
Adds a closure to be notified before a test suite is executed. A TestDescriptor instance is passed to the closure as a parameter. This method is also called before any test suites are executed. The provided descriptor will have a null parent suite. |
|
open fun beforeTest(closure: Closure<Any>): Unit
Adds a closure to be notified before a test is executed. A TestDescriptor instance is passed to the closure as a parameter. |
|
open fun executeTests(): Unit |
|
open fun getBinResultsDir(): File
Returns the root folder for the test results in internal binary format. |
|
open fun getBinaryResultsDirectory(): DirectoryProperty
Returns the root directory property for the test results in internal binary format. |
|
open fun getFilter(): TestFilter
Allows filtering tests for execution. |
|
open fun getIgnoreFailures(): Boolean
{@inheritDoc} |
|
open fun getReports(): TestTaskReports
The reports that this task potentially produces. |
|
open fun getTestLogging(): TestLoggingContainer
Allows to set options related to which test events are logged to the console, and on which detail level. For example, to show more information about exceptions use: For further information see TestLoggingContainer.
|
|
open fun onOutput(closure: Closure<Any>): Unit
Adds a closure to be notified when output from the test received. A TestDescriptor and TestOutputEvent instance are passed to the closure as a parameter.
|
|
open fun removeTestListener(listener: TestListener): Unit
Unregisters a test listener with this task. This method will only remove listeners that were added by calling |
|
open fun removeTestOutputListener(listener: TestOutputListener): Unit
Unregisters a test output listener with this task. This method will only remove listeners that were added by calling |
|
open fun reports(closure: Closure<Any>): TestTaskReports open fun reports(configureAction: Action<in TestTaskReports>): TestTaskReports
Configures the reports that this task potentially produces. |
|
open fun setBinResultsDir(binResultsDir: File): Unit
Sets the root folder for the test results in internal binary format. |
|
open fun setIgnoreFailures(ignoreFailures: Boolean): Unit
{@inheritDoc} |
|
open fun setTestNameIncludePatterns(testNamePattern: MutableList<String>): AbstractTestTask
Sets the test name patterns to be included in execution. Classes or method names are supported, wildcard '*' is supported. For more information see the user guide chapter on testing. For more information on supported patterns see TestFilter |
|
open fun testLogging(closure: Closure<Any>): Unit open fun testLogging(action: Action<in TestLoggingContainer>): Unit
Allows configuring the logging of the test execution, for example log eagerly the standard output, etc.
|
open class Test : AbstractTestTask, JavaForkOptions, PatternFilterable
Executes JUnit (3.8.x, 4.x or 5.x) or TestNG tests. Test are always run in (one or more) separate JVMs. The sample below shows various configuration options.
The test process can be started in debug mode (see
|
|
open class XCTest : AbstractTestTask
Executes XCTest tests. Test are always run in a single execution. |