Skip to content

Commit

Permalink
[TEST] Move generated fir tests to test-gen directories
Browse files Browse the repository at this point in the history
  • Loading branch information
demiurg906 committed Nov 27, 2020
1 parent 1ee3828 commit eca769f
Show file tree
Hide file tree
Showing 29 changed files with 74 additions and 18 deletions.
16 changes: 15 additions & 1 deletion compiler/fir/analysis-tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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) {
Expand Down
16 changes: 15 additions & 1 deletion compiler/fir/fir2ir/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.ideaExt.idea

plugins {
kotlin("jvm")
id("jps-compatible")
Expand Down Expand Up @@ -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) {
Expand Down
16 changes: 15 additions & 1 deletion compiler/fir/raw-fir/light-tree2fir/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.ideaExt.idea

plugins {
kotlin("jvm")
id("jps-compatible")
Expand Down Expand Up @@ -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 {
Expand Down
16 changes: 15 additions & 1 deletion compiler/fir/raw-fir/psi2fir/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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) {
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -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: \"")
) {
Expand Down Expand Up @@ -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")
}
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand All @@ -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: \"")
) {
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit eca769f

Please sign in to comment.