fixing test after changing cleanup scheme - first it is now required to rebuild sources, and therefore consumed memory is increased

This commit is contained in:
Ilya Chernikov
2016-02-18 13:04:16 +01:00
parent 8065e490e8
commit 343735e36c
2 changed files with 6 additions and 5 deletions
@@ -1,7 +1,7 @@
package org.jetbrains.kotlin.gradle
import org.gradle.api.logging.LogLevel
import org.junit.Test
import org.gradle.api.logging.LogLevel
class SimpleKotlinGradleIT : BaseGradleIT() {
@@ -63,12 +63,13 @@ class KotlinGradleIT: BaseGradleIT() {
}
for (i in 1..3) {
project.build(userVariantArg, "build", options = BaseGradleIT.BuildOptions(withDaemon = true)) {
project.build(userVariantArg, "clean", "build", options = BaseGradleIT.BuildOptions(withDaemon = true)) {
assertSuccessful()
val matches = "\\[PERF\\] Used memory after build: (\\d+) kb \\(([+-]?\\d+) kb\\)".toRegex().find(output)
assert(matches != null && matches.groups.size == 3) { "Used memory after build is not reported by plugin" }
val matches = "\\[PERF\\] Used memory after build: (\\d+) kb \\(difference since build start: ([+-]?\\d+) kb\\)".toRegex().find(output)
assert(matches != null && matches.groups.size == 3) { "Used memory after build is not reported by plugin on attempt $i" }
val reportedGrowth = matches!!.groups.get(2)!!.value.removePrefix("+").toInt()
assert(reportedGrowth <= 700) { "Used memory growth $reportedGrowth > 700" }
val expectedGrowthLimit = 2000
assert(reportedGrowth <= expectedGrowthLimit) { "Used memory growth $reportedGrowth > $expectedGrowthLimit" }
}
}