Support debug in Gradle tasks responsible for K/N tests
This commit is contained in:
+12
-2
@@ -195,12 +195,14 @@ open class KotlinNativeHostTest : KotlinNativeTest() {
|
|||||||
/**
|
/**
|
||||||
* A task running Kotlin/Native tests on a simulator (iOS/watchOS/tvOS).
|
* A task running Kotlin/Native tests on a simulator (iOS/watchOS/tvOS).
|
||||||
*/
|
*/
|
||||||
// TODO: Support debugging.
|
|
||||||
open class KotlinNativeSimulatorTest : KotlinNativeTest() {
|
open class KotlinNativeSimulatorTest : KotlinNativeTest() {
|
||||||
@Input
|
@Input
|
||||||
@Option(option = "device", description = "Sets a simulated device used to execute tests.")
|
@Option(option = "device", description = "Sets a simulated device used to execute tests.")
|
||||||
lateinit var deviceId: String
|
lateinit var deviceId: String
|
||||||
|
|
||||||
|
@Internal
|
||||||
|
var debugMode = false
|
||||||
|
|
||||||
@get:Internal
|
@get:Internal
|
||||||
override val testCommand: TestCommand = object : TestCommand() {
|
override val testCommand: TestCommand = object : TestCommand() {
|
||||||
override val executable: String
|
override val executable: String
|
||||||
@@ -213,7 +215,15 @@ open class KotlinNativeSimulatorTest : KotlinNativeTest() {
|
|||||||
testNegativeGradleFilter: Set<String>,
|
testNegativeGradleFilter: Set<String>,
|
||||||
userArgs: List<String>
|
userArgs: List<String>
|
||||||
): List<String> =
|
): List<String> =
|
||||||
listOf("simctl", "spawn", "--standalone", deviceId, this@KotlinNativeSimulatorTest.executable.absolutePath, "--") +
|
listOfNotNull(
|
||||||
|
"simctl",
|
||||||
|
"spawn",
|
||||||
|
"--wait-for-debugger".takeIf { debugMode },
|
||||||
|
"--standalone",
|
||||||
|
deviceId,
|
||||||
|
this@KotlinNativeSimulatorTest.executable.absolutePath,
|
||||||
|
"--"
|
||||||
|
) +
|
||||||
testArgs(testLogger, checkExitCode, testGradleFilter, testNegativeGradleFilter, userArgs)
|
testArgs(testLogger, checkExitCode, testGradleFilter, testNegativeGradleFilter, userArgs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user