PerfTests gradle interceptor clean up

This commit is contained in:
Vladimir Dolzhenko
2020-05-26 21:49:38 +02:00
parent a1c173733c
commit 5c58a9dfd1
3 changed files with 15 additions and 14 deletions
@@ -38,11 +38,7 @@ class HighlightWholeProjectPerformanceTest : UsefulTestCase() {
fun testHighlightAllKtFilesInProject() { fun testHighlightAllKtFilesInProject() {
val emptyProfile = System.getProperty("emptyProfile", "false").toBoolean() val emptyProfile = System.getProperty("emptyProfile", "false").toBoolean()
val projectSpecs = projectSpecs() val projectSpecs = projectSpecs()
for (projectSpec in projectSpecs) { suite(suiteName = "allKtFilesInProject") {
val projectName = projectSpec.name
val projectPath = projectSpec.path
suite(suiteName = "$projectName project") {
app { app {
warmUpProject() warmUpProject()
@@ -50,6 +46,9 @@ class HighlightWholeProjectPerformanceTest : UsefulTestCase() {
warmup = 1 warmup = 1
iterations = 3 iterations = 3
} }
for (projectSpec in projectSpecs) {
val projectName = projectSpec.name
val projectPath = projectSpec.path
try { try {
project(ExternalProject(projectPath, ProjectOpenAction.GRADLE_PROJECT), refresh = true) { project(ExternalProject(projectPath, ProjectOpenAction.GRADLE_PROJECT), refresh = true) {
@@ -93,7 +92,6 @@ class HighlightWholeProjectPerformanceTest : UsefulTestCase() {
// nothing as it is already caught by perfTest // nothing as it is already caught by perfTest
} }
} }
} }
} }
} }
@@ -9,7 +9,7 @@ import java.io.PrintWriter
import java.io.StringWriter import java.io.StringWriter
inline fun gradleMessage(block: () -> String) { inline fun gradleMessage(block: () -> String) {
//print("#gradle ${block()}") print("#gradle ${block()}")
} }
inline fun logMessage(message: () -> String) { inline fun logMessage(message: () -> String) {
@@ -24,8 +24,11 @@ interface GradleProcessOutputInterceptor {
fun install(parentDisposable: Disposable) { fun install(parentDisposable: Disposable) {
val installedExtensions = EP.extensions val installedExtensions = EP.extensions
val actual = installedExtensions.firstIsInstanceOrNull<GradleProcessOutputInterceptor>()
if (actual is GradleProcessOutputInterceptorImpl) return
assertNull( assertNull(
installedExtensions.firstIsInstanceOrNull<GradleProcessOutputInterceptor>(), actual,
"Another ${GradleProcessOutputInterceptor::class.java.simpleName} is already installed" "Another ${GradleProcessOutputInterceptor::class.java.simpleName} is already installed"
) )