diff --git a/test_runner/src/test/kotlin/ftl/run/platform/RunAndroidTestsKtTest.kt b/test_runner/src/test/kotlin/ftl/run/platform/RunAndroidTestsKtTest.kt index a1f83557d5..54b8d25940 100644 --- a/test_runner/src/test/kotlin/ftl/run/platform/RunAndroidTestsKtTest.kt +++ b/test_runner/src/test/kotlin/ftl/run/platform/RunAndroidTestsKtTest.kt @@ -2,12 +2,15 @@ package ftl.run.platform import ftl.args.AndroidArgs import ftl.json.MatrixMap +import ftl.test.util.FlankTestRunner import ftl.test.util.mixedConfigYaml import ftl.test.util.should import kotlinx.coroutines.runBlocking import org.junit.Assert.assertEquals import org.junit.Test +import org.junit.runner.RunWith +@RunWith(FlankTestRunner::class) class RunAndroidTestsKtTest { @Test diff --git a/test_runner/src/test/kotlin/ftl/test/util/TestHelper.kt b/test_runner/src/test/kotlin/ftl/test/util/TestHelper.kt index 921b81979b..7ed1af23bc 100644 --- a/test_runner/src/test/kotlin/ftl/test/util/TestHelper.kt +++ b/test_runner/src/test/kotlin/ftl/test/util/TestHelper.kt @@ -45,12 +45,19 @@ inline fun ignore(): T = mockk(relaxed = true) { inline fun should(crossinline match: T.() -> Boolean): T = mockk(relaxed = true) { val slot = slot() + var matched = false every { this@mockk == capture(slot) } answers { val value = slot.captured value.match().also { matches -> + matched = matches if (matches) println("${this@mockk} match succeed: $value") else println("${this@mockk} match failed: $value") } } + every { this@mockk.toString() } answers { + if (matched && slot.isCaptured) + slot.captured.toString() else + callOriginal() + } }