Perf test: remove info markers in testdata before test
This commit is contained in:
+1
-7
@@ -18,6 +18,7 @@ import org.jetbrains.kotlin.idea.KotlinFileType
|
||||
import org.jetbrains.kotlin.idea.perf.Stats
|
||||
import org.jetbrains.kotlin.idea.perf.TestData
|
||||
import org.jetbrains.kotlin.idea.perf.performanceTest
|
||||
import org.jetbrains.kotlin.idea.perf.util.removeInfoMarkers
|
||||
import org.jetbrains.kotlin.idea.testFramework.commitAllDocuments
|
||||
import org.jetbrains.kotlin.test.InTextDirectivesUtils
|
||||
import java.io.File
|
||||
@@ -78,13 +79,6 @@ abstract class AbstractFirHighlightingPerformanceTest : AbstractHighlightingTest
|
||||
}
|
||||
}
|
||||
|
||||
private fun removeInfoMarkers() {
|
||||
ExpectedHighlightingData(editor.document, true, true).init()
|
||||
|
||||
EdtTestUtil.runInEdtAndWait {
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||
}
|
||||
}
|
||||
|
||||
private fun innerPerfTest(name: String, setUpBody: (TestData<Unit, MutableList<HighlightInfo>>) -> Unit) {
|
||||
performanceTest<Unit, MutableList<HighlightInfo>> {
|
||||
|
||||
+2
@@ -12,6 +12,7 @@ import com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.ensur
|
||||
import com.intellij.util.ThrowableRunnable
|
||||
import org.jetbrains.kotlin.idea.KotlinFileType
|
||||
import org.jetbrains.kotlin.idea.perf.Stats.Companion.WARM_UP
|
||||
import org.jetbrains.kotlin.idea.perf.util.removeInfoMarkers
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
||||
import org.jetbrains.kotlin.idea.testFramework.commitAllDocuments
|
||||
|
||||
@@ -62,6 +63,7 @@ abstract class AbstractPerformanceHighlightingTest : KotlinLightCodeInsightFixtu
|
||||
|
||||
val project = myFixture.project
|
||||
commitAllDocuments()
|
||||
removeInfoMarkers()
|
||||
|
||||
val file = myFixture.file
|
||||
val offset = file.textOffset
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.perf.util
|
||||
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
import com.intellij.testFramework.EdtTestUtil
|
||||
import com.intellij.testFramework.ExpectedHighlightingData
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
||||
|
||||
fun KotlinLightCodeInsightFixtureTestCase.removeInfoMarkers() {
|
||||
ExpectedHighlightingData(editor.document, true, true).init()
|
||||
|
||||
EdtTestUtil.runInEdtAndWait {
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user