Run android test locally with X86 emulator

This commit is contained in:
Mikhael Bogdanov
2019-01-25 13:28:54 +01:00
parent 28406b6bc4
commit d3c0937c67
2 changed files with 11 additions and 1 deletions
+5
View File
@@ -38,5 +38,10 @@ projectTest {
doFirst {
environment("kotlin.tests.android.timeout", "45")
}
if (project.hasProperty("teamcity") || project.hasProperty("kotlin.test.android.teamcity")) {
systemProperty("kotlin.test.android.teamcity", true)
}
workingDir = rootDir
}
@@ -33,11 +33,16 @@ import javax.xml.parsers.ParserConfigurationException
class CodegenTestsOnAndroidRunner private constructor(private val pathManager: PathManager) {
private val isTeamcity = System.getProperty("kotlin.test.android.teamcity") != null || System.getenv("TEAMCITY_VERSION") != null
private fun runTestsInEmulator(): TestSuite {
val rootSuite = TestSuite("Root")
downloadDependencies()
val emulator = Emulator(pathManager, Emulator.ARM)
val emulatorType = if (isTeamcity) Emulator.ARM else Emulator.X86
println("Using $emulatorType emulator!")
val emulator = Emulator(pathManager, emulatorType)
emulator.createEmulator()
val gradleRunner = GradleRunner(pathManager)