api / org.gradle.api.tasks.testing / AbstractTestTask / addTestListener

addTestListener

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: #beforeTest(groovy.lang.Closure), , #beforeSuite(groovy.lang.Closure), #afterSuite(groovy.lang.Closure)

This listener will NOT be notified of tests executed by other tasks. To get that behavior, use org.gradle.api.invocation.Gradle#addListener(Object).

Parameters

listener - The listener to add.