Add system property to filter android test execution

This commit is contained in:
Mikhael Bogdanov
2019-01-25 14:00:56 +01:00
parent d3c0937c67
commit 53856daaa4
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -43,5 +43,9 @@ projectTest {
systemProperty("kotlin.test.android.teamcity", true)
}
project.findProperty("kotlin.test.android.path.filter")?.let {
systemProperty("kotlin.test.android.path.filter", it.toString())
}
workingDir = rootDir
}
@@ -41,6 +41,8 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
private val generatedTestNames = Lists.newArrayList<String>()
private val pathFilter: String? = System.getProperties().getProperty("kotlin.test.android.path.filter")
private fun generateOutputFiles() {
prepareAndroidModule()
generateAndSave()
@@ -194,6 +196,10 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
} else if (FileUtilRt.getExtension(file.name) != KotlinFileType.EXTENSION) {
// skip non kotlin files
} else {
if (pathFilter != null && !file.path.contains(pathFilter)) {
continue
}
if (!InTextDirectivesUtils.isPassingTarget(TargetBackend.JVM, file)) {
continue
}