Support test parallelization in uast tests
This commit is contained in:
@@ -7,8 +7,11 @@ package org.jetbrains.kotlin.checkers
|
|||||||
|
|
||||||
import com.intellij.codeInspection.ex.EntryPointsManagerBase
|
import com.intellij.codeInspection.ex.EntryPointsManagerBase
|
||||||
import com.intellij.testFramework.LightProjectDescriptor
|
import com.intellij.testFramework.LightProjectDescriptor
|
||||||
|
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner
|
||||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
|
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
|
||||||
class PsiCheckerCustomTest : AbstractPsiCheckerTest() {
|
class PsiCheckerCustomTest : AbstractPsiCheckerTest() {
|
||||||
fun testNoUnusedParameterWhenCustom() {
|
fun testNoUnusedParameterWhenCustom() {
|
||||||
val testAnnotation = "MyTestAnnotation"
|
val testAnnotation = "MyTestAnnotation"
|
||||||
|
|||||||
@@ -59,6 +59,6 @@ sourceSets {
|
|||||||
|
|
||||||
testsJar {}
|
testsJar {}
|
||||||
|
|
||||||
projectTest(parallel = false) {
|
projectTest(parallel = true) {
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,9 +30,12 @@ import org.jetbrains.kotlin.psi.KtFile
|
|||||||
import org.jetbrains.kotlin.psi.KtPsiFactory
|
import org.jetbrains.kotlin.psi.KtPsiFactory
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.findDescendantOfType
|
import org.jetbrains.kotlin.psi.psiUtil.findDescendantOfType
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
|
import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
|
||||||
|
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner
|
||||||
import org.jetbrains.uast.*
|
import org.jetbrains.uast.*
|
||||||
import org.jetbrains.uast.test.env.kotlin.findUElementByTextFromPsi
|
import org.jetbrains.uast.test.env.kotlin.findUElementByTextFromPsi
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
|
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
|
||||||
class KotlinDetachedUastTest : KotlinLightCodeInsightFixtureTestCase() {
|
class KotlinDetachedUastTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||||
|
|
||||||
override fun getProjectDescriptor(): LightProjectDescriptor = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
override fun getProjectDescriptor(): LightProjectDescriptor = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
||||||
|
|||||||
@@ -19,13 +19,15 @@ import com.intellij.testFramework.LightProjectDescriptor
|
|||||||
import com.intellij.testFramework.registerServiceInstance
|
import com.intellij.testFramework.registerServiceInstance
|
||||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
||||||
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
||||||
|
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner
|
||||||
import org.jetbrains.uast.UExpression
|
import org.jetbrains.uast.UExpression
|
||||||
import org.jetbrains.uast.evaluateString
|
import org.jetbrains.uast.evaluateString
|
||||||
import org.jetbrains.uast.toUElementOfType
|
import org.jetbrains.uast.toUElementOfType
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
import org.junit.runner.RunWith
|
||||||
import kotlin.test.fail
|
import kotlin.test.fail
|
||||||
|
|
||||||
|
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
|
||||||
class KotlinUastReferencesTest : KotlinLightCodeInsightFixtureTestCase() {
|
class KotlinUastReferencesTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||||
|
|
||||||
override fun getProjectDescriptor(): LightProjectDescriptor = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
override fun getProjectDescriptor(): LightProjectDescriptor = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
||||||
|
|||||||
@@ -19,13 +19,15 @@ import com.intellij.testFramework.LightProjectDescriptor
|
|||||||
import com.intellij.testFramework.registerServiceInstance
|
import com.intellij.testFramework.registerServiceInstance
|
||||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
||||||
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
||||||
|
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner
|
||||||
import org.jetbrains.uast.UExpression
|
import org.jetbrains.uast.UExpression
|
||||||
import org.jetbrains.uast.evaluateString
|
import org.jetbrains.uast.evaluateString
|
||||||
import org.jetbrains.uast.toUElementOfType
|
import org.jetbrains.uast.toUElementOfType
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
import org.junit.runner.RunWith
|
||||||
import kotlin.test.fail
|
import kotlin.test.fail
|
||||||
|
|
||||||
|
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
|
||||||
class KotlinUastReferencesTest : KotlinLightCodeInsightFixtureTestCase() {
|
class KotlinUastReferencesTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||||
|
|
||||||
override fun getProjectDescriptor(): LightProjectDescriptor = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
override fun getProjectDescriptor(): LightProjectDescriptor = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.intellij.testFramework.LightProjectDescriptor
|
|||||||
import junit.framework.TestCase
|
import junit.framework.TestCase
|
||||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
||||||
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
||||||
|
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner
|
||||||
import org.jetbrains.uast.UElement
|
import org.jetbrains.uast.UElement
|
||||||
import org.jetbrains.uast.UQualifiedReferenceExpression
|
import org.jetbrains.uast.UQualifiedReferenceExpression
|
||||||
import org.jetbrains.uast.getContainingUMethod
|
import org.jetbrains.uast.getContainingUMethod
|
||||||
@@ -20,7 +21,9 @@ import org.jetbrains.uast.test.env.kotlin.findElementByText
|
|||||||
import org.jetbrains.uast.test.env.kotlin.findElementByTextFromPsi
|
import org.jetbrains.uast.test.env.kotlin.findElementByTextFromPsi
|
||||||
import org.jetbrains.uast.test.env.kotlin.findUElementByTextFromPsi
|
import org.jetbrains.uast.test.env.kotlin.findUElementByTextFromPsi
|
||||||
import org.jetbrains.uast.toUElement
|
import org.jetbrains.uast.toUElement
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
|
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
|
||||||
class KotlinUastResolveApiTest : KotlinLightCodeInsightFixtureTestCase() {
|
class KotlinUastResolveApiTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||||
|
|
||||||
override fun getProjectDescriptor(): LightProjectDescriptor =
|
override fun getProjectDescriptor(): LightProjectDescriptor =
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
|||||||
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
||||||
import org.jetbrains.uast.UQualifiedReferenceExpression
|
import org.jetbrains.uast.UQualifiedReferenceExpression
|
||||||
import org.jetbrains.uast.test.env.kotlin.findUElementByTextFromPsi
|
import org.jetbrains.uast.test.env.kotlin.findUElementByTextFromPsi
|
||||||
|
import org.jetbrains.kotlin.test.JUnit3WithIdeaConfigurationRunner
|
||||||
|
import org.junit.runner.RunWith
|
||||||
|
|
||||||
|
@RunWith(JUnit3WithIdeaConfigurationRunner::class)
|
||||||
class KotlinUastResolveApiTest : KotlinLightCodeInsightFixtureTestCase() {
|
class KotlinUastResolveApiTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||||
|
|
||||||
override fun getProjectDescriptor(): LightProjectDescriptor =
|
override fun getProjectDescriptor(): LightProjectDescriptor =
|
||||||
|
|||||||
Vendored
+8
@@ -13,6 +13,7 @@ import com.intellij.openapi.util.text.StringUtil
|
|||||||
import com.intellij.psi.PsiManager
|
import com.intellij.psi.PsiManager
|
||||||
import com.intellij.rt.execution.junit.FileComparisonFailure
|
import com.intellij.rt.execution.junit.FileComparisonFailure
|
||||||
import junit.framework.TestCase
|
import junit.framework.TestCase
|
||||||
|
import org.jetbrains.kotlin.test.IdeaSystemPropertiesForParallelRunConfigurator
|
||||||
import org.jetbrains.uast.UastContext
|
import org.jetbrains.uast.UastContext
|
||||||
import org.jetbrains.uast.UastLanguagePlugin
|
import org.jetbrains.uast.UastLanguagePlugin
|
||||||
import org.jetbrains.uast.evaluation.UEvaluatorExtension
|
import org.jetbrains.uast.evaluation.UEvaluatorExtension
|
||||||
@@ -20,6 +21,13 @@ import org.jetbrains.uast.java.JavaUastLanguagePlugin
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
abstract class AbstractTestWithCoreEnvironment : TestCase() {
|
abstract class AbstractTestWithCoreEnvironment : TestCase() {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
init {
|
||||||
|
IdeaSystemPropertiesForParallelRunConfigurator.setProperties()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private var myEnvironment: AbstractCoreEnvironment? = null
|
private var myEnvironment: AbstractCoreEnvironment? = null
|
||||||
|
|
||||||
protected val environment: AbstractCoreEnvironment
|
protected val environment: AbstractCoreEnvironment
|
||||||
|
|||||||
Reference in New Issue
Block a user