Skip to content

Commit 44350ba

Browse files
author
artyomcool
committed
Ability to add test listener
1 parent a66df6e commit 44350ba

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/main/kotlin/com/jaredsburrows/spoon/SpoonExtension.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.jaredsburrows.spoon
22

3+
import com.android.ddmlib.testrunner.ITestRunListener
4+
35
/**
46
* Variables based on the following documentation:
57
* - https://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner.html
@@ -78,7 +80,8 @@ open class SpoonExtension { // Extensions cannot be final
7880
/** Toggle sharding. (false by default) */
7981
var shard: Boolean = false
8082

81-
// TODO testRunListener
83+
/** Add listener for tests execution */
84+
var testRunListener: ITestRunListener? = null
8285

8386
// TODO terminateAdb
8487

src/main/kotlin/com/jaredsburrows/spoon/SpoonTask.kt

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ open class SpoonTask : DefaultTask() {
5555
.setSingleInstrumentationCall(extension.singleInstrumentationCall)
5656
.setClearAppDataBeforeEachTest(extension.clearAppDataBeforeEachTest)
5757

58+
if (extension.testRunListener != null) {
59+
builder.addTestRunListener(extension.testRunListener)
60+
}
61+
5862
// APKs
5963
if (!testing) {
6064
builder.setTestApk(instrumentationApk)

0 commit comments

Comments
 (0)