Disable test optimization on patterns with wildcards
This commit is contained in:
committed by
Ilya Chernikov
parent
34ac3a818a
commit
98413f200f
@@ -9,7 +9,7 @@ import org.gradle.kotlin.dsl.extra
|
|||||||
fun Project.projectTest(body: Test.() -> Unit = {}): Test = (tasks.findByName("test") as Test).apply {
|
fun Project.projectTest(body: Test.() -> Unit = {}): Test = (tasks.findByName("test") as Test).apply {
|
||||||
doFirst {
|
doFirst {
|
||||||
val patterns = filter.includePatterns + ((filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: emptySet())
|
val patterns = filter.includePatterns + ((filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: emptySet())
|
||||||
if (!patterns.isEmpty()) {
|
if (patterns.isEmpty() || patterns.any { '*' in it }) return@doFirst
|
||||||
patterns.forEach { pattern ->
|
patterns.forEach { pattern ->
|
||||||
val maybeMethodName = pattern.substringAfterLast('.')
|
val maybeMethodName = pattern.substringAfterLast('.')
|
||||||
val className = if (maybeMethodName.isNotEmpty() && maybeMethodName[0].isLowerCase())
|
val className = if (maybeMethodName.isNotEmpty() && maybeMethodName[0].isLowerCase())
|
||||||
@@ -28,7 +28,6 @@ fun Project.projectTest(body: Test.() -> Unit = {}): Test = (tasks.findByName("t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
jvmArgs("-ea", "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx1200m", "-XX:+UseCodeCacheFlushing", "-XX:ReservedCodeCacheSize=128m", "-Djna.nosys=true")
|
jvmArgs("-ea", "-XX:+HeapDumpOnOutOfMemoryError", "-Xmx1200m", "-XX:+UseCodeCacheFlushing", "-XX:ReservedCodeCacheSize=128m", "-Djna.nosys=true")
|
||||||
maxHeapSize = "1200m"
|
maxHeapSize = "1200m"
|
||||||
systemProperty("idea.is.unit.test", "true")
|
systemProperty("idea.is.unit.test", "true")
|
||||||
|
|||||||
Reference in New Issue
Block a user