[TEST] Move generated fir tests to test-gen directories

This commit is contained in:
Dmitriy Novozhilov
2020-11-27 12:46:47 +03:00
parent 1ee38286a8
commit eca769f8e4
29 changed files with 74 additions and 18 deletions
+15 -1
View File
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.ideaExt.idea
/*
* Copyright 2000-2018 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.
@@ -29,9 +31,21 @@ dependencies {
testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") }
}
val generationRoot = projectDir.resolve("tests-gen")
sourceSets {
"main" { none() }
"test" { projectDefault() }
"test" {
projectDefault()
this.java.srcDir(generationRoot.name)
}
}
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
apply(plugin = "idea")
idea {
this.module.generatedSourceDirs.add(generationRoot)
}
}
projectTest(parallel = true) {
+15 -1
View File
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.ideaExt.idea
plugins {
kotlin("jvm")
id("jps-compatible")
@@ -34,9 +36,21 @@ dependencies {
testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") }
}
val generationRoot = projectDir.resolve("tests-gen")
sourceSets {
"main" { projectDefault() }
"test" { projectDefault() }
"test" {
projectDefault()
this.java.srcDir(generationRoot.name)
}
}
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
apply(plugin = "idea")
idea {
this.module.generatedSourceDirs.add(generationRoot)
}
}
projectTest(parallel = true) {
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.ideaExt.idea
plugins {
kotlin("jvm")
id("jps-compatible")
@@ -41,9 +43,21 @@ dependencies {
testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") }
}
val generationRoot = projectDir.resolve("tests-gen")
sourceSets {
"main" { projectDefault() }
"test" { projectDefault() }
"test" {
projectDefault()
this.java.srcDir(generationRoot.name)
}
}
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
apply(plugin = "idea")
idea {
this.module.generatedSourceDirs.add(generationRoot)
}
}
projectTest {
+15 -1
View File
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.ideaExt.idea
/*
* Copyright 2000-2018 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.
@@ -31,9 +33,21 @@ dependencies {
testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") }
}
val generationRoot = projectDir.resolve("tests-gen")
sourceSets {
"main" { projectDefault() }
"test" { projectDefault() }
"test" {
projectDefault()
this.java.srcDir(generationRoot.name)
}
}
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
apply(plugin = "idea")
idea {
this.module.generatedSourceDirs.add(generationRoot)
}
}
projectTest(parallel = true) {
@@ -564,7 +564,7 @@ fun main(args: Array<String>) {
}
testGroup(
"compiler/fir/fir2ir/tests", "compiler/testData",
"compiler/fir/fir2ir/tests-gen", "compiler/testData",
testRunnerMethodName = "runTestWithCustomIgnoreDirective",
additionalRunnerArguments = listOf("\"// IGNORE_BACKEND_FIR: \"")
) {
@@ -612,7 +612,7 @@ fun main(args: Array<String>) {
}
}
testGroup("compiler/fir/raw-fir/psi2fir/tests", "compiler/fir/raw-fir/psi2fir/testData") {
testGroup("compiler/fir/raw-fir/psi2fir/tests-gen", "compiler/fir/raw-fir/psi2fir/testData") {
testClass<AbstractRawFirBuilderTestCase> {
model("rawBuilder", testMethod = "doRawFirTest")
}
@@ -626,19 +626,19 @@ fun main(args: Array<String>) {
}
}
testGroup("compiler/fir/raw-fir/psi2fir/tests", "compiler/fir/raw-fir/psi2fir/testData") {
testGroup("compiler/fir/raw-fir/psi2fir/tests-gen", "compiler/fir/raw-fir/psi2fir/testData") {
testClass<AbstractPartialRawFirBuilderTestCase> {
model("partialRawBuilder", testMethod = "doRawFirTest")
}
}
testGroup("compiler/fir/raw-fir/light-tree2fir/tests", "compiler/fir/raw-fir/psi2fir/testData") {
testGroup("compiler/fir/raw-fir/light-tree2fir/tests-gen", "compiler/fir/raw-fir/psi2fir/testData") {
testClass<AbstractLightTree2FirConverterTestCase> {
model("rawBuilder")
}
}
testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") {
testGroup("compiler/fir/analysis-tests/tests-gen", "compiler/fir/analysis-tests/testData") {
testClass<AbstractFirDiagnosticsTest> {
model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME)
}
@@ -653,31 +653,31 @@ fun main(args: Array<String>) {
}
testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") {
testGroup("compiler/fir/analysis-tests/tests-gen", "compiler/fir/analysis-tests/testData") {
testClass<AbstractFirDiagnosticsWithStdlibTest> {
model("resolveWithStdlib", pattern = KT_WITHOUT_DOTS_IN_NAME)
}
}
testGroup("compiler/fir/analysis-tests/tests", "compiler/testData") {
testGroup("compiler/fir/analysis-tests/tests-gen", "compiler/testData") {
testClass<AbstractFirLoadCompiledKotlin> {
model("loadJava/compiledKotlin", extension = "kt")
}
}
testGroup("compiler/fir/analysis-tests/tests", "compiler/testData") {
testGroup("compiler/fir/analysis-tests/tests-gen", "compiler/testData") {
testClass<AbstractFirTypeEnhancementTest> {
model("loadJava/compiledJava", extension = "java")
}
}
testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") {
testGroup("compiler/fir/analysis-tests/tests-gen", "compiler/fir/analysis-tests/testData") {
testClass<AbstractOwnFirTypeEnhancementTest> {
model("enhancement", extension = "java")
}
}
testGroup("compiler/fir/analysis-tests/tests", "compiler/testData") {
testGroup("compiler/fir/analysis-tests/tests-gen", "compiler/testData") {
testClass<AbstractFirOldFrontendDiagnosticsTest> {
model("diagnostics/tests", excludedPattern = excludedFirTestdataPattern)
}
@@ -691,14 +691,14 @@ fun main(args: Array<String>) {
}
}
testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") {
testGroup("compiler/fir/analysis-tests/tests-gen", "compiler/fir/analysis-tests/testData") {
testClass<AbstractFirOldFrontendLightClassesTest> {
model("lightClasses")
}
}
testGroup(
"compiler/fir/fir2ir/tests", "compiler/testData",
"compiler/fir/fir2ir/tests-gen", "compiler/testData",
testRunnerMethodName = "runTestWithCustomIgnoreDirective",
additionalRunnerArguments = listOf("\"// IGNORE_BACKEND_FIR: \"")
) {
@@ -727,13 +727,13 @@ fun main(args: Array<String>) {
}
}
testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") {
testGroup("compiler/fir/analysis-tests/tests-gen", "compiler/fir/analysis-tests/testData") {
testClass<AbstractExtendedFirDiagnosticsTest> {
model("extendedCheckers", pattern = KT_WITHOUT_DOTS_IN_NAME)
}
}
testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") {
testGroup("compiler/fir/analysis-tests/tests-gen", "compiler/fir/analysis-tests/testData") {
testClass<AbstractExtendedFirWithLightTreeDiagnosticsTest> {
model("extendedCheckers", pattern = KT_WITHOUT_DOTS_IN_NAME)
}