[Native][tests] Don't track used memory when running in TeamCity
This commit is contained in:
committed by
Space Team
parent
6f249ab615
commit
42a8b28337
@@ -24,7 +24,8 @@ private enum class TestProperty(shortName: String) {
|
||||
GC_SCHEDULER("gcScheduler"),
|
||||
CACHE_MODE("cacheMode"),
|
||||
EXECUTION_TIMEOUT("executionTimeout"),
|
||||
SANITIZER("sanitizer");
|
||||
SANITIZER("sanitizer"),
|
||||
TEAMCITY("teamcity");
|
||||
|
||||
val fullName = "kotlin.internal.native.test.$shortName"
|
||||
}
|
||||
@@ -55,6 +56,11 @@ private class ComputedTestProperties(private val task: Test) {
|
||||
ComputedTestProperty.Lazy(property.fullName, defaultLazyValue())
|
||||
}
|
||||
|
||||
// Do not attempt to read the property from Gradle. Instead, set it based on the lambda return value.
|
||||
fun computePrivate(property: TestProperty, value: () -> String) {
|
||||
computedProperties += ComputedTestProperty.Normal(property.fullName, value())
|
||||
}
|
||||
|
||||
fun lazyClassPath(builder: MutableList<File>.() -> Unit): Lazy<String?> = lazy(LazyThreadSafetyMode.NONE) {
|
||||
buildList(builder).takeIf { it.isNotEmpty() }?.joinToString(File.pathSeparator) { it.absolutePath }
|
||||
}
|
||||
@@ -167,6 +173,9 @@ fun Project.nativeTest(
|
||||
compute(CACHE_MODE)
|
||||
compute(EXECUTION_TIMEOUT)
|
||||
compute(SANITIZER)
|
||||
|
||||
// Pass whether tests are running at TeamCity.
|
||||
computePrivate(TEAMCITY) { kotlinBuildProperties.isTeamcityBuild.toString() }
|
||||
}
|
||||
|
||||
// Pass the current Gradle task name so test can use it in logging.
|
||||
|
||||
Reference in New Issue
Block a user