From 9319c4c96e3aed0546bca5800cbefc02abbf6225 Mon Sep 17 00:00:00 2001 From: Vladimir Dolzhenko Date: Mon, 8 Jun 2020 19:05:10 +0000 Subject: [PATCH] DryRun mode for GenerateTests is added Relates to #KTI-17 --- .../generators/tests/GenerateJava8Tests.kt | 58 +- .../spec/utils/tasks/GenerateSpecTests.kt | 52 +- .../generators/tests/GenerateCompilerTests.kt | 1100 +++---- .../tests/GenerateRuntimeDescriptorTests.kt | 20 +- generators/main/GeneratorsFileUtil.kt | 8 +- .../tests/generator/TestGenerationDSL.kt | 79 +- .../tests/generator/TestGenerator.kt | 32 +- .../kotlin/generators/tests/GenerateTests.kt | 2563 +++++++++-------- .../generators/tests/GenerateTests.kt.as36 | 2012 ++++++------- .../generators/tests/GenerateTests.kt.as40 | 2034 ++++++------- .../generators/tests/GenerateTests.kt.as41 | 2032 ++++++------- .../generators/tests/GenerateJsTests.kt | 146 +- .../kotlin/pill/generateAllTests/Main.java | 21 +- 13 files changed, 5139 insertions(+), 5018 deletions(-) diff --git a/compiler/tests-java8/tests/org/jetbrains/kotlin/generators/tests/GenerateJava8Tests.kt b/compiler/tests-java8/tests/org/jetbrains/kotlin/generators/tests/GenerateJava8Tests.kt index 8e2ada6a118..a4c9222fdde 100644 --- a/compiler/tests-java8/tests/org/jetbrains/kotlin/generators/tests/GenerateJava8Tests.kt +++ b/compiler/tests-java8/tests/org/jetbrains/kotlin/generators/tests/GenerateJava8Tests.kt @@ -20,48 +20,50 @@ import org.jetbrains.kotlin.checkers.AbstractForeignJava8AnnotationsNoAnnotation import org.jetbrains.kotlin.checkers.AbstractForeignJava8AnnotationsNoAnnotationInClasspathWithPsiClassReadingTest import org.jetbrains.kotlin.checkers.AbstractForeignJava8AnnotationsTest import org.jetbrains.kotlin.checkers.javac.AbstractJavacForeignJava8AnnotationsTest -import org.jetbrains.kotlin.generators.tests.generator.testGroup +import org.jetbrains.kotlin.generators.tests.generator.testGroupSuite import org.jetbrains.kotlin.jvm.compiler.AbstractLoadJava8Test import org.jetbrains.kotlin.jvm.compiler.AbstractLoadJava8WithPsiClassReadingTest import org.jetbrains.kotlin.jvm.compiler.javac.AbstractLoadJava8UsingJavacTest import org.jetbrains.kotlin.resolve.calls.AbstractEnhancedSignaturesResolvedCallsTest -fun main() { +fun main(args: Array) { System.setProperty("java.awt.headless", "true") - testGroup("compiler/tests-java8/tests", "compiler/testData") { - testClass { - model("foreignAnnotationsJava8/tests") - } + testGroupSuite(args) { + testGroup("compiler/tests-java8/tests", "compiler/testData") { + testClass { + model("foreignAnnotationsJava8/tests") + } - testClass { - model("foreignAnnotationsJava8/tests") - } + testClass { + model("foreignAnnotationsJava8/tests") + } - testClass { - model("foreignAnnotationsJava8/tests") - } + testClass { + model("foreignAnnotationsJava8/tests") + } - testClass { - model("foreignAnnotationsJava8/tests") - } + testClass { + model("foreignAnnotationsJava8/tests") + } - testClass { - model("loadJava8/compiledJava", extension = "java", testMethod = "doTestCompiledJava") - model("loadJava8/sourceJava", extension = "java", testMethod = "doTestSourceJava") - } + testClass { + model("loadJava8/compiledJava", extension = "java", testMethod = "doTestCompiledJava") + model("loadJava8/sourceJava", extension = "java", testMethod = "doTestSourceJava") + } - testClass { - model("loadJava8/compiledJava", extension = "java", testMethod = "doTestCompiledJava") - model("loadJava8/sourceJava", extension = "java", testMethod = "doTestSourceJava") - } + testClass { + model("loadJava8/compiledJava", extension = "java", testMethod = "doTestCompiledJava") + model("loadJava8/sourceJava", extension = "java", testMethod = "doTestSourceJava") + } - testClass { - model("loadJava8/compiledJava", extension = "java", testMethod = "doTestCompiledJava") - } + testClass { + model("loadJava8/compiledJava", extension = "java", testMethod = "doTestCompiledJava") + } - testClass { - model("resolvedCalls/enhancedSignatures") + testClass { + model("resolvedCalls/enhancedSignatures") + } } } } diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/tasks/GenerateSpecTests.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/tasks/GenerateSpecTests.kt index 232ba3fb7f6..80257c616d1 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/tasks/GenerateSpecTests.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/tasks/GenerateSpecTests.kt @@ -5,7 +5,7 @@ package org.jetbrains.kotlin.spec.utils.tasks -import org.jetbrains.kotlin.generators.tests.generator.testGroup +import org.jetbrains.kotlin.generators.tests.generator.testGroupSuite import org.jetbrains.kotlin.spec.checkers.AbstractDiagnosticsTestSpec import org.jetbrains.kotlin.spec.checkers.AbstractFirDiagnosticsTestSpec import org.jetbrains.kotlin.spec.codegen.AbstractBlackBoxCodegenTestSpec @@ -38,32 +38,34 @@ fun detectDirsWithTestsMapFileOnly(dirName: String): List { fun generateTests() { val excludedFirTestdataPattern = "^(.+)\\.fir\\.kts?\$" - testGroup(SPEC_TEST_PATH, SPEC_TESTDATA_PATH) { - testClass { - model( - "diagnostics", - excludeDirs = listOf("helpers") + detectDirsWithTestsMapFileOnly("diagnostics"), - excludedPattern = excludedFirTestdataPattern - ) - } + testGroupSuite { + testGroup(SPEC_TEST_PATH, SPEC_TESTDATA_PATH) { + testClass { + model( + "diagnostics", + excludeDirs = listOf("helpers") + detectDirsWithTestsMapFileOnly("diagnostics"), + excludedPattern = excludedFirTestdataPattern + ) + } - testClass { - model( - "diagnostics", - excludeDirs = listOf("helpers") + detectDirsWithTestsMapFileOnly("diagnostics"), - excludedPattern = excludedFirTestdataPattern - ) - } + testClass { + model( + "diagnostics", + excludeDirs = listOf("helpers") + detectDirsWithTestsMapFileOnly("diagnostics"), + excludedPattern = excludedFirTestdataPattern + ) + } - testClass { - model( - relativeRootPath = "psi", - testMethod = "doParsingTest", - excludeDirs = listOf("helpers", "templates") + detectDirsWithTestsMapFileOnly("psi") - ) - } - testClass { - model("codegen/box", excludeDirs = listOf("helpers", "templates") + detectDirsWithTestsMapFileOnly("codegen/box")) + testClass { + model( + relativeRootPath = "psi", + testMethod = "doParsingTest", + excludeDirs = listOf("helpers", "templates") + detectDirsWithTestsMapFileOnly("psi") + ) + } + testClass { + model("codegen/box", excludeDirs = listOf("helpers", "templates") + detectDirsWithTestsMapFileOnly("codegen/box")) + } } } } diff --git a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt index 9b6971f8609..b609d872c0c 100644 --- a/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt +++ b/compiler/tests/org/jetbrains/kotlin/generators/tests/GenerateCompilerTests.kt @@ -27,7 +27,7 @@ import org.jetbrains.kotlin.fir.java.AbstractFirOldFrontendLightClassesTest import org.jetbrains.kotlin.fir.java.AbstractFirTypeEnhancementTest import org.jetbrains.kotlin.fir.java.AbstractOwnFirTypeEnhancementTest import org.jetbrains.kotlin.fir.lightTree.AbstractLightTree2FirConverterTestCase -import org.jetbrains.kotlin.generators.tests.generator.testGroup +import org.jetbrains.kotlin.generators.tests.generator.testGroupSuite import org.jetbrains.kotlin.generators.util.KT_OR_KTS_WITHOUT_DOTS_IN_NAME import org.jetbrains.kotlin.generators.util.KT_WITHOUT_DOTS_IN_NAME import org.jetbrains.kotlin.integration.AbstractAntTaskTest @@ -59,565 +59,579 @@ import org.jetbrains.kotlin.types.AbstractTypeBindingTest import org.jetbrains.kotlin.visualizer.fir.AbstractFirVisualizer import org.jetbrains.kotlin.visualizer.psi.AbstractPsiVisualizer -fun main() { +fun main(args: Array) { System.setProperty("java.awt.headless", "true") val excludedFirTestdataPattern = "^(.+)\\.fir\\.kts?\$" - testGroup("compiler/tests", "compiler/testData") { - testClass(suiteTestClassName = "DiagnosticsTestGenerated") { - model("diagnostics/tests", pattern = "^(.*)\\.kts?$", excludedPattern = excludedFirTestdataPattern) - model("codegen/box/diagnostics") + testGroupSuite(args) { + testGroup("compiler/tests", "compiler/testData") { + testClass(suiteTestClassName = "DiagnosticsTestGenerated") { + model("diagnostics/tests", pattern = "^(.*)\\.kts?$", excludedPattern = excludedFirTestdataPattern) + model("codegen/box/diagnostics") + } + + testClass { + model("diagnostics/tests", excludedPattern = excludedFirTestdataPattern) + model("codegen/box/diagnostics") + } + + testClass { + model("javac/diagnostics/tests", excludedPattern = excludedFirTestdataPattern) + model( + "javac/diagnostics/tests", + testClassName = "TestsWithoutJavac", + testMethod = "doTestWithoutJavacWrapper", + excludedPattern = excludedFirTestdataPattern + ) + } + + testClass { + model("javac/fieldsResolution/tests") + model("javac/fieldsResolution/tests", testClassName = "TestsWithoutJavac", testMethod = "doTestWithoutJavacWrapper") + } + + testClass { + model("diagnostics/testsWithStdLib", excludedPattern = excludedFirTestdataPattern) + } + + testClass { + model("diagnostics/testsWithStdLib", excludedPattern = excludedFirTestdataPattern) + } + + testClass { + model("diagnostics/testsWithJsStdLib") + } + + testClass { + model("diagnostics/testsWithJsStdLibAndBackendCompilation") + } + + testClass { + model("diagnostics/nativeTests") + } + + testClass { + model("diagnostics/testWithModifiedMockJdk") + } + + testClass { + model("diagnostics/testsWithJava9") + } + + testClass { + model("diagnostics/testsWithUnsignedTypes") + } + + testClass { + model("diagnostics/testsWithExplicitApi") + } + + testClass { + model("diagnostics/testsWithJvmBackend", targetBackend = TargetBackend.JVM_OLD) + } + + testClass { + model("diagnostics/testsWithJvmBackend", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("multiplatform", extension = null, recursive = true, excludeParentDirs = true) + } + + testClass { + model("foreignAnnotations/tests") + } + + testClass { + model("foreignAnnotations/tests") + } + + testClass { + model("foreignAnnotations/tests") + } + + testClass { + model("foreignAnnotations/tests") + } + + testClass { + model("resolve", extension = "resolve") + } + + testClass { + model("resolvedCalls", excludeDirs = listOf("enhancedSignatures")) + } + + testClass { + model("resolveConstructorDelegationCalls") + } + + testClass { + model("constraintSystem", extension = "constraints") + } + + testClass { + model("psi", testMethod = "doParsingTest", pattern = "^(.*)\\.kts?$") + model("parseCodeFragment/expression", testMethod = "doExpressionCodeFragmentParsingTest", extension = "kt") + model("parseCodeFragment/block", testMethod = "doBlockCodeFragmentParsingTest", extension = "kt") + } + + GenerateRangesCodegenTestData.main(args) + GenerateInRangeExpressionTestData.main(args) + GenerateSteppedRangesCodegenTestData.main(args) + GeneratePrimitiveVsObjectEqualityTestData.main(args) + + testClass { + model("codegen/box", targetBackend = TargetBackend.JVM) + } + + testClass { + // "ranges/stepped" is excluded because it contains hundreds of generated tests and only have a box() method. + // There isn't much to be gained from running light analysis tests on them. + model("codegen/box", targetBackend = TargetBackend.JVM, skipIgnored = true, excludeDirs = listOf("ranges/stepped")) + } + + testClass { + model("codegen/kapt", targetBackend = TargetBackend.JVM) + } + + testClass { + model("codegen/asmLike", targetBackend = TargetBackend.JVM) + } + + testClass { + model("codegen/boxInline", targetBackend = TargetBackend.JVM) + } + + testClass { + model("codegen/boxAgainstJava") + } + + testClass { + model("codegen/script", extension = "kts") + } + + testClass { + model("codegen/customScript", pattern = "^(.*)$") + } + + testClass { + model("codegen/bytecodeText", targetBackend = TargetBackend.JVM) + } + + testClass { + model("ir/irText") + } + + testClass { + model("ir/irJsText", pattern = "^(.+)\\.kt(s)?\$") + } + + testClass { + model("ir/irCfg") + } + + testClass { + model("ir/sourceRanges") + } + + + + testClass { + model("codegen/bytecodeListing") + } + + testClass { + model("codegen/topLevelMemberInvocation", extension = null, recursive = false) + } + + testClass { + model("checkLocalVariablesTable", targetBackend = TargetBackend.JVM) + } + + testClass { + model("writeFlags", targetBackend = TargetBackend.JVM) + } + + testClass { + model("codegen/defaultArguments/reflection") + } + + testClass { + model("codegen/dumpDeclarations") + } + + testClass { + model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava") + model("loadJava/compiledJavaAndKotlin", extension = "txt", testMethod = "doTestCompiledJavaAndKotlin") + model( + "loadJava/compiledJavaIncludeObjectMethods", + extension = "java", + testMethod = "doTestCompiledJavaIncludeObjectMethods" + ) + model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") + model("loadJava/compiledKotlinWithStdlib", testMethod = "doTestCompiledKotlinWithStdlib") + model("loadJava/javaAgainstKotlin", extension = "txt", testMethod = "doTestJavaAgainstKotlin") + model( + "loadJava/kotlinAgainstCompiledJavaWithKotlin", + extension = "kt", + testMethod = "doTestKotlinAgainstCompiledJavaWithKotlin", + recursive = false + ) + model("loadJava/sourceJava", extension = "java", testMethod = "doTestSourceJava") + } + + testClass { + model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava") + model("loadJava/compiledJavaAndKotlin", extension = "txt", testMethod = "doTestCompiledJavaAndKotlin") + model( + "loadJava/compiledJavaIncludeObjectMethods", + extension = "java", + testMethod = "doTestCompiledJavaIncludeObjectMethods" + ) + model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") + model("loadJava/compiledKotlinWithStdlib", testMethod = "doTestCompiledKotlinWithStdlib") + model("loadJava/javaAgainstKotlin", extension = "txt", testMethod = "doTestJavaAgainstKotlin") + model( + "loadJava/kotlinAgainstCompiledJavaWithKotlin", + extension = "kt", + testMethod = "doTestKotlinAgainstCompiledJavaWithKotlin", + recursive = false + ) + model("loadJava/sourceJava", extension = "java", testMethod = "doTestSourceJava") + } + + testClass { + model("loadJava/compiledKotlin") + } + + testClass { + model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava") + } + + testClass { + model( + "compileJavaAgainstKotlin", + testClassName = "WithoutJavac", + testMethod = "doTestWithoutJavac", + targetBackend = TargetBackend.JVM + ) + model( + "compileJavaAgainstKotlin", + testClassName = "WithJavac", + testMethod = "doTestWithJavac", + targetBackend = TargetBackend.JVM + ) + } + + testClass { + model("compileKotlinAgainstJava", testClassName = "WithAPT", testMethod = "doTestWithAPT") + model("compileKotlinAgainstJava", testClassName = "WithoutAPT", testMethod = "doTestWithoutAPT") + } + + testClass { + model("compileKotlinAgainstKotlin") + } + + testClass { + model("renderer") + } + + testClass { + model("renderFunctionDescriptorInExpression") + } + + testClass { + model("modules.xml", extension = "xml") + } + + testClass { + model("writeSignature") + } + + testClass { + model("cli/jvm", extension = "args", testMethod = "doJvmTest", recursive = false) + model("cli/js", extension = "args", testMethod = "doJsTest", recursive = false) + model("cli/js-dce", extension = "args", testMethod = "doJsDceTest", recursive = false) + model("cli/metadata", extension = "args", testMethod = "doMetadataTest", recursive = false) + } + + testClass { + model("repl", extension = "repl") + } + + testClass { + model("integration/ant/jvm", extension = null, recursive = false, excludeParentDirs = true) + } + + testClass { + model("cfg") + model("cfgWithStdLib", testMethod = "doTestWithStdLib") + } + + testClass { + model("cfg-variables") + model("cfgVariablesWithStdLib", testMethod = "doTestWithStdLib") + } + + testClass { + model("cfg") + model("cfgWithStdLib", testMethod = "doTestWithStdLib") + model("cfg-variables") + model("cfgVariablesWithStdLib", testMethod = "doTestWithStdLib") + } + + testClass { + model("resolveAnnotations/parameters") + } + + testClass { + model("evaluate/constant", testMethod = "doConstantTest") + model("evaluate/isPure", testMethod = "doIsPureTest") + model("evaluate/usesVariableAsConstant", testMethod = "doUsesVariableAsConstantTest") + } + + testClass { + model("asJava/lightClasses", excludeDirs = listOf("local", "ideRegression"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("type/binding") + } + + testClass(useJunit4 = true) { + model("debug/stepping", targetBackend = TargetBackend.JVM) + } + + testClass(useJunit4 = true) { + model("debug/localVariables", targetBackend = TargetBackend.JVM) + } + + testClass { + model("serialization/local") + } + + testClass { + model("lexer/kdoc") + } + + testClass { + model("lexer/kotlin") + } + + testClass { + model("codegen/box", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) + } + + testClass { + model("codegen/boxAgainstJava", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) + } + + testClass { + model( + "compileJavaAgainstKotlin", + testClassName = "WithoutJavac", + testMethod = "doTestWithoutJavac", + targetBackend = TargetBackend.JVM_IR + ) + //model("compileJavaAgainstKotlin", testClassName = "WithJavac", testMethod = "doTestWithJavac", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("compileKotlinAgainstKotlin", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("codegen/bytecodeListing", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("checkLocalVariablesTable", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("writeFlags", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("writeSignature", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava", targetBackend = TargetBackend.JVM_IR) + model( + "loadJava/compiledJavaAndKotlin", + extension = "txt", + testMethod = "doTestCompiledJavaAndKotlin", + targetBackend = TargetBackend.JVM_IR + ) + model( + "loadJava/compiledJavaIncludeObjectMethods", + extension = "java", + testMethod = "doTestCompiledJavaIncludeObjectMethods", + targetBackend = TargetBackend.JVM_IR + ) + model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin", targetBackend = TargetBackend.JVM_IR) + model( + "loadJava/compiledKotlinWithStdlib", + testMethod = "doTestCompiledKotlinWithStdlib", + targetBackend = TargetBackend.JVM_IR + ) + model( + "loadJava/javaAgainstKotlin", + extension = "txt", + testMethod = "doTestJavaAgainstKotlin", + targetBackend = TargetBackend.JVM_IR + ) + model( + "loadJava/kotlinAgainstCompiledJavaWithKotlin", + extension = "kt", + testMethod = "doTestKotlinAgainstCompiledJavaWithKotlin", + recursive = false, + targetBackend = TargetBackend.JVM_IR + ) + model("loadJava/sourceJava", extension = "java", testMethod = "doTestSourceJava", targetBackend = TargetBackend.JVM_IR) + } + + testClass(useJunit4 = true) { + model("debug/stepping", targetBackend = TargetBackend.JVM_IR) + } + + testClass(useJunit4 = true) { + model("debug/localVariables", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("codegen/boxInline", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("codegen/bytecodeText", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) + } + + testClass { + model("codegen/asmLike", targetBackend = TargetBackend.JVM_IR) + } + } + + testGroup( + "compiler/fir/fir2ir/tests", "compiler/testData", + testRunnerMethodName = "runTestWithCustomIgnoreDirective", + additionalRunnerArguments = listOf("\"// IGNORE_BACKEND_FIR: \"") + ) { + testClass { + model("codegen/box", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) + } + } + + testGroup( + "compiler/tests", "compiler/testData", + testRunnerMethodName = "runTestWithCustomIgnoreDirective", + additionalRunnerArguments = listOf("\"// IGNORE_BACKEND_MULTI_MODULE: \"") + ) { + testClass { + model("codegen/boxInline", targetBackend = TargetBackend.JVM) + } + testClass { + model("codegen/boxInline", targetBackend = TargetBackend.JVM_IR) + } + } + + testGroup("compiler/fir/raw-fir/psi2fir/tests", "compiler/fir/raw-fir/psi2fir/testData") { + testClass { + model("rawBuilder", testMethod = "doRawFirTest") + } + } + + testGroup("compiler/fir/raw-fir/light-tree2fir/tests", "compiler/fir/raw-fir/psi2fir/testData") { + testClass { + model("rawBuilder") + } + } + + testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") { + testClass { + model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + } + + testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") { + testClass { + model("resolveWithStdlib", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + } + + testGroup("compiler/fir/analysis-tests/tests", "compiler/testData") { + testClass { + model("loadJava/compiledKotlin", extension = "kt") + } + } + + testGroup("compiler/fir/analysis-tests/tests", "compiler/testData") { + testClass { + model("loadJava/compiledJava", extension = "java") + } + } + + testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") { + testClass { + model("enhancement", extension = "java") + } } - testClass { - model("diagnostics/tests", excludedPattern = excludedFirTestdataPattern) - model("codegen/box/diagnostics") - } - - testClass { - model("javac/diagnostics/tests", excludedPattern = excludedFirTestdataPattern) - model( - "javac/diagnostics/tests", - testClassName = "TestsWithoutJavac", - testMethod = "doTestWithoutJavacWrapper", - excludedPattern = excludedFirTestdataPattern - ) - } - - testClass { - model("javac/fieldsResolution/tests") - model("javac/fieldsResolution/tests", testClassName = "TestsWithoutJavac", testMethod = "doTestWithoutJavacWrapper") - } - - testClass { - model("diagnostics/testsWithStdLib", excludedPattern = excludedFirTestdataPattern) - } - - testClass { - model("diagnostics/testsWithStdLib", excludedPattern = excludedFirTestdataPattern) - } - - testClass { - model("diagnostics/testsWithJsStdLib") - } - - testClass { - model("diagnostics/testsWithJsStdLibAndBackendCompilation") - } - - testClass { - model("diagnostics/nativeTests") - } - - testClass { - model("diagnostics/testWithModifiedMockJdk") - } - - testClass { - model("diagnostics/testsWithJava9") - } - - testClass { - model("diagnostics/testsWithUnsignedTypes") - } - - testClass { - model("diagnostics/testsWithExplicitApi") - } - - testClass { - model("diagnostics/testsWithJvmBackend", targetBackend = TargetBackend.JVM_OLD) - } - - testClass { - model("diagnostics/testsWithJvmBackend", targetBackend = TargetBackend.JVM_IR) - } - - testClass { - model("multiplatform", extension = null, recursive = true, excludeParentDirs = true) - } - - testClass { - model("foreignAnnotations/tests") - } - - testClass { - model("foreignAnnotations/tests") - } - - testClass { - model("foreignAnnotations/tests") - } - - testClass { - model("foreignAnnotations/tests") - } - - testClass { - model("resolve", extension = "resolve") - } - - testClass { - model("resolvedCalls", excludeDirs = listOf("enhancedSignatures")) - } - - testClass { - model("resolveConstructorDelegationCalls") - } - - testClass { - model("constraintSystem", extension = "constraints") - } - - testClass { - model("psi", testMethod = "doParsingTest", pattern = "^(.*)\\.kts?$") - model("parseCodeFragment/expression", testMethod = "doExpressionCodeFragmentParsingTest", extension = "kt") - model("parseCodeFragment/block", testMethod = "doBlockCodeFragmentParsingTest", extension = "kt") - } - - GenerateRangesCodegenTestData.main(emptyArray()) - GenerateInRangeExpressionTestData.main(emptyArray()) - GenerateSteppedRangesCodegenTestData.main(emptyArray()) - GeneratePrimitiveVsObjectEqualityTestData.main(emptyArray()) - - testClass { - model("codegen/box", targetBackend = TargetBackend.JVM) - } - - testClass { - // "ranges/stepped" is excluded because it contains hundreds of generated tests and only have a box() method. - // There isn't much to be gained from running light analysis tests on them. - model("codegen/box", targetBackend = TargetBackend.JVM, skipIgnored = true, excludeDirs = listOf("ranges/stepped")) - } - - testClass { - model("codegen/kapt", targetBackend = TargetBackend.JVM) - } - - testClass { - model("codegen/asmLike", targetBackend = TargetBackend.JVM) - } - - testClass { - model("codegen/boxInline", targetBackend = TargetBackend.JVM) - } - - testClass { - model("codegen/boxAgainstJava") - } - - testClass { - model("codegen/script", extension = "kts") - } - - testClass { - model("codegen/customScript", pattern = "^(.*)$") - } - - testClass { - model("codegen/bytecodeText", targetBackend = TargetBackend.JVM) - } - - testClass { - model("ir/irText") - } - - testClass { - model("ir/irJsText", pattern = "^(.+)\\.kt(s)?\$") - } - - testClass { - model("ir/irCfg") - } - - testClass { - model("ir/sourceRanges") - } - - - - testClass { - model("codegen/bytecodeListing") - } - - testClass { - model("codegen/topLevelMemberInvocation", extension = null, recursive = false) - } - - testClass { - model("checkLocalVariablesTable", targetBackend = TargetBackend.JVM) - } - - testClass { - model("writeFlags", targetBackend = TargetBackend.JVM) - } - - testClass { - model("codegen/defaultArguments/reflection") - } - - testClass { - model("codegen/dumpDeclarations") - } - - testClass { - model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava") - model("loadJava/compiledJavaAndKotlin", extension = "txt", testMethod = "doTestCompiledJavaAndKotlin") - model("loadJava/compiledJavaIncludeObjectMethods", extension = "java", testMethod = "doTestCompiledJavaIncludeObjectMethods") - model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") - model("loadJava/compiledKotlinWithStdlib", testMethod = "doTestCompiledKotlinWithStdlib") - model("loadJava/javaAgainstKotlin", extension = "txt", testMethod = "doTestJavaAgainstKotlin") - model( - "loadJava/kotlinAgainstCompiledJavaWithKotlin", - extension = "kt", - testMethod = "doTestKotlinAgainstCompiledJavaWithKotlin", - recursive = false - ) - model("loadJava/sourceJava", extension = "java", testMethod = "doTestSourceJava") - } - - testClass { - model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava") - model("loadJava/compiledJavaAndKotlin", extension = "txt", testMethod = "doTestCompiledJavaAndKotlin") - model("loadJava/compiledJavaIncludeObjectMethods", extension = "java", testMethod = "doTestCompiledJavaIncludeObjectMethods") - model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") - model("loadJava/compiledKotlinWithStdlib", testMethod = "doTestCompiledKotlinWithStdlib") - model("loadJava/javaAgainstKotlin", extension = "txt", testMethod = "doTestJavaAgainstKotlin") - model( - "loadJava/kotlinAgainstCompiledJavaWithKotlin", - extension = "kt", - testMethod = "doTestKotlinAgainstCompiledJavaWithKotlin", - recursive = false - ) - model("loadJava/sourceJava", extension = "java", testMethod = "doTestSourceJava") - } - - testClass { - model("loadJava/compiledKotlin") - } - - testClass { - model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava") - } - - testClass { - model( - "compileJavaAgainstKotlin", - testClassName = "WithoutJavac", - testMethod = "doTestWithoutJavac", - targetBackend = TargetBackend.JVM - ) - model( - "compileJavaAgainstKotlin", - testClassName = "WithJavac", - testMethod = "doTestWithJavac", - targetBackend = TargetBackend.JVM - ) - } - - testClass { - model("compileKotlinAgainstJava", testClassName = "WithAPT", testMethod = "doTestWithAPT") - model("compileKotlinAgainstJava", testClassName = "WithoutAPT", testMethod = "doTestWithoutAPT") - } - - testClass { - model("compileKotlinAgainstKotlin") - } - - testClass { - model("renderer") - } - - testClass { - model("renderFunctionDescriptorInExpression") - } - - testClass { - model("modules.xml", extension = "xml") - } - - testClass { - model("writeSignature") - } - - testClass { - model("cli/jvm", extension = "args", testMethod = "doJvmTest", recursive = false) - model("cli/js", extension = "args", testMethod = "doJsTest", recursive = false) - model("cli/js-dce", extension = "args", testMethod = "doJsDceTest", recursive = false) - model("cli/metadata", extension = "args", testMethod = "doMetadataTest", recursive = false) - } - - testClass { - model("repl", extension = "repl") - } - - testClass { - model("integration/ant/jvm", extension = null, recursive = false, excludeParentDirs = true) - } - - testClass { - model("cfg") - model("cfgWithStdLib", testMethod = "doTestWithStdLib") - } - - testClass { - model("cfg-variables") - model("cfgVariablesWithStdLib", testMethod = "doTestWithStdLib") - } - - testClass { - model("cfg") - model("cfgWithStdLib", testMethod = "doTestWithStdLib") - model("cfg-variables") - model("cfgVariablesWithStdLib", testMethod = "doTestWithStdLib") - } - - testClass { - model("resolveAnnotations/parameters") - } - - testClass { - model("evaluate/constant", testMethod = "doConstantTest") - model("evaluate/isPure", testMethod = "doIsPureTest") - model("evaluate/usesVariableAsConstant", testMethod = "doUsesVariableAsConstantTest") - } - - testClass { - model("asJava/lightClasses", excludeDirs = listOf("local", "ideRegression"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("type/binding") - } - - testClass(useJunit4 = true) { - model("debug/stepping", targetBackend = TargetBackend.JVM) - } - - testClass(useJunit4 = true) { - model("debug/localVariables", targetBackend = TargetBackend.JVM) - } - - testClass { - model("serialization/local") - } - - testClass { - model("lexer/kdoc") - } - - testClass { - model("lexer/kotlin") - } + testGroup("compiler/fir/analysis-tests/tests", "compiler/testData") { + testClass { + model("diagnostics/tests", excludedPattern = excludedFirTestdataPattern) + } - testClass { - model("codegen/box", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) + testClass { + model( + "diagnostics/testsWithStdLib", + excludedPattern = excludedFirTestdataPattern, + excludeDirs = listOf("coroutines") + ) + } } - testClass { - model("codegen/boxAgainstJava", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) + testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") { + testClass { + model("lightClasses") + } } - testClass { - model( - "compileJavaAgainstKotlin", - testClassName = "WithoutJavac", - testMethod = "doTestWithoutJavac", - targetBackend = TargetBackend.JVM_IR - ) - //model("compileJavaAgainstKotlin", testClassName = "WithJavac", testMethod = "doTestWithJavac", targetBackend = TargetBackend.JVM_IR) + testGroup( + "compiler/fir/fir2ir/tests", "compiler/testData", + testRunnerMethodName = "runTestWithCustomIgnoreDirective", + additionalRunnerArguments = listOf("\"// IGNORE_BACKEND_FIR: \"") + ) { + testClass { + model("ir/irText") + } } - testClass { - model("compileKotlinAgainstKotlin", targetBackend = TargetBackend.JVM_IR) - } - - testClass { - model("codegen/bytecodeListing", targetBackend = TargetBackend.JVM_IR) - } + testGroup("compiler/visualizer/tests", "compiler/fir/raw-fir/psi2fir/testData") { + testClass("PsiVisualizerForRawFirDataGenerated") { + model("rawBuilder", testMethod = "doFirBuilderDataTest") + } - testClass { - model("checkLocalVariablesTable", targetBackend = TargetBackend.JVM_IR) + testClass("FirVisualizerForRawFirDataGenerated") { + model("rawBuilder", testMethod = "doFirBuilderDataTest") + } } - testClass { - model("writeFlags", targetBackend = TargetBackend.JVM_IR) - } - - testClass { - model("writeSignature", targetBackend = TargetBackend.JVM_IR) - } - - testClass { - model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava", targetBackend = TargetBackend.JVM_IR) - model( - "loadJava/compiledJavaAndKotlin", - extension = "txt", - testMethod = "doTestCompiledJavaAndKotlin", - targetBackend = TargetBackend.JVM_IR - ) - model( - "loadJava/compiledJavaIncludeObjectMethods", - extension = "java", - testMethod = "doTestCompiledJavaIncludeObjectMethods", - targetBackend = TargetBackend.JVM_IR - ) - model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin", targetBackend = TargetBackend.JVM_IR) - model("loadJava/compiledKotlinWithStdlib", testMethod = "doTestCompiledKotlinWithStdlib", targetBackend = TargetBackend.JVM_IR) - model( - "loadJava/javaAgainstKotlin", - extension = "txt", - testMethod = "doTestJavaAgainstKotlin", - targetBackend = TargetBackend.JVM_IR - ) - model( - "loadJava/kotlinAgainstCompiledJavaWithKotlin", - extension = "kt", - testMethod = "doTestKotlinAgainstCompiledJavaWithKotlin", - recursive = false, - targetBackend = TargetBackend.JVM_IR - ) - model("loadJava/sourceJava", extension = "java", testMethod = "doTestSourceJava", targetBackend = TargetBackend.JVM_IR) - } - - testClass(useJunit4 = true) { - model("debug/stepping", targetBackend = TargetBackend.JVM_IR) - } - - testClass(useJunit4 = true) { - model("debug/localVariables", targetBackend = TargetBackend.JVM_IR) - } - - testClass { - model("codegen/boxInline", targetBackend = TargetBackend.JVM_IR) - } - - testClass { - model("codegen/bytecodeText", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) - } - - testClass { - model("codegen/asmLike", targetBackend = TargetBackend.JVM_IR) - } - } - - testGroup( - "compiler/fir/fir2ir/tests", "compiler/testData", - testRunnerMethodName = "runTestWithCustomIgnoreDirective", - additionalRunnerArguments = listOf("\"// IGNORE_BACKEND_FIR: \"") - ) { - testClass { - model("codegen/box", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) - } - } - - testGroup( - "compiler/tests", "compiler/testData", - testRunnerMethodName = "runTestWithCustomIgnoreDirective", - additionalRunnerArguments = listOf("\"// IGNORE_BACKEND_MULTI_MODULE: \"") - ) { - testClass { - model("codegen/boxInline", targetBackend = TargetBackend.JVM) - } - testClass { - model("codegen/boxInline", targetBackend = TargetBackend.JVM_IR) - } - } - - testGroup("compiler/fir/raw-fir/psi2fir/tests", "compiler/fir/raw-fir/psi2fir/testData") { - testClass { - model("rawBuilder", testMethod = "doRawFirTest") - } - } - - testGroup("compiler/fir/raw-fir/light-tree2fir/tests", "compiler/fir/raw-fir/psi2fir/testData") { - testClass { - model("rawBuilder") - } - } - - testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") { - testClass { - model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("resolve", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - } - - testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") { - testClass { - model("resolveWithStdlib", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - } - - testGroup("compiler/fir/analysis-tests/tests", "compiler/testData") { - testClass { - model("loadJava/compiledKotlin", extension = "kt") - } - } - - testGroup("compiler/fir/analysis-tests/tests", "compiler/testData") { - testClass { - model("loadJava/compiledJava", extension = "java") - } - } - - testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") { - testClass { - model("enhancement", extension = "java") - } - } - - testGroup("compiler/fir/analysis-tests/tests", "compiler/testData") { - testClass { - model("diagnostics/tests", excludedPattern = excludedFirTestdataPattern) - } - - testClass { - model( - "diagnostics/testsWithStdLib", - excludedPattern = excludedFirTestdataPattern, - excludeDirs = listOf("coroutines") - ) - } - } - - testGroup("compiler/fir/analysis-tests/tests", "compiler/fir/analysis-tests/testData") { - testClass { - model("lightClasses") - } - } - - testGroup( - "compiler/fir/fir2ir/tests", "compiler/testData", - testRunnerMethodName = "runTestWithCustomIgnoreDirective", - additionalRunnerArguments = listOf("\"// IGNORE_BACKEND_FIR: \"") - ) { - testClass { - model("ir/irText") - } - } - - testGroup("compiler/visualizer/tests", "compiler/fir/raw-fir/psi2fir/testData") { - testClass("PsiVisualizerForRawFirDataGenerated") { - model("rawBuilder", testMethod = "doFirBuilderDataTest") - } - - testClass("FirVisualizerForRawFirDataGenerated") { - model("rawBuilder", testMethod = "doFirBuilderDataTest") - } - } - - testGroup("compiler/visualizer/tests", "compiler/visualizer/testData") { - testClass("PsiVisualizerForUncommonCasesGenerated") { - model("uncommonCases/testFiles", testMethod = "doUncommonCasesTest") - } + testGroup("compiler/visualizer/tests", "compiler/visualizer/testData") { + testClass("PsiVisualizerForUncommonCasesGenerated") { + model("uncommonCases/testFiles", testMethod = "doUncommonCasesTest") + } - testClass("FirVisualizerForUncommonCasesGenerated") { - model("uncommonCases/testFiles", testMethod = "doUncommonCasesTest") + testClass("FirVisualizerForUncommonCasesGenerated") { + model("uncommonCases/testFiles", testMethod = "doUncommonCasesTest") + } } } } diff --git a/core/descriptors.runtime/tests/org/jetbrains/kotlin/generators/tests/GenerateRuntimeDescriptorTests.kt b/core/descriptors.runtime/tests/org/jetbrains/kotlin/generators/tests/GenerateRuntimeDescriptorTests.kt index e8324406994..1820496d249 100644 --- a/core/descriptors.runtime/tests/org/jetbrains/kotlin/generators/tests/GenerateRuntimeDescriptorTests.kt +++ b/core/descriptors.runtime/tests/org/jetbrains/kotlin/generators/tests/GenerateRuntimeDescriptorTests.kt @@ -16,21 +16,23 @@ package org.jetbrains.kotlin.generators.tests -import org.jetbrains.kotlin.generators.tests.generator.testGroup +import org.jetbrains.kotlin.generators.tests.generator.testGroupSuite import org.jetbrains.kotlin.jvm.runtime.AbstractJvm8RuntimeDescriptorLoaderTest import org.jetbrains.kotlin.jvm.runtime.AbstractJvmRuntimeDescriptorLoaderTest -fun main() { +fun main(args: Array) { System.setProperty("java.awt.headless", "true") - testGroup("core/descriptors.runtime/tests", "compiler/testData") { - testClass { - model("loadJava/compiledKotlin") - model("loadJava/compiledJava", extension = "java", excludeDirs = listOf("sam", "kotlinSignature/propagation")) - } + testGroupSuite(args) { + testGroup("core/descriptors.runtime/tests", "compiler/testData") { + testClass { + model("loadJava/compiledKotlin") + model("loadJava/compiledJava", extension = "java", excludeDirs = listOf("sam", "kotlinSignature/propagation")) + } - testClass { - model("loadJava8/compiledJava", extension = "java") + testClass { + model("loadJava8/compiledJava", extension = "java") + } } } } diff --git a/generators/main/GeneratorsFileUtil.kt b/generators/main/GeneratorsFileUtil.kt index 5a908779569..8b6fdd222bf 100644 --- a/generators/main/GeneratorsFileUtil.kt +++ b/generators/main/GeneratorsFileUtil.kt @@ -24,7 +24,7 @@ object GeneratorsFileUtil { throw IllegalStateException("Cannot create directory: $parentFile") } } - if (checkFileIgnoringLineSeparators(file, newText)) { + if (!isFileContentChangedIgnoringLineSeparators(file, newText)) { if (logNotChanged) { println("Not changed: " + file.absolutePath) } @@ -42,12 +42,12 @@ object GeneratorsFileUtil { println() } - private fun checkFileIgnoringLineSeparators(file: File, content: String): Boolean { + fun isFileContentChangedIgnoringLineSeparators(file: File, content: String): Boolean { val currentContent: String = try { StringUtil.convertLineSeparators(file.readText(Charsets.UTF_8)) } catch (ignored: Throwable) { - return false + return true } - return StringUtil.convertLineSeparators(content) == currentContent + return StringUtil.convertLineSeparators(content) != currentContent } } \ No newline at end of file diff --git a/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/TestGenerationDSL.kt b/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/TestGenerationDSL.kt index 0b1cd34c429..e0d31bd80a6 100644 --- a/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/TestGenerationDSL.kt +++ b/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/TestGenerationDSL.kt @@ -6,6 +6,8 @@ package org.jetbrains.kotlin.generators.tests.generator import junit.framework.TestCase +import org.jetbrains.kotlin.generators.tests.generator.InconsistencyChecker.Companion.hasDryRunArg +import org.jetbrains.kotlin.generators.tests.generator.InconsistencyChecker.Companion.inconsistencyChecker import org.jetbrains.kotlin.test.TargetBackend import java.io.File import java.util.* @@ -16,7 +18,8 @@ class TestGroup( val testDataRoot: String, val testRunnerMethodName: String, val additionalRunnerArguments: List = emptyList(), - val annotations: List = emptyList() + val annotations: List = emptyList(), + private val dryRun: Boolean = false ) { inline fun testClass( suiteTestClassName: String = getDefaultSuiteTestClassName(T::class.java.simpleName), @@ -34,13 +37,16 @@ class TestGroup( annotations: List = emptyList(), init: TestClass.() -> Unit ) { - TestGenerator( + val testGenerator = TestGenerator( testsRoot, suiteTestClassName, baseTestClassName, TestClass(annotations).apply(init).testModels, useJunit4 - ).generateAndSave() + ) + if (testGenerator.generateAndSave(dryRun)) { + inconsistencyChecker(dryRun).add(testGenerator.testSourceFilePath) + } } inner class TestClass(val annotations: List) { @@ -85,14 +91,67 @@ class TestGroup( } } -fun testGroup( - testsRoot: String, - testDataRoot: String, - testRunnerMethodName: String = RunTestMethodModel.METHOD_NAME, - additionalRunnerArguments: List = emptyList(), - init: TestGroup.() -> Unit +fun testGroupSuite( + args: Array, + init: TestGroupSuite.() -> Unit ) { - TestGroup(testsRoot, testDataRoot, testRunnerMethodName, additionalRunnerArguments).init() + testGroupSuite(hasDryRunArg(args), init) +} + +fun testGroupSuite( + dryRun: Boolean = false, + init: TestGroupSuite.() -> Unit +) { + TestGroupSuite(dryRun).init() +} + +class TestGroupSuite(private val dryRun: Boolean) { + fun testGroup( + testsRoot: String, + testDataRoot: String, + testRunnerMethodName: String = RunTestMethodModel.METHOD_NAME, + additionalRunnerArguments: List = emptyList(), + init: TestGroup.() -> Unit + ) { + TestGroup( + testsRoot, + testDataRoot, + testRunnerMethodName, + additionalRunnerArguments, + dryRun = dryRun + ).init() + } +} + +interface InconsistencyChecker { + fun add(affectedFile: String) + + val affectedFiles: List + + companion object { + fun hasDryRunArg(args: Array) = args.any { it == "dryRun" } + + fun inconsistencyChecker(dryRun: Boolean) = if (dryRun) DefaultInconsistencyChecker else EmptyInconsistencyChecker + } +} + +object DefaultInconsistencyChecker : InconsistencyChecker { + private val files = mutableListOf() + + override fun add(affectedFile: String) { + files.add(affectedFile) + } + + override val affectedFiles: List + get() = files +} + +object EmptyInconsistencyChecker : InconsistencyChecker { + override fun add(affectedFile: String) { + } + + override val affectedFiles: List + get() = emptyList() } fun getDefaultSuiteTestClassName(baseTestClassName: String): String { diff --git a/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/TestGenerator.kt b/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/TestGenerator.kt index 454847d72f8..a800aab5f01 100644 --- a/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/TestGenerator.kt +++ b/generators/test-generator/tests/org/jetbrains/kotlin/generators/tests/generator/TestGenerator.kt @@ -8,7 +8,6 @@ package org.jetbrains.kotlin.generators.tests.generator import org.jetbrains.kotlin.generators.util.GeneratorsFileUtil import org.jetbrains.kotlin.test.JUnit3RunnerWithInners import org.jetbrains.kotlin.test.KotlinTestUtils -import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlin.test.TestMetadata import org.jetbrains.kotlin.utils.Printer import org.junit.Test @@ -31,7 +30,7 @@ class TestGenerator( private val baseTestClassName: String private val testClassModels: Collection private val useJunit4: Boolean - private val testSourceFilePath: String + internal val testSourceFilePath: String init { this.baseTestClassPackage = baseTestClassFqName.substringBeforeLast('.', "") @@ -48,18 +47,33 @@ class TestGenerator( } } + /** + * @return true if a new file is generated + */ @Throws(IOException::class) - fun generateAndSave() { + fun generateAndSave(dryRun: Boolean): Boolean { + val generatedCode = generate() + + val testSourceFile = File(testSourceFilePath) + val changed = + GeneratorsFileUtil.isFileContentChangedIgnoringLineSeparators(testSourceFile, generatedCode) + if (!dryRun) { + GeneratorsFileUtil.writeFileIfContentChanged(testSourceFile, generatedCode, false) + } + return changed + } + + private fun generate(): String { val out = StringBuilder() val p = Printer(out) val year = GregorianCalendar()[Calendar.YEAR] p.println( """/* - | * Copyright 2010-$year 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. - | */ - |""".trimMargin() + | * Copyright 2010-$year 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. + | */ + |""".trimMargin() ) p.println("package ", suiteClassPackage, ";") p.println() @@ -126,9 +140,7 @@ class TestGenerator( } generateTestClass(p, model, false) - - val testSourceFile = File(testSourceFilePath) - GeneratorsFileUtil.writeFileIfContentChanged(testSourceFile, out.toString(), false) + return out.toString() } private fun generateTestClass(p: Printer, testClassModel: TestClassModel, isStatic: Boolean) { diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 22cb1cc0afa..0ba6a4539fd 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -31,7 +31,7 @@ import org.jetbrains.kotlin.formatter.AbstractFormatterTest import org.jetbrains.kotlin.formatter.AbstractTypingIndentationTestBase import org.jetbrains.kotlin.generators.tests.generator.TestGroup import org.jetbrains.kotlin.generators.tests.generator.muteExtraSuffix -import org.jetbrains.kotlin.generators.tests.generator.testGroup +import org.jetbrains.kotlin.generators.tests.generator.testGroupSuite import org.jetbrains.kotlin.generators.util.KT_OR_KTS import org.jetbrains.kotlin.generators.util.KT_OR_KTS_WITHOUT_DOTS_IN_NAME import org.jetbrains.kotlin.generators.util.KT_WITHOUT_DOTS_IN_NAME @@ -181,1338 +181,1348 @@ import org.jetbrains.kotlinx.serialization.AbstractSerializationIrBytecodeListin import org.jetbrains.kotlinx.serialization.AbstractSerializationPluginBytecodeListingTest import org.jetbrains.kotlinx.serialization.AbstractSerializationPluginDiagnosticTest -fun main() { +fun main(args: Array) { System.setProperty("java.awt.headless", "true") - testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { - testClass { - model( - "stepping/stepIntoAndSmartStepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doStepIntoTest", - testClassName = "StepInto" - ) - model( - "stepping/stepIntoAndSmartStepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doSmartStepIntoTest", - testClassName = "SmartStepInto" - ) - model( - "stepping/stepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doStepIntoTest", - testClassName = "StepIntoOnly" - ) - model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") - model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") - model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") - model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") - } - - testClass { - model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") - model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") - } - - testClass { - model("selectExpression", recursive = false) - model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") - } - - testClass { - model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") - model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") - } - - testClass { - model("smartStepInto") - } - - testClass { - model("breakpointApplicability") - } - - testClass { - model("fileRanking") - } - - testClass { - model("asyncStackTrace") - } - - testClass { - model("coroutines") - } - - testClass { - // TODO: implement mapping logic for terminal operations - model("sequence/streams/sequence", excludeDirs = listOf("terminal")) - } - - testClass { - model("continuation") - } - - testClass { - model("xcoroutines") - } - } - - testGroup("idea/tests", "idea/testData") { - testClass { - model("resolve/additionalLazyResolve") - } - - testClass { - model("resolve/partialBodyResolve") - } - - testClass { - model("checker", recursive = false) - model("checker/regression") - model("checker/recovery") - model("checker/rendering") - model("checker/scripts", extension = "kts") - model("checker/duplicateJvmSignature") - model("checker/infos", testMethod = "doTestWithInfos") - model("checker/diagnosticsMessage") - } - - testClass { - model("kotlinAndJavaChecker/javaAgainstKotlin") - model("kotlinAndJavaChecker/javaWithKotlin") - } - - testClass { - model("kotlinAndJavaChecker/javaAgainstKotlin") - model("kotlinAndJavaChecker/javaWithKotlin") - } - - testClass { - model("kotlinAndJavaChecker/javaAgainstKotlin") - } - - testClass { - model("unifier") - } - - testClass { - model("checker/codeFragments", extension = "kt", recursive = false) - model("checker/codeFragments/imports", testMethod = "doTestWithImport", extension = "kt") - } - - testClass { - model("quickfix.special/codeFragmentAutoImport", extension = "kt", recursive = false) - } - - testClass { - model("checker/js") - } - - testClass { - model("quickfix", pattern = "^([\\w\\-_]+)\\.kt$", filenameStartsLowerCase = true) - } - - testClass { - model("navigation/gotoSuper", extension = "test", recursive = false) - } - - testClass { - model("navigation/gotoTypeDeclaration", extension = "test") - } - - testClass { - model("navigation/gotoDeclaration", extension = "test") - } - - testClass { - model( - "parameterInfo", - pattern = "^([\\w\\-_]+)\\.kt$", recursive = true, - excludeDirs = listOf("withLib1/sharedLib", "withLib2/sharedLib", "withLib3/sharedLib") - ) - } - - testClass { - model("navigation/gotoClass", testMethod = "doClassTest") - model("navigation/gotoSymbol", testMethod = "doSymbolTest") - } - - testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { - model("decompiler/navigation/usercode") - } - - testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { - model("decompiler/navigation/userJavaCode", pattern = "^(.+)\\.java$") - } - - testClass(annotations = listOf(muteExtraSuffix(".libsrcjs"))) { - model("decompiler/navigation/usercode", testClassName = "UsercodeWithJSModule") - } - - testClass { - model("decompiler/navigation/usercode") - } - - testClass { - model("navigation/implementations", recursive = false) - } - - testClass { - model("navigation/gotoTestOrCode", pattern = "^(.+)\\.main\\..+\$") - } - - testClass { - model("search/inheritance") - } - - testClass { - model("search/annotations") - } - - testClass { - model("quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } - - testClass { - model("typealiasExpansionIndex") - } - - testClass { - model("highlighter") - } - - testClass { - model("dslHighlighter") - } - - testClass { - model("usageHighlighter") - } - - testClass { - model("folding/noCollapse") - model("folding/checkCollapse", testMethod = "doSettingsFoldingTest") - } - - testClass { - model("codeInsight/surroundWith/if", testMethod = "doTestWithIfSurrounder") - model("codeInsight/surroundWith/ifElse", testMethod = "doTestWithIfElseSurrounder") - model("codeInsight/surroundWith/ifElseExpression", testMethod = "doTestWithIfElseExpressionSurrounder") - model("codeInsight/surroundWith/ifElseExpressionBraces", testMethod = "doTestWithIfElseExpressionBracesSurrounder") - model("codeInsight/surroundWith/not", testMethod = "doTestWithNotSurrounder") - model("codeInsight/surroundWith/parentheses", testMethod = "doTestWithParenthesesSurrounder") - model("codeInsight/surroundWith/stringTemplate", testMethod = "doTestWithStringTemplateSurrounder") - model("codeInsight/surroundWith/when", testMethod = "doTestWithWhenSurrounder") - model("codeInsight/surroundWith/tryCatch", testMethod = "doTestWithTryCatchSurrounder") - model("codeInsight/surroundWith/tryCatchExpression", testMethod = "doTestWithTryCatchExpressionSurrounder") - model("codeInsight/surroundWith/tryCatchFinally", testMethod = "doTestWithTryCatchFinallySurrounder") - model("codeInsight/surroundWith/tryCatchFinallyExpression", testMethod = "doTestWithTryCatchFinallyExpressionSurrounder") - model("codeInsight/surroundWith/tryFinally", testMethod = "doTestWithTryFinallySurrounder") - model("codeInsight/surroundWith/functionLiteral", testMethod = "doTestWithFunctionLiteralSurrounder") - model("codeInsight/surroundWith/withIfExpression", testMethod = "doTestWithSurroundWithIfExpression") - model("codeInsight/surroundWith/withIfElseExpression", testMethod = "doTestWithSurroundWithIfElseExpression") - } - - testClass { - model("joinLines") - } - - testClass { - model("codeInsight/breadcrumbs") - } - - testClass { - model("intentions", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") - } - - testClass { - model("intentions/loopToCallChain", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("concatenatedStringGenerator", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("intentions", pattern = "^(inspections\\.test)$", singleClass = true) - model("inspections", pattern = "^(inspections\\.test)$", singleClass = true) - model("inspectionsLocal", pattern = "^(inspections\\.test)$", singleClass = true) - } - - testClass { - model("inspectionsLocal", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") - } - - testClass { - model("hierarchy/class/type", extension = null, recursive = false, testMethod = "doTypeClassHierarchyTest") - model("hierarchy/class/super", extension = null, recursive = false, testMethod = "doSuperClassHierarchyTest") - model("hierarchy/class/sub", extension = null, recursive = false, testMethod = "doSubClassHierarchyTest") - model("hierarchy/calls/callers", extension = null, recursive = false, testMethod = "doCallerHierarchyTest") - model("hierarchy/calls/callersJava", extension = null, recursive = false, testMethod = "doCallerJavaHierarchyTest") - model("hierarchy/calls/callees", extension = null, recursive = false, testMethod = "doCalleeHierarchyTest") - model("hierarchy/overrides", extension = null, recursive = false, testMethod = "doOverrideHierarchyTest") - } - - testClass { - model("hierarchy/withLib", extension = null, recursive = false) - } - - testClass { - model("codeInsight/moveUpDown/classBodyDeclarations", pattern = KT_OR_KTS, testMethod = "doTestClassBodyDeclaration") - model("codeInsight/moveUpDown/closingBraces", testMethod = "doTestExpression") - model("codeInsight/moveUpDown/expressions", pattern = KT_OR_KTS, testMethod = "doTestExpression") - model("codeInsight/moveUpDown/parametersAndArguments", testMethod = "doTestExpression") - model("codeInsight/moveUpDown/trailingComma", testMethod = "doTestExpressionWithTrailingComma") - } - - testClass { - model("codeInsight/moveLeftRight") - } - - testClass { - model("refactoring/inline", pattern = "^(\\w+)\\.kt$") - } - - testClass { - model("codeInsight/unwrapAndRemove/removeExpression", testMethod = "doTestExpressionRemover") - model("codeInsight/unwrapAndRemove/unwrapThen", testMethod = "doTestThenUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapElse", testMethod = "doTestElseUnwrapper") - model("codeInsight/unwrapAndRemove/removeElse", testMethod = "doTestElseRemover") - model("codeInsight/unwrapAndRemove/unwrapLoop", testMethod = "doTestLoopUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapTry", testMethod = "doTestTryUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapCatch", testMethod = "doTestCatchUnwrapper") - model("codeInsight/unwrapAndRemove/removeCatch", testMethod = "doTestCatchRemover") - model("codeInsight/unwrapAndRemove/unwrapFinally", testMethod = "doTestFinallyUnwrapper") - model("codeInsight/unwrapAndRemove/removeFinally", testMethod = "doTestFinallyRemover") - model("codeInsight/unwrapAndRemove/unwrapLambda", testMethod = "doTestLambdaUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapFunctionParameter", testMethod = "doTestFunctionParameterUnwrapper") - } - - testClass { - model("codeInsight/expressionType") - } - - testClass { - model("codeInsight/renderingKDoc") - } - - testClass { - model("editor/backspaceHandler") - } - - testClass { - model("editor/enterHandler/multilineString") - } - - testClass { - model("editor/quickDoc", pattern = """^([^_]+)\.(kt|java)$""") - } - - testClass { - model("refactoring/safeDelete/deleteClass/kotlinClass", testMethod = "doClassTest") - model("refactoring/safeDelete/deleteClass/kotlinClassWithJava", testMethod = "doClassTestWithJava") - model("refactoring/safeDelete/deleteClass/javaClassWithKotlin", extension = "java", testMethod = "doJavaClassTest") - model("refactoring/safeDelete/deleteObject/kotlinObject", testMethod = "doObjectTest") - model("refactoring/safeDelete/deleteFunction/kotlinFunction", testMethod = "doFunctionTest") - model("refactoring/safeDelete/deleteFunction/kotlinFunctionWithJava", testMethod = "doFunctionTestWithJava") - model("refactoring/safeDelete/deleteFunction/javaFunctionWithKotlin", testMethod = "doJavaMethodTest") - model("refactoring/safeDelete/deleteProperty/kotlinProperty", testMethod = "doPropertyTest") - model("refactoring/safeDelete/deleteProperty/kotlinPropertyWithJava", testMethod = "doPropertyTestWithJava") - model("refactoring/safeDelete/deleteProperty/javaPropertyWithKotlin", testMethod = "doJavaPropertyTest") - model("refactoring/safeDelete/deleteTypeAlias/kotlinTypeAlias", testMethod = "doTypeAliasTest") - model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameter", testMethod = "doTypeParameterTest") - model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameterWithJava", testMethod = "doTypeParameterTestWithJava") - model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameter", testMethod = "doValueParameterTest") - model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameterWithJava", testMethod = "doValueParameterTestWithJava") - } - - testClass { - model("resolve/references", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("resolve/referenceInJava/binaryAndSource", extension = "java") - model("resolve/referenceInJava/sourceOnly", extension = "java") - } - - testClass { - model("resolve/referenceInJava/binaryAndSource", extension = "java") - } - - testClass { - model("resolve/referenceWithLib", recursive = false) - } - - testClass { - model("resolve/referenceInLib", recursive = false) - } - - testClass { - model("resolve/referenceToJavaWithWrongFileStructure", recursive = false) - } - - testClass { - model("findUsages/kotlin", pattern = """^(.+)\.0\.(kt|kts)$""") - model("findUsages/java", pattern = """^(.+)\.0\.java$""") - model("findUsages/propertyFiles", pattern = """^(.+)\.0\.properties$""") - } - - testClass { - model("findUsages/kotlin/conventions/components", pattern = """^(.+)\.0\.(kt|kts)$""") - } - - testClass { - model("findUsages/libraryUsages", pattern = """^(.+)\.0\.kt$""") - } - - testClass { - model("refactoring/move", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/copy", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/moveMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/copyMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/safeDeleteMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("multiFileIntentions", extension = "test", singleClass = true, filenameStartsLowerCase = true) - } - - testClass { - model("multiFileLocalInspections", extension = "test", singleClass = true, filenameStartsLowerCase = true) - } - - testClass { - model("multiFileInspections", extension = "test", singleClass = true) - } - - testClass { - model("formatter", pattern = """^([^\.]+)\.after\.kt.*$""") - model( - "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.kt.*$""", - testMethod = "doTestCallSite", testClassName = "FormatterCallSite" - ) - model( - "formatter", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", - testMethod = "doTestInverted", testClassName = "FormatterInverted" - ) - model( - "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.inv\.kt.*$""", - testMethod = "doTestInvertedCallSite", testClassName = "FormatterInvertedCallSite" - ) - } - - testClass { - model( - "indentationOnNewline", pattern = """^([^\.]+)\.after\.kt.*$""", testMethod = "doNewlineTest", - testClassName = "DirectSettings" - ) - model( - "indentationOnNewline", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", testMethod = "doNewlineTestWithInvert", - testClassName = "InvertedSettings" - ) - } - - testClass { - model("diagnosticMessage", recursive = false) - } - - testClass { - model("diagnosticMessage/js", recursive = false, targetBackend = TargetBackend.JS) - } - - testClass { - model("refactoring/rename", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/renameMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("codeInsight/outOfBlock", pattern = KT_OR_KTS) - } - - testClass { - model("codeInsight/changeLocality", pattern = KT_OR_KTS) - } - - testClass { - model("dataFlowValueRendering") - } - - testClass { - model("copyPaste/conversion", pattern = """^([^\.]+)\.java$""") - } - - testClass { - model("copyPaste/plainTextConversion", pattern = """^([^\.]+)\.txt$""") - } - - testClass { - model("copyPaste/plainTextLiteral", pattern = """^([^\.]+)\.txt$""") - } - - testClass { - model("copyPaste/literal", pattern = """^([^\.]+)\.kt$""") - } - - testClass { - model( - "copyPaste/imports", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doTestCopy", - testClassName = "Copy", - recursive = false - ) - model( - "copyPaste/imports", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doTestCut", - testClassName = "Cut", - recursive = false - ) - } - - testClass { - model("copyPaste/moveDeclarations", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTest") - } - - testClass { - model("copyright", pattern = KT_OR_KTS, testMethod = "doTest") - } - - testClass { - model("exitPoints") - } - - testClass { - model("codeInsight/lineMarker") - } - - testClass { - model("codeInsightInLibrary/lineMarker", testMethod = "doTestWithLibrary") - } - - testClass { - model("multiModuleLineMarker", extension = null, recursive = false) - } - - testClass { - model("shortenRefs", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - testClass { - model("addImport", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("addImportAlias", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("smartSelection", testMethod = "doTestSmartSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("structureView/fileStructure", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("expressionSelection", testMethod = "doTestExpressionSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("decompiler/decompiledText", pattern = """^([^\.]+)$""") - } - - testClass { - model("decompiler/decompiledTextJvm", pattern = """^([^\.]+)$""") - } - - testClass { - model("decompiler/decompiledText", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) - } - - testClass { - model("decompiler/decompiledTextJs", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) - } - - testClass { - model("decompiler/stubBuilder", extension = null, recursive = false) - } - - testClass { - model("editor/optimizeImports/jvm", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - testClass { - model("editor/optimizeImports/js", pattern = KT_WITHOUT_DOTS_IN_NAME) - model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) - } - - testClass { - model("stubs", extension = "kt") - } - - testClass { - model("multiFileHighlighting", recursive = false) - } - - testClass { - model("multiModuleHighlighting/multiplatform/", recursive = false, extension = null) - } - - testClass { - model("multiplatform", recursive = false, extension = null) - } - - testClass { - model("multiModuleQuickFix", extension = null, deep = 1) - } - - testClass { - model("navigation/implementations/multiModule", recursive = false, extension = null) - } - - testClass { - model("navigation/relatedSymbols/multiModule", recursive = false, extension = null) - } - - testClass { - model("navigation/gotoSuper/multiModule", recursive = false, extension = null) - } - - testClass { - model("refactoring/introduceVariable", pattern = KT_OR_KTS, testMethod = "doIntroduceVariableTest") - model("refactoring/extractFunction", pattern = KT_OR_KTS, testMethod = "doExtractFunctionTest") - model("refactoring/introduceProperty", pattern = KT_OR_KTS, testMethod = "doIntroducePropertyTest") - model("refactoring/introduceParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceSimpleParameterTest") - model("refactoring/introduceLambdaParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceLambdaParameterTest") - model("refactoring/introduceJavaParameter", extension = "java", testMethod = "doIntroduceJavaParameterTest") - model("refactoring/introduceTypeParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeParameterTest") - model("refactoring/introduceTypeAlias", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeAliasTest") - model("refactoring/extractSuperclass", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractSuperclassTest") - model("refactoring/extractInterface", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractInterfaceTest") - } - - testClass { - model("refactoring/pullUp/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") - model("refactoring/pullUp/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") - model("refactoring/pullUp/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") - } - - testClass { - model("refactoring/pushDown/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") - model("refactoring/pushDown/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") - model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") - } - - testClass { - model("coverage/outputFiles") - } - - testClass { - model("internal/toolWindow", recursive = false, extension = null) - } - - testClass("org.jetbrains.kotlin.idea.kdoc.KdocResolveTestGenerated") { - model("kdoc/resolve") - } - - testClass { - model("kdoc/highlighting") - } - - testClass { - model("kdoc/typing") - } - - testClass { - model("codeInsight/generate/testFrameworkSupport") - } - - testClass { - model("codeInsight/generate/equalsWithHashCode") - } - - testClass { - model("codeInsight/generate/secondaryConstructors") - } - - testClass { - model("codeInsight/generate/toString") - } - - testClass { - model("repl/completion") - } - - testClass { - model("codeInsight/postfix") - } - - testClass { - model("codeInsight/codeVision") - } - - testClass { - model("script/definition/highlighting", extension = null, recursive = false) - model("script/definition/complex", extension = null, recursive = false, testMethod = "doComplexTest") - } - - testClass { - model("script/definition/navigation", extension = null, recursive = false) - } - - testClass { - model("script/definition/completion", extension = null, recursive = false) - } - - testClass { - model("script/definition/order", extension = null, recursive = false) - } - - testClass { - model("refactoring/nameSuggestionProvider") - } - - testClass { - model("slicer", excludeDirs = listOf("mpp")) - } - - testClass { - model("slicer/inflow", singleClass = true) - } - - testClass { - model("slicer/inflow", singleClass = true) - } - - testClass { - model("slicer/mpp", recursive = false, extension = null) - } - - testClass { - model("navigationToolbar", recursive = false) - } - } - - testGroup("idea/idea-fir/tests", "idea/testData") { - testClass { - model("fir/multiModule", recursive = false, extension = null) - } - - testClass { - model("fir/lazyResolve", extension = "test", singleClass = true, filenameStartsLowerCase = true) - } - - testClass { - model("resolve/references", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("checker", recursive = false) - model("checker/regression") - model("checker/recovery") - model("checker/rendering") - model("checker/duplicateJvmSignature") - model("checker/infos") - model("checker/diagnosticsMessage") - } - } - - testGroup("idea/scripting-support/test", "idea/scripting-support/testData") { - testClass { - model( - "scratch", - extension = "kts", - testMethod = "doScratchCompilingTest", - testClassName = "ScratchCompiling", - recursive = false - ) - model("scratch", extension = "kts", testMethod = "doScratchReplTest", testClassName = "ScratchRepl", recursive = false) - model( - "scratch/multiFile", - extension = null, - testMethod = "doScratchMultiFileTest", - testClassName = "ScratchMultiFile", - recursive = false - ) - - model( - "worksheet", - extension = "ws.kts", - testMethod = "doWorksheetCompilingTest", - testClassName = "WorksheetCompiling", - recursive = false - ) - model("worksheet", extension = "ws.kts", testMethod = "doWorksheetReplTest", testClassName = "WorksheetRepl", recursive = false) - model( - "worksheet/multiFile", - extension = null, - testMethod = "doWorksheetMultiFileTest", - testClassName = "WorksheetMultiFile", - recursive = false - ) - - model( - "scratch/rightPanelOutput", - extension = "kts", - testMethod = "doRightPreviewPanelOutputTest", - testClassName = "ScratchRightPanelOutput", - recursive = false - ) - } - - testClass { - model("scratch/lineMarker", testMethod = "doScratchTest", pattern = KT_OR_KTS) - } - } - - testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { - testClass { - model("configurator/jvm", extension = null, recursive = false, testMethod = "doTestWithMaven") - model("configurator/js", extension = null, recursive = false, testMethod = "doTestWithJSMaven") - } - - testClass { - model("maven-inspections", pattern = "^([\\w\\-]+).xml$", singleClass = true) - } - } - - testGroup("idea/idea-gradle/tests", "idea/testData") { - testClass { - model("configuration/gradle", extension = null, recursive = false, testMethod = "doTestGradle") - model("configuration/gsk", extension = null, recursive = false, testMethod = "doTestGradle") - } - } - - testGroup("idea/tests", "compiler/testData") { - testClass { - model("loadJava/compiledKotlin") - } - - testClass { - model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") - } - - testClass { - model("asJava/lightClasses", excludeDirs = listOf("delegation", "script"), pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("asJava/script/ide", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("asJava/lightClasses", pattern = KT_OR_KTS) - } - testClass { - model("asJava/ultraLightClasses", pattern = KT_OR_KTS) - } - testClass { - model("asJava/ultraLightScripts", pattern = KT_OR_KTS) - } - testClass { - model("asJava/ultraLightFacades", pattern = KT_OR_KTS) - } - - testClass { - model( - "asJava/lightClasses", - excludeDirs = listOf("local", "compilationErrors", "ideRegression"), - pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME - ) - } - } - - testGroup("idea/idea-completion/tests", "idea/idea-completion/testData") { - testClass { - model("injava", extension = "java", recursive = false) - } - - testClass { - model("injava", extension = "java", recursive = false) - } - - testClass { - model("injava/stdlib", extension = "java", recursive = false) - } - - testClass { - model("weighers/basic", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("weighers/smart", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("basic/common") - model("basic/js") - } - - testClass { - model("basic/common") - model("basic/java") - } - - testClass { - model("smart") - } - - testClass { - model("keywords", recursive = false) - } - - testClass { - model("basic/withLib", recursive = false) - } - - testClass { - model("handlers/basic", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("handlers/smart") - } - - testClass { - model("handlers/keywords") - } - - testClass { - model("handlers/charFilter", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("basic/multifile", extension = null, recursive = false) - } - - testClass { - model("smartMultiFile", extension = null, recursive = false) - } - - testClass("KDocCompletionTestGenerated") { - model("kdoc") - } - - testClass { - model("basic/java8") - } - - testClass { - model("incrementalResolve") - } - - testClass { - model("multiPlatform", recursive = false, extension = null) - } - } - - testGroup( - "libraries/tools/new-project-wizard/new-project-wizard-cli/tests", - "libraries/tools/new-project-wizard/new-project-wizard-cli/testData" - ) { - testClass { - model("buildFileGeneration", recursive = false, extension = null) - } - testClass { - model("projectTemplatesBuildFileGeneration", recursive = false, extension = null) - } - } - - testGroup( - "idea/idea-new-project-wizard/tests", - "libraries/tools/new-project-wizard/new-project-wizard-cli/testData" - ) { - fun TestGroup.TestClass.allBuildSystemTests(relativeRootPath: String) { - for (testClass in listOf("GradleKts", "GradleGroovy", "Maven")) { + testGroupSuite(args) { + testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { + testClass { model( - relativeRootPath, - recursive = false, + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepInto" + ) + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doSmartStepIntoTest", + testClassName = "SmartStepInto" + ) + model( + "stepping/stepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepIntoOnly" + ) + model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") + model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") + model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") + model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") + } + + testClass { + model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") + model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") + } + + testClass { + model("selectExpression", recursive = false) + model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") + } + + testClass { + model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") + model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") + } + + testClass { + model("smartStepInto") + } + + testClass { + model("breakpointApplicability") + } + + testClass { + model("fileRanking") + } + + testClass { + model("asyncStackTrace") + } + + testClass { + model("coroutines") + } + + testClass { + // TODO: implement mapping logic for terminal operations + model("sequence/streams/sequence", excludeDirs = listOf("terminal")) + } + + testClass { + model("continuation") + } + + testClass { + model("xcoroutines") + } + } + + testGroup("idea/tests", "idea/testData") { + testClass { + model("resolve/additionalLazyResolve") + } + + testClass { + model("resolve/partialBodyResolve") + } + + testClass { + model("checker", recursive = false) + model("checker/regression") + model("checker/recovery") + model("checker/rendering") + model("checker/scripts", extension = "kts") + model("checker/duplicateJvmSignature") + model("checker/infos", testMethod = "doTestWithInfos") + model("checker/diagnosticsMessage") + } + + testClass { + model("kotlinAndJavaChecker/javaAgainstKotlin") + model("kotlinAndJavaChecker/javaWithKotlin") + } + + testClass { + model("kotlinAndJavaChecker/javaAgainstKotlin") + model("kotlinAndJavaChecker/javaWithKotlin") + } + + testClass { + model("kotlinAndJavaChecker/javaAgainstKotlin") + } + + testClass { + model("unifier") + } + + testClass { + model("checker/codeFragments", extension = "kt", recursive = false) + model("checker/codeFragments/imports", testMethod = "doTestWithImport", extension = "kt") + } + + testClass { + model("quickfix.special/codeFragmentAutoImport", extension = "kt", recursive = false) + } + + testClass { + model("checker/js") + } + + testClass { + model("quickfix", pattern = "^([\\w\\-_]+)\\.kt$", filenameStartsLowerCase = true) + } + + testClass { + model("navigation/gotoSuper", extension = "test", recursive = false) + } + + testClass { + model("navigation/gotoTypeDeclaration", extension = "test") + } + + testClass { + model("navigation/gotoDeclaration", extension = "test") + } + + testClass { + model( + "parameterInfo", + pattern = "^([\\w\\-_]+)\\.kt$", recursive = true, + excludeDirs = listOf("withLib1/sharedLib", "withLib2/sharedLib", "withLib3/sharedLib") + ) + } + + testClass { + model("navigation/gotoClass", testMethod = "doClassTest") + model("navigation/gotoSymbol", testMethod = "doSymbolTest") + } + + testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { + model("decompiler/navigation/usercode") + } + + testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { + model("decompiler/navigation/userJavaCode", pattern = "^(.+)\\.java$") + } + + testClass(annotations = listOf(muteExtraSuffix(".libsrcjs"))) { + model("decompiler/navigation/usercode", testClassName = "UsercodeWithJSModule") + } + + testClass { + model("decompiler/navigation/usercode") + } + + testClass { + model("navigation/implementations", recursive = false) + } + + testClass { + model("navigation/gotoTestOrCode", pattern = "^(.+)\\.main\\..+\$") + } + + testClass { + model("search/inheritance") + } + + testClass { + model("search/annotations") + } + + testClass { + model("quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + + testClass { + model("typealiasExpansionIndex") + } + + testClass { + model("highlighter") + } + + testClass { + model("dslHighlighter") + } + + testClass { + model("usageHighlighter") + } + + testClass { + model("folding/noCollapse") + model("folding/checkCollapse", testMethod = "doSettingsFoldingTest") + } + + testClass { + model("codeInsight/surroundWith/if", testMethod = "doTestWithIfSurrounder") + model("codeInsight/surroundWith/ifElse", testMethod = "doTestWithIfElseSurrounder") + model("codeInsight/surroundWith/ifElseExpression", testMethod = "doTestWithIfElseExpressionSurrounder") + model("codeInsight/surroundWith/ifElseExpressionBraces", testMethod = "doTestWithIfElseExpressionBracesSurrounder") + model("codeInsight/surroundWith/not", testMethod = "doTestWithNotSurrounder") + model("codeInsight/surroundWith/parentheses", testMethod = "doTestWithParenthesesSurrounder") + model("codeInsight/surroundWith/stringTemplate", testMethod = "doTestWithStringTemplateSurrounder") + model("codeInsight/surroundWith/when", testMethod = "doTestWithWhenSurrounder") + model("codeInsight/surroundWith/tryCatch", testMethod = "doTestWithTryCatchSurrounder") + model("codeInsight/surroundWith/tryCatchExpression", testMethod = "doTestWithTryCatchExpressionSurrounder") + model("codeInsight/surroundWith/tryCatchFinally", testMethod = "doTestWithTryCatchFinallySurrounder") + model("codeInsight/surroundWith/tryCatchFinallyExpression", testMethod = "doTestWithTryCatchFinallyExpressionSurrounder") + model("codeInsight/surroundWith/tryFinally", testMethod = "doTestWithTryFinallySurrounder") + model("codeInsight/surroundWith/functionLiteral", testMethod = "doTestWithFunctionLiteralSurrounder") + model("codeInsight/surroundWith/withIfExpression", testMethod = "doTestWithSurroundWithIfExpression") + model("codeInsight/surroundWith/withIfElseExpression", testMethod = "doTestWithSurroundWithIfElseExpression") + } + + testClass { + model("joinLines") + } + + testClass { + model("codeInsight/breadcrumbs") + } + + testClass { + model("intentions", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") + } + + testClass { + model("intentions/loopToCallChain", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("concatenatedStringGenerator", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("intentions", pattern = "^(inspections\\.test)$", singleClass = true) + model("inspections", pattern = "^(inspections\\.test)$", singleClass = true) + model("inspectionsLocal", pattern = "^(inspections\\.test)$", singleClass = true) + } + + testClass { + model("inspectionsLocal", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") + } + + testClass { + model("hierarchy/class/type", extension = null, recursive = false, testMethod = "doTypeClassHierarchyTest") + model("hierarchy/class/super", extension = null, recursive = false, testMethod = "doSuperClassHierarchyTest") + model("hierarchy/class/sub", extension = null, recursive = false, testMethod = "doSubClassHierarchyTest") + model("hierarchy/calls/callers", extension = null, recursive = false, testMethod = "doCallerHierarchyTest") + model("hierarchy/calls/callersJava", extension = null, recursive = false, testMethod = "doCallerJavaHierarchyTest") + model("hierarchy/calls/callees", extension = null, recursive = false, testMethod = "doCalleeHierarchyTest") + model("hierarchy/overrides", extension = null, recursive = false, testMethod = "doOverrideHierarchyTest") + } + + testClass { + model("hierarchy/withLib", extension = null, recursive = false) + } + + testClass { + model("codeInsight/moveUpDown/classBodyDeclarations", pattern = KT_OR_KTS, testMethod = "doTestClassBodyDeclaration") + model("codeInsight/moveUpDown/closingBraces", testMethod = "doTestExpression") + model("codeInsight/moveUpDown/expressions", pattern = KT_OR_KTS, testMethod = "doTestExpression") + model("codeInsight/moveUpDown/parametersAndArguments", testMethod = "doTestExpression") + model("codeInsight/moveUpDown/trailingComma", testMethod = "doTestExpressionWithTrailingComma") + } + + testClass { + model("codeInsight/moveLeftRight") + } + + testClass { + model("refactoring/inline", pattern = "^(\\w+)\\.kt$") + } + + testClass { + model("codeInsight/unwrapAndRemove/removeExpression", testMethod = "doTestExpressionRemover") + model("codeInsight/unwrapAndRemove/unwrapThen", testMethod = "doTestThenUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapElse", testMethod = "doTestElseUnwrapper") + model("codeInsight/unwrapAndRemove/removeElse", testMethod = "doTestElseRemover") + model("codeInsight/unwrapAndRemove/unwrapLoop", testMethod = "doTestLoopUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapTry", testMethod = "doTestTryUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapCatch", testMethod = "doTestCatchUnwrapper") + model("codeInsight/unwrapAndRemove/removeCatch", testMethod = "doTestCatchRemover") + model("codeInsight/unwrapAndRemove/unwrapFinally", testMethod = "doTestFinallyUnwrapper") + model("codeInsight/unwrapAndRemove/removeFinally", testMethod = "doTestFinallyRemover") + model("codeInsight/unwrapAndRemove/unwrapLambda", testMethod = "doTestLambdaUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapFunctionParameter", testMethod = "doTestFunctionParameterUnwrapper") + } + + testClass { + model("codeInsight/expressionType") + } + + testClass { + model("codeInsight/renderingKDoc") + } + + testClass { + model("editor/backspaceHandler") + } + + testClass { + model("editor/enterHandler/multilineString") + } + + testClass { + model("editor/quickDoc", pattern = """^([^_]+)\.(kt|java)$""") + } + + testClass { + model("refactoring/safeDelete/deleteClass/kotlinClass", testMethod = "doClassTest") + model("refactoring/safeDelete/deleteClass/kotlinClassWithJava", testMethod = "doClassTestWithJava") + model("refactoring/safeDelete/deleteClass/javaClassWithKotlin", extension = "java", testMethod = "doJavaClassTest") + model("refactoring/safeDelete/deleteObject/kotlinObject", testMethod = "doObjectTest") + model("refactoring/safeDelete/deleteFunction/kotlinFunction", testMethod = "doFunctionTest") + model("refactoring/safeDelete/deleteFunction/kotlinFunctionWithJava", testMethod = "doFunctionTestWithJava") + model("refactoring/safeDelete/deleteFunction/javaFunctionWithKotlin", testMethod = "doJavaMethodTest") + model("refactoring/safeDelete/deleteProperty/kotlinProperty", testMethod = "doPropertyTest") + model("refactoring/safeDelete/deleteProperty/kotlinPropertyWithJava", testMethod = "doPropertyTestWithJava") + model("refactoring/safeDelete/deleteProperty/javaPropertyWithKotlin", testMethod = "doJavaPropertyTest") + model("refactoring/safeDelete/deleteTypeAlias/kotlinTypeAlias", testMethod = "doTypeAliasTest") + model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameter", testMethod = "doTypeParameterTest") + model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameterWithJava", testMethod = "doTypeParameterTestWithJava") + model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameter", testMethod = "doValueParameterTest") + model( + "refactoring/safeDelete/deleteValueParameter/kotlinValueParameterWithJava", + testMethod = "doValueParameterTestWithJava" + ) + } + + testClass { + model("resolve/references", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("resolve/referenceInJava/binaryAndSource", extension = "java") + model("resolve/referenceInJava/sourceOnly", extension = "java") + } + + testClass { + model("resolve/referenceInJava/binaryAndSource", extension = "java") + } + + testClass { + model("resolve/referenceWithLib", recursive = false) + } + + testClass { + model("resolve/referenceInLib", recursive = false) + } + + testClass { + model("resolve/referenceToJavaWithWrongFileStructure", recursive = false) + } + + testClass { + model("findUsages/kotlin", pattern = """^(.+)\.0\.(kt|kts)$""") + model("findUsages/java", pattern = """^(.+)\.0\.java$""") + model("findUsages/propertyFiles", pattern = """^(.+)\.0\.properties$""") + } + + testClass { + model("findUsages/kotlin/conventions/components", pattern = """^(.+)\.0\.(kt|kts)$""") + } + + testClass { + model("findUsages/libraryUsages", pattern = """^(.+)\.0\.kt$""") + } + + testClass { + model("refactoring/move", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/copy", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/moveMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/copyMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/safeDeleteMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("multiFileIntentions", extension = "test", singleClass = true, filenameStartsLowerCase = true) + } + + testClass { + model("multiFileLocalInspections", extension = "test", singleClass = true, filenameStartsLowerCase = true) + } + + testClass { + model("multiFileInspections", extension = "test", singleClass = true) + } + + testClass { + model("formatter", pattern = """^([^\.]+)\.after\.kt.*$""") + model( + "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.kt.*$""", + testMethod = "doTestCallSite", testClassName = "FormatterCallSite" + ) + model( + "formatter", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", + testMethod = "doTestInverted", testClassName = "FormatterInverted" + ) + model( + "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.inv\.kt.*$""", + testMethod = "doTestInvertedCallSite", testClassName = "FormatterInvertedCallSite" + ) + } + + testClass { + model( + "indentationOnNewline", pattern = """^([^\.]+)\.after\.kt.*$""", testMethod = "doNewlineTest", + testClassName = "DirectSettings" + ) + model( + "indentationOnNewline", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", testMethod = "doNewlineTestWithInvert", + testClassName = "InvertedSettings" + ) + } + + testClass { + model("diagnosticMessage", recursive = false) + } + + testClass { + model("diagnosticMessage/js", recursive = false, targetBackend = TargetBackend.JS) + } + + testClass { + model("refactoring/rename", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/renameMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("codeInsight/outOfBlock", pattern = KT_OR_KTS) + } + + testClass { + model("codeInsight/changeLocality", pattern = KT_OR_KTS) + } + + testClass { + model("dataFlowValueRendering") + } + + testClass { + model("copyPaste/conversion", pattern = """^([^\.]+)\.java$""") + } + + testClass { + model("copyPaste/plainTextConversion", pattern = """^([^\.]+)\.txt$""") + } + + testClass { + model("copyPaste/plainTextLiteral", pattern = """^([^\.]+)\.txt$""") + } + + testClass { + model("copyPaste/literal", pattern = """^([^\.]+)\.kt$""") + } + + testClass { + model( + "copyPaste/imports", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doTestCopy", + testClassName = "Copy", + recursive = false + ) + model( + "copyPaste/imports", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doTestCut", + testClassName = "Cut", + recursive = false + ) + } + + testClass { + model("copyPaste/moveDeclarations", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTest") + } + + testClass { + model("copyright", pattern = KT_OR_KTS, testMethod = "doTest") + } + + testClass { + model("exitPoints") + } + + testClass { + model("codeInsight/lineMarker") + } + + testClass { + model("codeInsightInLibrary/lineMarker", testMethod = "doTestWithLibrary") + } + + testClass { + model("multiModuleLineMarker", extension = null, recursive = false) + } + + testClass { + model("shortenRefs", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + testClass { + model("addImport", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("addImportAlias", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("smartSelection", testMethod = "doTestSmartSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("structureView/fileStructure", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("expressionSelection", testMethod = "doTestExpressionSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("decompiler/decompiledText", pattern = """^([^\.]+)$""") + } + + testClass { + model("decompiler/decompiledTextJvm", pattern = """^([^\.]+)$""") + } + + testClass { + model("decompiler/decompiledText", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) + } + + testClass { + model("decompiler/decompiledTextJs", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) + } + + testClass { + model("decompiler/stubBuilder", extension = null, recursive = false) + } + + testClass { + model("editor/optimizeImports/jvm", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + testClass { + model("editor/optimizeImports/js", pattern = KT_WITHOUT_DOTS_IN_NAME) + model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) + } + + testClass { + model("stubs", extension = "kt") + } + + testClass { + model("multiFileHighlighting", recursive = false) + } + + testClass { + model("multiModuleHighlighting/multiplatform/", recursive = false, extension = null) + } + + testClass { + model("multiplatform", recursive = false, extension = null) + } + + testClass { + model("multiModuleQuickFix", extension = null, deep = 1) + } + + testClass { + model("navigation/implementations/multiModule", recursive = false, extension = null) + } + + testClass { + model("navigation/relatedSymbols/multiModule", recursive = false, extension = null) + } + + testClass { + model("navigation/gotoSuper/multiModule", recursive = false, extension = null) + } + + testClass { + model("refactoring/introduceVariable", pattern = KT_OR_KTS, testMethod = "doIntroduceVariableTest") + model("refactoring/extractFunction", pattern = KT_OR_KTS, testMethod = "doExtractFunctionTest") + model("refactoring/introduceProperty", pattern = KT_OR_KTS, testMethod = "doIntroducePropertyTest") + model("refactoring/introduceParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceSimpleParameterTest") + model("refactoring/introduceLambdaParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceLambdaParameterTest") + model("refactoring/introduceJavaParameter", extension = "java", testMethod = "doIntroduceJavaParameterTest") + model("refactoring/introduceTypeParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeParameterTest") + model("refactoring/introduceTypeAlias", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeAliasTest") + model("refactoring/extractSuperclass", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractSuperclassTest") + model("refactoring/extractInterface", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractInterfaceTest") + } + + testClass { + model("refactoring/pullUp/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") + model("refactoring/pullUp/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") + model("refactoring/pullUp/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") + } + + testClass { + model("refactoring/pushDown/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") + model("refactoring/pushDown/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") + model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") + } + + testClass { + model("coverage/outputFiles") + } + + testClass { + model("internal/toolWindow", recursive = false, extension = null) + } + + testClass("org.jetbrains.kotlin.idea.kdoc.KdocResolveTestGenerated") { + model("kdoc/resolve") + } + + testClass { + model("kdoc/highlighting") + } + + testClass { + model("kdoc/typing") + } + + testClass { + model("codeInsight/generate/testFrameworkSupport") + } + + testClass { + model("codeInsight/generate/equalsWithHashCode") + } + + testClass { + model("codeInsight/generate/secondaryConstructors") + } + + testClass { + model("codeInsight/generate/toString") + } + + testClass { + model("repl/completion") + } + + testClass { + model("codeInsight/postfix") + } + + testClass { + model("codeInsight/codeVision") + } + + testClass { + model("script/definition/highlighting", extension = null, recursive = false) + model("script/definition/complex", extension = null, recursive = false, testMethod = "doComplexTest") + } + + testClass { + model("script/definition/navigation", extension = null, recursive = false) + } + + testClass { + model("script/definition/completion", extension = null, recursive = false) + } + + testClass { + model("script/definition/order", extension = null, recursive = false) + } + + testClass { + model("refactoring/nameSuggestionProvider") + } + + testClass { + model("slicer", excludeDirs = listOf("mpp")) + } + + testClass { + model("slicer/inflow", singleClass = true) + } + + testClass { + model("slicer/inflow", singleClass = true) + } + + testClass { + model("slicer/mpp", recursive = false, extension = null) + } + + testClass { + model("navigationToolbar", recursive = false) + } + } + + testGroup("idea/idea-fir/tests", "idea/testData") { + testClass { + model("fir/multiModule", recursive = false, extension = null) + } + + testClass { + model("fir/lazyResolve", extension = "test", singleClass = true, filenameStartsLowerCase = true) + } + + testClass { + model("resolve/references", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("checker", recursive = false) + model("checker/regression") + model("checker/recovery") + model("checker/rendering") + model("checker/duplicateJvmSignature") + model("checker/infos") + model("checker/diagnosticsMessage") + } + } + + testGroup("idea/scripting-support/test", "idea/scripting-support/testData") { + testClass { + model( + "scratch", + extension = "kts", + testMethod = "doScratchCompilingTest", + testClassName = "ScratchCompiling", + recursive = false + ) + model("scratch", extension = "kts", testMethod = "doScratchReplTest", testClassName = "ScratchRepl", recursive = false) + model( + "scratch/multiFile", extension = null, - testMethod = "doTest${testClass}", - testClassName = testClass + testMethod = "doScratchMultiFileTest", + testClassName = "ScratchMultiFile", + recursive = false + ) + + model( + "worksheet", + extension = "ws.kts", + testMethod = "doWorksheetCompilingTest", + testClassName = "WorksheetCompiling", + recursive = false + ) + model( + "worksheet", + extension = "ws.kts", + testMethod = "doWorksheetReplTest", + testClassName = "WorksheetRepl", + recursive = false + ) + model( + "worksheet/multiFile", + extension = null, + testMethod = "doWorksheetMultiFileTest", + testClassName = "WorksheetMultiFile", + recursive = false + ) + + model( + "scratch/rightPanelOutput", + extension = "kts", + testMethod = "doRightPreviewPanelOutputTest", + testClassName = "ScratchRightPanelOutput", + recursive = false + ) + } + + testClass { + model("scratch/lineMarker", testMethod = "doScratchTest", pattern = KT_OR_KTS) + } + } + + testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { + testClass { + model("configurator/jvm", extension = null, recursive = false, testMethod = "doTestWithMaven") + model("configurator/js", extension = null, recursive = false, testMethod = "doTestWithJSMaven") + } + + testClass { + model("maven-inspections", pattern = "^([\\w\\-]+).xml$", singleClass = true) + } + } + + testGroup("idea/idea-gradle/tests", "idea/testData") { + testClass { + model("configuration/gradle", extension = null, recursive = false, testMethod = "doTestGradle") + model("configuration/gsk", extension = null, recursive = false, testMethod = "doTestGradle") + } + } + + testGroup("idea/tests", "compiler/testData") { + testClass { + model("loadJava/compiledKotlin") + } + + testClass { + model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") + } + + testClass { + model("asJava/lightClasses", excludeDirs = listOf("delegation", "script"), pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("asJava/script/ide", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("asJava/lightClasses", pattern = KT_OR_KTS) + } + testClass { + model("asJava/ultraLightClasses", pattern = KT_OR_KTS) + } + testClass { + model("asJava/ultraLightScripts", pattern = KT_OR_KTS) + } + testClass { + model("asJava/ultraLightFacades", pattern = KT_OR_KTS) + } + + testClass { + model( + "asJava/lightClasses", + excludeDirs = listOf("local", "compilationErrors", "ideRegression"), + pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME ) } } - testClass { - allBuildSystemTests("buildFileGeneration") - } - testClass { - allBuildSystemTests("projectTemplatesBuildFileGeneration") - } - } - //TODO: move these tests into idea-completion module - testGroup("idea/tests", "idea/idea-completion/testData") { - testClass { - model("handlers/runtimeCast") + testGroup("idea/idea-completion/tests", "idea/idea-completion/testData") { + testClass { + model("injava", extension = "java", recursive = false) + } + + testClass { + model("injava", extension = "java", recursive = false) + } + + testClass { + model("injava/stdlib", extension = "java", recursive = false) + } + + testClass { + model("weighers/basic", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("weighers/smart", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("basic/common") + model("basic/js") + } + + testClass { + model("basic/common") + model("basic/java") + } + + testClass { + model("smart") + } + + testClass { + model("keywords", recursive = false) + } + + testClass { + model("basic/withLib", recursive = false) + } + + testClass { + model("handlers/basic", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("handlers/smart") + } + + testClass { + model("handlers/keywords") + } + + testClass { + model("handlers/charFilter", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("basic/multifile", extension = null, recursive = false) + } + + testClass { + model("smartMultiFile", extension = null, recursive = false) + } + + testClass("KDocCompletionTestGenerated") { + model("kdoc") + } + + testClass { + model("basic/java8") + } + + testClass { + model("incrementalResolve") + } + + testClass { + model("multiPlatform", recursive = false, extension = null) + } } - testClass { - model("basic/codeFragments", extension = "kt") - } - } - - testGroup("j2k/tests", "j2k/testData") { - testClass { - model("fileOrElement", extension = "java") - } - } - testGroup("j2k/tests", "j2k/testData") { - testClass { - model("multiFile", extension = null, recursive = false) - } - } - testGroup("j2k/tests", "j2k/testData") { - testClass { - model("fileOrElement", extension = "java") - } - } - - testGroup("nj2k/tests", "nj2k/testData") { - testClass { - model("newJ2k", pattern = """^([^\.]+)\.java$""") - } - testClass { - model("inference/common") - } - testClass { - model("inference/nullability") - } - testClass { - model("inference/mutability") - } - testClass { - model("copyPaste", pattern = """^([^\.]+)\.java$""") - } - testClass { - model("copyPastePlainText", pattern = """^([^\.]+)\.txt$""") - } - testClass { - model("multiFile", extension = null, recursive = false) - } - } - - testGroup("jps-plugin/jps-tests/test", "jps-plugin/testData") { - testClass { - model("incremental/multiModule/common", extension = null, excludeParentDirs = true) - model("incremental/multiModule/jvm", extension = null, excludeParentDirs = true) - model("incremental/multiModule/multiplatform/custom", extension = null, excludeParentDirs = true) - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/withJava", extension = null, excludeParentDirs = true) - model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true) - model("incremental/classHierarchyAffected", extension = null, excludeParentDirs = true) + testGroup( + "libraries/tools/new-project-wizard/new-project-wizard-cli/tests", + "libraries/tools/new-project-wizard/new-project-wizard-cli/testData" + ) { + testClass { + model("buildFileGeneration", recursive = false, extension = null) + } + testClass { + model("projectTemplatesBuildFileGeneration", recursive = false, extension = null) + } } - actualizeMppJpsIncTestCaseDirs(testDataRoot, "incremental/multiModule/multiplatform/withGeneratedContent") - - testClass { - model("incremental/multiModule/common", extension = null, excludeParentDirs = true) + testGroup( + "idea/idea-new-project-wizard/tests", + "libraries/tools/new-project-wizard/new-project-wizard-cli/testData" + ) { + fun TestGroup.TestClass.allBuildSystemTests(relativeRootPath: String) { + for (testClass in listOf("GradleKts", "GradleGroovy", "Maven")) { + model( + relativeRootPath, + recursive = false, + extension = null, + testMethod = "doTest${testClass}", + testClassName = testClass + ) + } + } + testClass { + allBuildSystemTests("buildFileGeneration") + } + testClass { + allBuildSystemTests("projectTemplatesBuildFileGeneration") + } } - testClass { - model( - "incremental/multiModule/multiplatform/withGeneratedContent", extension = null, excludeParentDirs = true, - testClassName = "MultiplatformMultiModule", recursive = true - ) + //TODO: move these tests into idea-completion module + testGroup("idea/tests", "idea/idea-completion/testData") { + testClass { + model("handlers/runtimeCast") + } + + testClass { + model("basic/codeFragments", extension = "kt") + } } - testClass { - model("incremental/lookupTracker/jvm", extension = null, recursive = false) + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("fileOrElement", extension = "java") + } } - testClass { - model("incremental/lookupTracker/js", extension = null, recursive = false) + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("multiFile", extension = null, recursive = false) + } } - testClass { - // todo: investigate why lookups are different from non-klib js - model("incremental/lookupTracker/jsKlib", extension = null, recursive = false) + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("fileOrElement", extension = "java") + } } - testClass { - model("incremental/lazyKotlinCaches", extension = null, excludeParentDirs = true) - model("incremental/changeIncrementalOption", extension = null, excludeParentDirs = true) + testGroup("nj2k/tests", "nj2k/testData") { + testClass { + model("newJ2k", pattern = """^([^\.]+)\.java$""") + } + testClass { + model("inference/common") + } + testClass { + model("inference/nullability") + } + testClass { + model("inference/mutability") + } + testClass { + model("copyPaste", pattern = """^([^\.]+)\.java$""") + } + testClass { + model("copyPastePlainText", pattern = """^([^\.]+)\.txt$""") + } + testClass { + model("multiFile", extension = null, recursive = false) + } } - testClass { - model("incremental/cacheVersionChanged", extension = null, excludeParentDirs = true) + testGroup("jps-plugin/jps-tests/test", "jps-plugin/testData") { + testClass { + model("incremental/multiModule/common", extension = null, excludeParentDirs = true) + model("incremental/multiModule/jvm", extension = null, excludeParentDirs = true) + model("incremental/multiModule/multiplatform/custom", extension = null, excludeParentDirs = true) + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/withJava", extension = null, excludeParentDirs = true) + model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true) + model("incremental/classHierarchyAffected", extension = null, excludeParentDirs = true) + } + + actualizeMppJpsIncTestCaseDirs(testDataRoot, "incremental/multiModule/multiplatform/withGeneratedContent") + + testClass { + model("incremental/multiModule/common", extension = null, excludeParentDirs = true) + } + + testClass { + model( + "incremental/multiModule/multiplatform/withGeneratedContent", extension = null, excludeParentDirs = true, + testClassName = "MultiplatformMultiModule", recursive = true + ) + } + + testClass { + model("incremental/lookupTracker/jvm", extension = null, recursive = false) + } + testClass { + model("incremental/lookupTracker/js", extension = null, recursive = false) + } + testClass { + // todo: investigate why lookups are different from non-klib js + model("incremental/lookupTracker/jsKlib", extension = null, recursive = false) + } + + testClass { + model("incremental/lazyKotlinCaches", extension = null, excludeParentDirs = true) + model("incremental/changeIncrementalOption", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/cacheVersionChanged", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/cacheVersionChanged", extension = null, excludeParentDirs = true) + } } - testClass { - model("incremental/cacheVersionChanged", extension = null, excludeParentDirs = true) - } - } + testGroup("jps-plugin/jps-tests/test", "jps-plugin/testData") { + fun TestGroup.TestClass.commonProtoComparisonTests() { + model("comparison/classSignatureChange", extension = null, excludeParentDirs = true) + model("comparison/classPrivateOnlyChange", extension = null, excludeParentDirs = true) + model("comparison/classMembersOnlyChanged", extension = null, excludeParentDirs = true) + model("comparison/packageMembers", extension = null, excludeParentDirs = true) + model("comparison/unchanged", extension = null, excludeParentDirs = true) + } - testGroup("jps-plugin/jps-tests/test", "jps-plugin/testData") { - fun TestGroup.TestClass.commonProtoComparisonTests() { - model("comparison/classSignatureChange", extension = null, excludeParentDirs = true) - model("comparison/classPrivateOnlyChange", extension = null, excludeParentDirs = true) - model("comparison/classMembersOnlyChanged", extension = null, excludeParentDirs = true) - model("comparison/packageMembers", extension = null, excludeParentDirs = true) - model("comparison/unchanged", extension = null, excludeParentDirs = true) + testClass { + commonProtoComparisonTests() + model("comparison/jvmOnly", extension = null, excludeParentDirs = true) + } + + testClass { + commonProtoComparisonTests() + model("comparison/jsOnly", extension = null, excludeParentDirs = true) + } } - testClass { - commonProtoComparisonTests() - model("comparison/jvmOnly", extension = null, excludeParentDirs = true) + testGroup("compiler/incremental-compilation-impl/test", "jps-plugin/testData") { + fun incrementalJvmTestData(targetBackend: TargetBackend): TestGroup.TestClass.() -> Unit = { + model("incremental/pureKotlin", extension = null, recursive = false, targetBackend = targetBackend) + model("incremental/classHierarchyAffected", extension = null, recursive = false, targetBackend = targetBackend) + model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true, targetBackend = targetBackend) + model("incremental/withJava", extension = null, excludeParentDirs = true, targetBackend = targetBackend) + model("incremental/incrementalJvmCompilerOnly", extension = null, excludeParentDirs = true, targetBackend = targetBackend) + } + testClass(init = incrementalJvmTestData(TargetBackend.JVM)) + testClass(init = incrementalJvmTestData(TargetBackend.JVM_IR)) + + testClass { + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/classHierarchyAffected", extension = null, recursive = false) + model("incremental/js", extension = null, excludeParentDirs = true) + } + + testClass(annotations = listOf(muteExtraSuffix(".jsklib"))) { + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/classHierarchyAffected", extension = null, recursive = false) + model("incremental/js", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/classHierarchyAffected", extension = null, recursive = false) + model("incremental/js", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/classHierarchyAffected", extension = null, recursive = false) + model("incremental/js", extension = null, excludeParentDirs = true) + model("incremental/scopeExpansion", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/js/friendsModuleDisabled", extension = null, recursive = false) + } + + testClass { + model("incremental/mpp/allPlatforms", extension = null, excludeParentDirs = true) + model("incremental/mpp/jvmOnly", extension = null, excludeParentDirs = true) + } + testClass { + model("incremental/mpp/allPlatforms", extension = null, excludeParentDirs = true) + } } - testClass { - commonProtoComparisonTests() - model("comparison/jsOnly", extension = null, excludeParentDirs = true) - } - } + testGroup( + "plugins/android-extensions/android-extensions-compiler/test", + "plugins/android-extensions/android-extensions-compiler/testData" + ) { + testClass { + model("descriptors", recursive = false, extension = null) + } - testGroup("compiler/incremental-compilation-impl/test", "jps-plugin/testData") { - fun incrementalJvmTestData(targetBackend: TargetBackend): TestGroup.TestClass.() -> Unit = { - model("incremental/pureKotlin", extension = null, recursive = false, targetBackend = targetBackend) - model("incremental/classHierarchyAffected", extension = null, recursive = false, targetBackend = targetBackend) - model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true, targetBackend = targetBackend) - model("incremental/withJava", extension = null, excludeParentDirs = true, targetBackend = targetBackend) - model("incremental/incrementalJvmCompilerOnly", extension = null, excludeParentDirs = true, targetBackend = targetBackend) - } - testClass(init = incrementalJvmTestData(TargetBackend.JVM)) - testClass(init = incrementalJvmTestData(TargetBackend.JVM_IR)) + testClass { + model("codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest") + model("codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke") + } - testClass { - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/classHierarchyAffected", extension = null, recursive = false) - model("incremental/js", extension = null, excludeParentDirs = true) + testClass { + model( + "codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest", + targetBackend = TargetBackend.JVM_IR + ) + model( + "codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke", + targetBackend = TargetBackend.JVM_IR + ) + } + + testClass { + model("codegen/bytecodeShape", recursive = false, extension = null) + } + + testClass { + model("parcel/box", targetBackend = TargetBackend.JVM) + } + + testClass { + model("parcel/box", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("parcel/codegen", targetBackend = TargetBackend.JVM) + } + + testClass { + model("parcel/codegen", targetBackend = TargetBackend.JVM_IR) + } } - testClass(annotations = listOf(muteExtraSuffix(".jsklib"))) { - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/classHierarchyAffected", extension = null, recursive = false) - model("incremental/js", extension = null, excludeParentDirs = true) + testGroup("plugins/jvm-abi-gen/test", "plugins/jvm-abi-gen/testData") { + testClass { + model("compare", recursive = false, extension = null) + } + + testClass { + model("content", recursive = false, extension = null) + } + + testClass { + model("compile", recursive = false, extension = null) + } } - testClass { - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/classHierarchyAffected", extension = null, recursive = false) - model("incremental/js", extension = null, excludeParentDirs = true) + testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { + testClass { + model("converter") + } + + testClass { + model("kotlinRunner") + } + + testClass { + model("converter", targetBackend = TargetBackend.JVM_IR) + } + + testClass { + model("kotlinRunner", targetBackend = TargetBackend.JVM_IR) + } } - testClass { - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/classHierarchyAffected", extension = null, recursive = false) - model("incremental/js", extension = null, excludeParentDirs = true) - model("incremental/scopeExpansion", extension = null, excludeParentDirs = true) + testGroup("plugins/kapt3/kapt3-cli/test", "plugins/kapt3/kapt3-cli/testData") { + testClass { + model("argumentParsing", extension = "txt") + } + + testClass { + model("integration", recursive = false, extension = null) + } } - testClass { - model("incremental/js/friendsModuleDisabled", extension = null, recursive = false) + testGroup("plugins/allopen/allopen-cli/test", "plugins/allopen/allopen-cli/testData") { + testClass { + model("bytecodeListing", extension = "kt") + } } - testClass { - model("incremental/mpp/allPlatforms", extension = null, excludeParentDirs = true) - model("incremental/mpp/jvmOnly", extension = null, excludeParentDirs = true) - } - testClass { - model("incremental/mpp/allPlatforms", extension = null, excludeParentDirs = true) - } - } + testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") { + testClass { + model("bytecodeListing", extension = "kt") + } - testGroup( - "plugins/android-extensions/android-extensions-compiler/test", - "plugins/android-extensions/android-extensions-compiler/testData" - ) { - testClass { - model("descriptors", recursive = false, extension = null) + testClass { + model("box", targetBackend = TargetBackend.JVM) + } } - testClass { - model("codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest") - model("codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke") + testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") { + testClass { + model("diagnostics") + } + testClass { + model("script", extension = "kts") + } } - testClass { - model( - "codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest", - targetBackend = TargetBackend.JVM_IR - ) - model( - "codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke", - targetBackend = TargetBackend.JVM_IR - ) + testGroup( + "plugins/kotlin-serialization/kotlin-serialization-compiler/test", + "plugins/kotlin-serialization/kotlin-serialization-compiler/testData" + ) { + testClass { + model("diagnostics") + } + + testClass { + model("codegen") + } + + testClass { + model("codegen") + } } - testClass { - model("codegen/bytecodeShape", recursive = false, extension = null) + testGroup("plugins/fir/fir-plugin-prototype/tests", "plugins/fir/fir-plugin-prototype/testData") { + testClass { + model("") + } } - testClass { - model("parcel/box", targetBackend = TargetBackend.JVM) + testGroup("idea/performanceTests/test", "idea/testData") { + testClass { + model("copyPaste/conversion", testMethod = "doPerfTest", pattern = """^([^\.]+)\.java$""") + } + + testClass { + model("copyPaste/conversion", testMethod = "doPerfTest", pattern = """^([^\.]+)\.java$""") + } + + testClass { + model("copyPaste/literal", testMethod = "doPerfTest", pattern = """^([^\.]+)\.kt$""") + } + + testClass { + model("highlighter", testMethod = "doPerfTest") + } + + testClass { + model("addImport", testMethod = "doPerfTest", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("indentationOnNewline", testMethod = "doPerfTest", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } } - testClass { - model("parcel/box", targetBackend = TargetBackend.JVM_IR) - } + testGroup("idea/performanceTests/test", "idea/idea-completion/testData") { + testClass { + model("incrementalResolve", testMethod = "doPerfTest") + } - testClass { - model("parcel/codegen", targetBackend = TargetBackend.JVM) - } + testClass { + model("handlers/basic", testMethod = "doPerfTest", pattern = KT_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("parcel/codegen", targetBackend = TargetBackend.JVM_IR) - } - } + testClass { + model("handlers/smart", testMethod = "doPerfTest") + } - testGroup("plugins/jvm-abi-gen/test", "plugins/jvm-abi-gen/testData") { - testClass { - model("compare", recursive = false, extension = null) - } + testClass { + model("handlers/keywords", testMethod = "doPerfTest") + } - testClass { - model("content", recursive = false, extension = null) + testClass { + model("handlers/charFilter", testMethod = "doPerfTest", pattern = KT_WITHOUT_DOTS_IN_NAME) + } } - - testClass { - model("compile", recursive = false, extension = null) - } - } - - testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { - testClass { - model("converter") - } - - testClass { - model("kotlinRunner") - } - - testClass { - model("converter", targetBackend = TargetBackend.JVM_IR) - } - - testClass { - model("kotlinRunner", targetBackend = TargetBackend.JVM_IR) - } - } - - testGroup("plugins/kapt3/kapt3-cli/test", "plugins/kapt3/kapt3-cli/testData") { - testClass { - model("argumentParsing", extension = "txt") - } - - testClass { - model("integration", recursive = false, extension = null) - } - } - - testGroup("plugins/allopen/allopen-cli/test", "plugins/allopen/allopen-cli/testData") { - testClass { - model("bytecodeListing", extension = "kt") - } - } - - testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") { - testClass { - model("bytecodeListing", extension = "kt") - } - - testClass { - model("box", targetBackend = TargetBackend.JVM) - } - } - - testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") { - testClass { - model("diagnostics") - } - testClass { - model("script", extension = "kts") - } - } - - testGroup( - "plugins/kotlin-serialization/kotlin-serialization-compiler/test", - "plugins/kotlin-serialization/kotlin-serialization-compiler/testData" - ) { - testClass { - model("diagnostics") - } - - testClass { - model("codegen") - } - - testClass { - model("codegen") - } - } - - testGroup("plugins/fir/fir-plugin-prototype/tests", "plugins/fir/fir-plugin-prototype/testData") { - testClass { - model("") - } - } - - testGroup("idea/performanceTests/test", "idea/testData") { - testClass { - model("copyPaste/conversion", testMethod = "doPerfTest", pattern = """^([^\.]+)\.java$""") - } - - testClass { - model("copyPaste/conversion", testMethod = "doPerfTest", pattern = """^([^\.]+)\.java$""") - } - - testClass { - model("copyPaste/literal", testMethod = "doPerfTest", pattern = """^([^\.]+)\.kt$""") - } - - testClass { - model("highlighter", testMethod = "doPerfTest") - } - - testClass { - model("addImport", testMethod = "doPerfTest", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("indentationOnNewline", testMethod = "doPerfTest", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - } - } - - testGroup("idea/performanceTests/test", "idea/idea-completion/testData") { - testClass { - model("incrementalResolve", testMethod = "doPerfTest") - } - - testClass { - model("handlers/basic", testMethod = "doPerfTest", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("handlers/smart", testMethod = "doPerfTest") - } - - testClass { - model("handlers/keywords", testMethod = "doPerfTest") - } - - testClass { - model("handlers/charFilter", testMethod = "doPerfTest", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - } /* testGroup("plugins/android-extensions/android-extensions-idea/tests", "plugins/android-extensions/android-extensions-idea/testData") { testClass { @@ -1587,4 +1597,5 @@ fun main() { } } */ + } } diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as36 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as36 index ef9d8ad88d7..37a5587c0b0 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as36 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as36 @@ -31,7 +31,7 @@ import org.jetbrains.kotlin.formatter.AbstractFormatterTest import org.jetbrains.kotlin.formatter.AbstractTypingIndentationTestBase import org.jetbrains.kotlin.generators.tests.generator.TestGroup import org.jetbrains.kotlin.generators.tests.generator.muteExtraSuffix -import org.jetbrains.kotlin.generators.tests.generator.testGroup +import org.jetbrains.kotlin.generators.tests.generator.testGroupSuite import org.jetbrains.kotlin.generators.util.KT_OR_KTS import org.jetbrains.kotlin.generators.util.KT_OR_KTS_WITHOUT_DOTS_IN_NAME import org.jetbrains.kotlin.generators.util.KT_WITHOUT_DOTS_IN_NAME @@ -162,1063 +162,1065 @@ import org.jetbrains.kotlinx.serialization.AbstractSerializationPluginBytecodeLi import org.jetbrains.kotlinx.serialization.AbstractSerializationPluginDiagnosticTest import org.jetbrains.kotlinx.serialization.AbstractSerializationIrBytecodeListingTest -fun main() { +fun main(args: Array) { System.setProperty("java.awt.headless", "true") - testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { - testClass { - model( - "stepping/stepIntoAndSmartStepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doStepIntoTest", - testClassName = "StepInto" - ) - model( - "stepping/stepIntoAndSmartStepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doSmartStepIntoTest", - testClassName = "SmartStepInto" - ) - model( - "stepping/stepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doStepIntoTest", - testClassName = "StepIntoOnly" - ) - model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") - model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") - model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") - model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") - } - - testClass { - model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") - model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") - } - - testClass { - model("selectExpression", recursive = false) - model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") - } - - testClass { - model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") - model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") - } - - testClass { - model("smartStepInto") - } - - testClass { - model("breakpointApplicability") - } - - testClass { - model("fileRanking") - } - - testClass { - model("asyncStackTrace") - } - - testClass { - // TODO: implement mapping logic for terminal operations - model("sequence/streams/sequence", excludeDirs = listOf("terminal")) - } - } - - testGroup("idea/tests", "idea/testData") { - testClass { - model("resolve/additionalLazyResolve") - } - - testClass { - model("resolve/partialBodyResolve") - } - - testClass { - model("checker", recursive = false) - model("checker/regression") - model("checker/recovery") - model("checker/rendering") - model("checker/scripts", extension = "kts") - model("checker/duplicateJvmSignature") - model("checker/infos", testMethod = "doTestWithInfos") - model("checker/diagnosticsMessage") - } - - testClass { - model("kotlinAndJavaChecker/javaAgainstKotlin") - model("kotlinAndJavaChecker/javaWithKotlin") - } - - testClass { - model("kotlinAndJavaChecker/javaAgainstKotlin") - } - - testClass { - model("unifier") - } - - testClass { - model("checker/codeFragments", extension = "kt", recursive = false) - model("checker/codeFragments/imports", testMethod = "doTestWithImport", extension = "kt") - } - - testClass { - model("quickfix.special/codeFragmentAutoImport", extension = "kt", recursive = false) - } - - testClass { - model("checker/js") - } - - testClass { - model("quickfix", pattern = "^([\\w\\-_]+)\\.kt$", filenameStartsLowerCase = true) - } - - testClass { - model("navigation/gotoSuper", extension = "test", recursive = false) - } - - testClass { - model("navigation/gotoTypeDeclaration", extension = "test") - } - - testClass { - model("navigation/gotoDeclaration", extension = "test") - } - - testClass { - model( - "parameterInfo", - pattern = "^([\\w\\-_]+)\\.kt$", recursive = true, - excludeDirs = listOf("withLib1/sharedLib", "withLib2/sharedLib", "withLib3/sharedLib") - ) - } - - testClass { - model("navigation/gotoClass", testMethod = "doClassTest") - model("navigation/gotoSymbol", testMethod = "doSymbolTest") - } - - testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { - model("decompiler/navigation/usercode") - } - - testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { - model("decompiler/navigation/userJavaCode", pattern = "^(.+)\\.java$") - } - - testClass(annotations = listOf(muteExtraSuffix(".libsrcjs"))) { - model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") - } - - testClass { - model("decompiler/navigation/usercode") - } - - testClass { - model("navigation/implementations", recursive = false) - } - - testClass { - model("navigation/gotoTestOrCode", pattern = "^(.+)\\.main\\..+\$") - } - - testClass { - model("search/inheritance") - } + testGroupSuite(args) { + testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { + testClass { + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepInto" + ) + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doSmartStepIntoTest", + testClassName = "SmartStepInto" + ) + model( + "stepping/stepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepIntoOnly" + ) + model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") + model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") + model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") + model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") + } + + testClass { + model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") + model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") + } + + testClass { + model("selectExpression", recursive = false) + model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") + } + + testClass { + model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") + model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") + } + + testClass { + model("smartStepInto") + } + + testClass { + model("breakpointApplicability") + } + + testClass { + model("fileRanking") + } + + testClass { + model("asyncStackTrace") + } + + testClass { + // TODO: implement mapping logic for terminal operations + model("sequence/streams/sequence", excludeDirs = listOf("terminal")) + } + } + + testGroup("idea/tests", "idea/testData") { + testClass { + model("resolve/additionalLazyResolve") + } + + testClass { + model("resolve/partialBodyResolve") + } + + testClass { + model("checker", recursive = false) + model("checker/regression") + model("checker/recovery") + model("checker/rendering") + model("checker/scripts", extension = "kts") + model("checker/duplicateJvmSignature") + model("checker/infos", testMethod = "doTestWithInfos") + model("checker/diagnosticsMessage") + } + + testClass { + model("kotlinAndJavaChecker/javaAgainstKotlin") + model("kotlinAndJavaChecker/javaWithKotlin") + } + + testClass { + model("kotlinAndJavaChecker/javaAgainstKotlin") + } + + testClass { + model("unifier") + } + + testClass { + model("checker/codeFragments", extension = "kt", recursive = false) + model("checker/codeFragments/imports", testMethod = "doTestWithImport", extension = "kt") + } + + testClass { + model("quickfix.special/codeFragmentAutoImport", extension = "kt", recursive = false) + } + + testClass { + model("checker/js") + } + + testClass { + model("quickfix", pattern = "^([\\w\\-_]+)\\.kt$", filenameStartsLowerCase = true) + } + + testClass { + model("navigation/gotoSuper", extension = "test", recursive = false) + } + + testClass { + model("navigation/gotoTypeDeclaration", extension = "test") + } + + testClass { + model("navigation/gotoDeclaration", extension = "test") + } + + testClass { + model( + "parameterInfo", + pattern = "^([\\w\\-_]+)\\.kt$", recursive = true, + excludeDirs = listOf("withLib1/sharedLib", "withLib2/sharedLib", "withLib3/sharedLib") + ) + } + + testClass { + model("navigation/gotoClass", testMethod = "doClassTest") + model("navigation/gotoSymbol", testMethod = "doSymbolTest") + } + + testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { + model("decompiler/navigation/usercode") + } + + testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { + model("decompiler/navigation/userJavaCode", pattern = "^(.+)\\.java$") + } + + testClass(annotations = listOf(muteExtraSuffix(".libsrcjs"))) { + model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") + } + + testClass { + model("decompiler/navigation/usercode") + } + + testClass { + model("navigation/implementations", recursive = false) + } + + testClass { + model("navigation/gotoTestOrCode", pattern = "^(.+)\\.main\\..+\$") + } + + testClass { + model("search/inheritance") + } + + testClass { + model("search/annotations") + } + + testClass { + model("quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + + testClass { + model("typealiasExpansionIndex") + } + + testClass { + model("highlighter") + } + + testClass { + model("dslHighlighter") + } + + testClass { + model("usageHighlighter") + } + + testClass { + model("folding/noCollapse") + model("folding/checkCollapse", testMethod = "doSettingsFoldingTest") + } + + testClass { + model("codeInsight/surroundWith/if", testMethod = "doTestWithIfSurrounder") + model("codeInsight/surroundWith/ifElse", testMethod = "doTestWithIfElseSurrounder") + model("codeInsight/surroundWith/ifElseExpression", testMethod = "doTestWithIfElseExpressionSurrounder") + model("codeInsight/surroundWith/ifElseExpressionBraces", testMethod = "doTestWithIfElseExpressionBracesSurrounder") + model("codeInsight/surroundWith/not", testMethod = "doTestWithNotSurrounder") + model("codeInsight/surroundWith/parentheses", testMethod = "doTestWithParenthesesSurrounder") + model("codeInsight/surroundWith/stringTemplate", testMethod = "doTestWithStringTemplateSurrounder") + model("codeInsight/surroundWith/when", testMethod = "doTestWithWhenSurrounder") + model("codeInsight/surroundWith/tryCatch", testMethod = "doTestWithTryCatchSurrounder") + model("codeInsight/surroundWith/tryCatchExpression", testMethod = "doTestWithTryCatchExpressionSurrounder") + model("codeInsight/surroundWith/tryCatchFinally", testMethod = "doTestWithTryCatchFinallySurrounder") + model("codeInsight/surroundWith/tryCatchFinallyExpression", testMethod = "doTestWithTryCatchFinallyExpressionSurrounder") + model("codeInsight/surroundWith/tryFinally", testMethod = "doTestWithTryFinallySurrounder") + model("codeInsight/surroundWith/functionLiteral", testMethod = "doTestWithFunctionLiteralSurrounder") + model("codeInsight/surroundWith/withIfExpression", testMethod = "doTestWithSurroundWithIfExpression") + model("codeInsight/surroundWith/withIfElseExpression", testMethod = "doTestWithSurroundWithIfElseExpression") + } + + testClass { + model("joinLines") + } + + testClass { + model("codeInsight/breadcrumbs") + } + + testClass { + model("intentions", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") + } + + testClass { + model("intentions/loopToCallChain", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("concatenatedStringGenerator", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("intentions", pattern = "^(inspections\\.test)$", singleClass = true) + model("inspections", pattern = "^(inspections\\.test)$", singleClass = true) + model("inspectionsLocal", pattern = "^(inspections\\.test)$", singleClass = true) + } + + testClass { + model("inspectionsLocal", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") + } + + testClass { + model("hierarchy/class/type", extension = null, recursive = false, testMethod = "doTypeClassHierarchyTest") + model("hierarchy/class/super", extension = null, recursive = false, testMethod = "doSuperClassHierarchyTest") + model("hierarchy/class/sub", extension = null, recursive = false, testMethod = "doSubClassHierarchyTest") + model("hierarchy/calls/callers", extension = null, recursive = false, testMethod = "doCallerHierarchyTest") + model("hierarchy/calls/callersJava", extension = null, recursive = false, testMethod = "doCallerJavaHierarchyTest") + model("hierarchy/calls/callees", extension = null, recursive = false, testMethod = "doCalleeHierarchyTest") + model("hierarchy/overrides", extension = null, recursive = false, testMethod = "doOverrideHierarchyTest") + } + + testClass { + model("hierarchy/withLib", extension = null, recursive = false) + } + + testClass { + model("codeInsight/moveUpDown/classBodyDeclarations", pattern = KT_OR_KTS, testMethod = "doTestClassBodyDeclaration") + model("codeInsight/moveUpDown/closingBraces", testMethod = "doTestExpression") + model("codeInsight/moveUpDown/expressions", pattern = KT_OR_KTS, testMethod = "doTestExpression") + model("codeInsight/moveUpDown/parametersAndArguments", testMethod = "doTestExpression") + model("codeInsight/moveUpDown/trailingComma", testMethod = "doTestExpressionWithTrailingComma") + } + + testClass { + model("codeInsight/moveLeftRight") + } + + testClass { + model("refactoring/inline", pattern = "^(\\w+)\\.kt$") + } + + testClass { + model("codeInsight/unwrapAndRemove/removeExpression", testMethod = "doTestExpressionRemover") + model("codeInsight/unwrapAndRemove/unwrapThen", testMethod = "doTestThenUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapElse", testMethod = "doTestElseUnwrapper") + model("codeInsight/unwrapAndRemove/removeElse", testMethod = "doTestElseRemover") + model("codeInsight/unwrapAndRemove/unwrapLoop", testMethod = "doTestLoopUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapTry", testMethod = "doTestTryUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapCatch", testMethod = "doTestCatchUnwrapper") + model("codeInsight/unwrapAndRemove/removeCatch", testMethod = "doTestCatchRemover") + model("codeInsight/unwrapAndRemove/unwrapFinally", testMethod = "doTestFinallyUnwrapper") + model("codeInsight/unwrapAndRemove/removeFinally", testMethod = "doTestFinallyRemover") + model("codeInsight/unwrapAndRemove/unwrapLambda", testMethod = "doTestLambdaUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapFunctionParameter", testMethod = "doTestFunctionParameterUnwrapper") + } + + testClass { + model("codeInsight/expressionType") + } + + testClass { + model("editor/backspaceHandler") + } + + testClass { + model("editor/enterHandler/multilineString") + } + + testClass { + model("editor/quickDoc", pattern = """^([^_]+)\.(kt|java)$""") + } + + testClass { + model("refactoring/safeDelete/deleteClass/kotlinClass", testMethod = "doClassTest") + model("refactoring/safeDelete/deleteClass/kotlinClassWithJava", testMethod = "doClassTestWithJava") + model("refactoring/safeDelete/deleteClass/javaClassWithKotlin", extension = "java", testMethod = "doJavaClassTest") + model("refactoring/safeDelete/deleteObject/kotlinObject", testMethod = "doObjectTest") + model("refactoring/safeDelete/deleteFunction/kotlinFunction", testMethod = "doFunctionTest") + model("refactoring/safeDelete/deleteFunction/kotlinFunctionWithJava", testMethod = "doFunctionTestWithJava") + model("refactoring/safeDelete/deleteFunction/javaFunctionWithKotlin", testMethod = "doJavaMethodTest") + model("refactoring/safeDelete/deleteProperty/kotlinProperty", testMethod = "doPropertyTest") + model("refactoring/safeDelete/deleteProperty/kotlinPropertyWithJava", testMethod = "doPropertyTestWithJava") + model("refactoring/safeDelete/deleteProperty/javaPropertyWithKotlin", testMethod = "doJavaPropertyTest") + model("refactoring/safeDelete/deleteTypeAlias/kotlinTypeAlias", testMethod = "doTypeAliasTest") + model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameter", testMethod = "doTypeParameterTest") + model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameterWithJava", testMethod = "doTypeParameterTestWithJava") + model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameter", testMethod = "doValueParameterTest") + model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameterWithJava", testMethod = "doValueParameterTestWithJava") + } + + testClass { + model("resolve/references", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("resolve/referenceInJava/binaryAndSource", extension = "java") + model("resolve/referenceInJava/sourceOnly", extension = "java") + } + + testClass { + model("resolve/referenceInJava/binaryAndSource", extension = "java") + } + + testClass { + model("resolve/referenceWithLib", recursive = false) + } + + testClass { + model("resolve/referenceInLib", recursive = false) + } + + testClass { + model("resolve/referenceToJavaWithWrongFileStructure", recursive = false) + } + + testClass { + model("findUsages/kotlin", pattern = """^(.+)\.0\.(kt|kts)$""") + model("findUsages/java", pattern = """^(.+)\.0\.java$""") + model("findUsages/propertyFiles", pattern = """^(.+)\.0\.properties$""") + } + + testClass { + model("findUsages/libraryUsages", pattern = """^(.+)\.0\.kt$""") + } + + testClass { + model("refactoring/move", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/copy", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/moveMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/copyMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/safeDeleteMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("multiFileIntentions", extension = "test", singleClass = true, filenameStartsLowerCase = true) + } + + testClass { + model("multiFileLocalInspections", extension = "test", singleClass = true, filenameStartsLowerCase = true) + } + + testClass { + model("multiFileInspections", extension = "test", singleClass = true) + } + + testClass { + model("formatter", pattern = """^([^\.]+)\.after\.kt.*$""") + model( + "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.kt.*$""", + testMethod = "doTestCallSite", testClassName = "FormatterCallSite" + ) + model( + "formatter", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", + testMethod = "doTestInverted", testClassName = "FormatterInverted" + ) + model( + "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.inv\.kt.*$""", + testMethod = "doTestInvertedCallSite", testClassName = "FormatterInvertedCallSite" + ) + } + + testClass { + model("indentationOnNewline", pattern = """^([^\.]+)\.after\.kt.*$""", testMethod = "doNewlineTest", + testClassName = "DirectSettings") + model("indentationOnNewline", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", testMethod = "doNewlineTestWithInvert", + testClassName = "InvertedSettings") + } + + testClass { + model("diagnosticMessage", recursive = false) + } + + testClass { + model("diagnosticMessage/js", recursive = false, targetBackend = TargetBackend.JS) + } + + testClass { + model("refactoring/rename", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/renameMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("codeInsight/outOfBlock", pattern = KT_OR_KTS) + } + + testClass { + model("dataFlowValueRendering") + } + + testClass { + model("copyPaste/conversion", pattern = """^([^\.]+)\.java$""") + } + + testClass { + model("copyPaste/plainTextConversion", pattern = """^([^\.]+)\.txt$""") + } + + testClass { + model("copyPaste/plainTextLiteral", pattern = """^([^\.]+)\.txt$""") + } + + testClass { + model("copyPaste/literal", pattern = """^([^\.]+)\.kt$""") + } + + testClass { + model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCopy", testClassName = "Copy", recursive = false) + model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCut", testClassName = "Cut", recursive = false) + } + + testClass { + model("copyPaste/moveDeclarations", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTest") + } + + testClass { + model("copyright", pattern = KT_OR_KTS, testMethod = "doTest") + } + + testClass { + model("exitPoints") + } + + testClass { + model("codeInsight/lineMarker") + } + + testClass { + model("codeInsightInLibrary/lineMarker", testMethod = "doTestWithLibrary") + } + + testClass { + model("multiModuleLineMarker", extension = null, recursive = false) + } + + testClass { + model("shortenRefs", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + testClass { + model("addImport", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("smartSelection", testMethod = "doTestSmartSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("structureView/fileStructure", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("expressionSelection", testMethod = "doTestExpressionSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("decompiler/decompiledText", pattern = """^([^\.]+)$""") + } + + testClass { + model("decompiler/decompiledTextJvm", pattern = """^([^\.]+)$""") + } + + testClass { + model("decompiler/decompiledText", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) + } + + testClass { + model("decompiler/decompiledTextJs", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) + } + + testClass { + model("decompiler/stubBuilder", extension = null, recursive = false) + } + + testClass { + model("editor/optimizeImports/jvm", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + testClass { + model("editor/optimizeImports/js", pattern = KT_WITHOUT_DOTS_IN_NAME) + model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) + } + + testClass { + model("stubs", extension = "kt") + } + + testClass { + model("multiFileHighlighting", recursive = false) + } + + testClass { + model("multiModuleHighlighting/multiplatform/", recursive = false, extension = null) + } + + testClass { + model("multiModuleHighlighting/hierarchicalExpectActualMatching/", recursive = false, extension = null) + } + + testClass { + model("multiModuleQuickFix", extension = null, deep = 1) + } + + testClass { + model("navigation/implementations/multiModule", recursive = false, extension = null) + } + + testClass { + model("navigation/relatedSymbols/multiModule", recursive = false, extension = null) + } + + testClass { + model("navigation/gotoSuper/multiModule", recursive = false, extension = null) + } + + testClass { + model("refactoring/introduceVariable", pattern = KT_OR_KTS, testMethod = "doIntroduceVariableTest") + model("refactoring/extractFunction", pattern = KT_OR_KTS, testMethod = "doExtractFunctionTest") + model("refactoring/introduceProperty", pattern = KT_OR_KTS, testMethod = "doIntroducePropertyTest") + model("refactoring/introduceParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceSimpleParameterTest") + model("refactoring/introduceLambdaParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceLambdaParameterTest") + model("refactoring/introduceJavaParameter", extension = "java", testMethod = "doIntroduceJavaParameterTest") + model("refactoring/introduceTypeParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeParameterTest") + model("refactoring/introduceTypeAlias", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeAliasTest") + model("refactoring/extractSuperclass", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractSuperclassTest") + model("refactoring/extractInterface", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractInterfaceTest") + } + + testClass { + model("refactoring/pullUp/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") + model("refactoring/pullUp/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") + model("refactoring/pullUp/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") + } + + testClass { + model("refactoring/pushDown/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") + model("refactoring/pushDown/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") + model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") + } + + testClass { + model("coverage/outputFiles") + } + + testClass { + model("internal/toolWindow", recursive = false, extension = null) + } + + testClass("org.jetbrains.kotlin.idea.kdoc.KdocResolveTestGenerated") { + model("kdoc/resolve") + } + + testClass { + model("kdoc/highlighting") + } + + testClass { + model("kdoc/typing") + } + + testClass { + model("codeInsight/generate/testFrameworkSupport") + } + + testClass { + model("codeInsight/generate/equalsWithHashCode") + } + + testClass { + model("codeInsight/generate/secondaryConstructors") + } + + testClass { + model("codeInsight/generate/toString") + } + + testClass { + model("repl/completion") + } + + testClass { + model("codeInsight/postfix") + } + + testClass { + model("script/definition/highlighting", extension = null, recursive = false) + model("script/definition/complex", extension = null, recursive = false, testMethod = "doComplexTest") + } - testClass { - model("search/annotations") - } + testClass { + model("script/definition/navigation", extension = null, recursive = false) + } - testClass { - model("quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } + testClass { + model("script/definition/completion", extension = null, recursive = false) + } - testClass { - model("typealiasExpansionIndex") - } + testClass { + model("script/definition/order", extension = null, recursive = false) + } - testClass { - model("highlighter") - } + testClass { + model("refactoring/nameSuggestionProvider") + } - testClass { - model("dslHighlighter") - } + testClass { + model("slicer", excludeDirs = listOf("mpp")) + } - testClass { - model("usageHighlighter") - } + testClass { + model("slicer/inflow", singleClass = true) + } - testClass { - model("folding/noCollapse") - model("folding/checkCollapse", testMethod = "doSettingsFoldingTest") - } + testClass { + model("slicer/inflow", singleClass = true) + } - testClass { - model("codeInsight/surroundWith/if", testMethod = "doTestWithIfSurrounder") - model("codeInsight/surroundWith/ifElse", testMethod = "doTestWithIfElseSurrounder") - model("codeInsight/surroundWith/ifElseExpression", testMethod = "doTestWithIfElseExpressionSurrounder") - model("codeInsight/surroundWith/ifElseExpressionBraces", testMethod = "doTestWithIfElseExpressionBracesSurrounder") - model("codeInsight/surroundWith/not", testMethod = "doTestWithNotSurrounder") - model("codeInsight/surroundWith/parentheses", testMethod = "doTestWithParenthesesSurrounder") - model("codeInsight/surroundWith/stringTemplate", testMethod = "doTestWithStringTemplateSurrounder") - model("codeInsight/surroundWith/when", testMethod = "doTestWithWhenSurrounder") - model("codeInsight/surroundWith/tryCatch", testMethod = "doTestWithTryCatchSurrounder") - model("codeInsight/surroundWith/tryCatchExpression", testMethod = "doTestWithTryCatchExpressionSurrounder") - model("codeInsight/surroundWith/tryCatchFinally", testMethod = "doTestWithTryCatchFinallySurrounder") - model("codeInsight/surroundWith/tryCatchFinallyExpression", testMethod = "doTestWithTryCatchFinallyExpressionSurrounder") - model("codeInsight/surroundWith/tryFinally", testMethod = "doTestWithTryFinallySurrounder") - model("codeInsight/surroundWith/functionLiteral", testMethod = "doTestWithFunctionLiteralSurrounder") - model("codeInsight/surroundWith/withIfExpression", testMethod = "doTestWithSurroundWithIfExpression") - model("codeInsight/surroundWith/withIfElseExpression", testMethod = "doTestWithSurroundWithIfElseExpression") + testClass { + model("slicer/mpp", recursive = false, extension = null) + } } - testClass { - model("joinLines") - } + testGroup("idea/scripting-support/test", "idea/scripting-support/testData") { + testClass { + model("scratch", extension = "kts", testMethod = "doScratchCompilingTest", testClassName = "ScratchCompiling", recursive = false) + model("scratch", extension = "kts", testMethod = "doScratchReplTest", testClassName = "ScratchRepl", recursive = false) + model("scratch/multiFile", extension = null, testMethod = "doScratchMultiFileTest", testClassName = "ScratchMultiFile", recursive = false) - testClass { - model("codeInsight/breadcrumbs") - } + model("worksheet", extension = "ws.kts", testMethod = "doWorksheetCompilingTest", testClassName = "WorksheetCompiling", recursive = false) + model("worksheet", extension = "ws.kts", testMethod = "doWorksheetReplTest", testClassName = "WorksheetRepl", recursive = false) + model("worksheet/multiFile", extension = null, testMethod = "doWorksheetMultiFileTest", testClassName = "WorksheetMultiFile", recursive = false) - testClass { - model("intentions", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") - } + model("scratch/rightPanelOutput", extension = "kts", testMethod = "doRightPreviewPanelOutputTest", testClassName = "ScratchRightPanelOutput", recursive = false) + } - testClass { - model("intentions/loopToCallChain", pattern = "^([\\w\\-_]+)\\.kt$") - } + testClass { + model("scratch/lineMarker", testMethod = "doScratchTest", pattern = KT_OR_KTS) + } - testClass { - model("concatenatedStringGenerator", pattern = "^([\\w\\-_]+)\\.kt$") } - testClass { - model("intentions", pattern = "^(inspections\\.test)$", singleClass = true) - model("inspections", pattern = "^(inspections\\.test)$", singleClass = true) - model("inspectionsLocal", pattern = "^(inspections\\.test)$", singleClass = true) - } + /* + // Maven and Gradle are not relevant for AS branch - testClass { - model("inspectionsLocal", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") - } + testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { + testClass { + model("configurator/jvm", extension = null, recursive = false, testMethod = "doTestWithMaven") + model("configurator/js", extension = null, recursive = false, testMethod = "doTestWithJSMaven") + } - testClass { - model("hierarchy/class/type", extension = null, recursive = false, testMethod = "doTypeClassHierarchyTest") - model("hierarchy/class/super", extension = null, recursive = false, testMethod = "doSuperClassHierarchyTest") - model("hierarchy/class/sub", extension = null, recursive = false, testMethod = "doSubClassHierarchyTest") - model("hierarchy/calls/callers", extension = null, recursive = false, testMethod = "doCallerHierarchyTest") - model("hierarchy/calls/callersJava", extension = null, recursive = false, testMethod = "doCallerJavaHierarchyTest") - model("hierarchy/calls/callees", extension = null, recursive = false, testMethod = "doCalleeHierarchyTest") - model("hierarchy/overrides", extension = null, recursive = false, testMethod = "doOverrideHierarchyTest") + testClass { + model("maven-inspections", pattern = "^([\\w\\-]+).xml$", singleClass = true) + } } - testClass { - model("hierarchy/withLib", extension = null, recursive = false) + testGroup("idea/idea-gradle/tests", "idea/testData") { + testClass { + model("configuration/gradle", extension = null, recursive = false, testMethod = "doTestGradle") + model("configuration/gsk", extension = null, recursive = false, testMethod = "doTestGradle") + } } - testClass { - model("codeInsight/moveUpDown/classBodyDeclarations", pattern = KT_OR_KTS, testMethod = "doTestClassBodyDeclaration") - model("codeInsight/moveUpDown/closingBraces", testMethod = "doTestExpression") - model("codeInsight/moveUpDown/expressions", pattern = KT_OR_KTS, testMethod = "doTestExpression") - model("codeInsight/moveUpDown/parametersAndArguments", testMethod = "doTestExpression") - model("codeInsight/moveUpDown/trailingComma", testMethod = "doTestExpressionWithTrailingComma") - } + */ - testClass { - model("codeInsight/moveLeftRight") - } + testGroup("idea/tests", "compiler/testData") { + testClass { + model("loadJava/compiledKotlin") + } - testClass { - model("refactoring/inline", pattern = "^(\\w+)\\.kt$") - } + testClass { + model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") + } - testClass { - model("codeInsight/unwrapAndRemove/removeExpression", testMethod = "doTestExpressionRemover") - model("codeInsight/unwrapAndRemove/unwrapThen", testMethod = "doTestThenUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapElse", testMethod = "doTestElseUnwrapper") - model("codeInsight/unwrapAndRemove/removeElse", testMethod = "doTestElseRemover") - model("codeInsight/unwrapAndRemove/unwrapLoop", testMethod = "doTestLoopUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapTry", testMethod = "doTestTryUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapCatch", testMethod = "doTestCatchUnwrapper") - model("codeInsight/unwrapAndRemove/removeCatch", testMethod = "doTestCatchRemover") - model("codeInsight/unwrapAndRemove/unwrapFinally", testMethod = "doTestFinallyUnwrapper") - model("codeInsight/unwrapAndRemove/removeFinally", testMethod = "doTestFinallyRemover") - model("codeInsight/unwrapAndRemove/unwrapLambda", testMethod = "doTestLambdaUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapFunctionParameter", testMethod = "doTestFunctionParameterUnwrapper") - } + testClass { + model("asJava/lightClasses", excludeDirs = listOf("delegation", "script"), pattern = KT_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("codeInsight/expressionType") - } + testClass { + model("asJava/script/ide", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("editor/backspaceHandler") + testClass { + model("asJava/lightClasses", excludeDirs = listOf("local", "compilationErrors", "ideRegression"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } } - testClass { - model("editor/enterHandler/multilineString") - } + testGroup("idea/idea-completion/tests", "idea/idea-completion/testData") { + testClass { + model("injava", extension = "java", recursive = false) + } - testClass { - model("editor/quickDoc", pattern = """^([^_]+)\.(kt|java)$""") - } + testClass { + model("injava", extension = "java", recursive = false) + } - testClass { - model("refactoring/safeDelete/deleteClass/kotlinClass", testMethod = "doClassTest") - model("refactoring/safeDelete/deleteClass/kotlinClassWithJava", testMethod = "doClassTestWithJava") - model("refactoring/safeDelete/deleteClass/javaClassWithKotlin", extension = "java", testMethod = "doJavaClassTest") - model("refactoring/safeDelete/deleteObject/kotlinObject", testMethod = "doObjectTest") - model("refactoring/safeDelete/deleteFunction/kotlinFunction", testMethod = "doFunctionTest") - model("refactoring/safeDelete/deleteFunction/kotlinFunctionWithJava", testMethod = "doFunctionTestWithJava") - model("refactoring/safeDelete/deleteFunction/javaFunctionWithKotlin", testMethod = "doJavaMethodTest") - model("refactoring/safeDelete/deleteProperty/kotlinProperty", testMethod = "doPropertyTest") - model("refactoring/safeDelete/deleteProperty/kotlinPropertyWithJava", testMethod = "doPropertyTestWithJava") - model("refactoring/safeDelete/deleteProperty/javaPropertyWithKotlin", testMethod = "doJavaPropertyTest") - model("refactoring/safeDelete/deleteTypeAlias/kotlinTypeAlias", testMethod = "doTypeAliasTest") - model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameter", testMethod = "doTypeParameterTest") - model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameterWithJava", testMethod = "doTypeParameterTestWithJava") - model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameter", testMethod = "doValueParameterTest") - model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameterWithJava", testMethod = "doValueParameterTestWithJava") - } + testClass { + model("injava/stdlib", extension = "java", recursive = false) + } - testClass { - model("resolve/references", pattern = KT_WITHOUT_DOTS_IN_NAME) - } + testClass { + model("weighers/basic", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("resolve/referenceInJava/binaryAndSource", extension = "java") - model("resolve/referenceInJava/sourceOnly", extension = "java") - } + testClass { + model("weighers/smart", pattern = KT_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("resolve/referenceInJava/binaryAndSource", extension = "java") - } + testClass { + model("basic/common") + model("basic/js") + } - testClass { - model("resolve/referenceWithLib", recursive = false) - } + testClass { + model("basic/common") + model("basic/java") + } - testClass { - model("resolve/referenceInLib", recursive = false) - } + testClass { + model("smart") + } - testClass { - model("resolve/referenceToJavaWithWrongFileStructure", recursive = false) - } + testClass { + model("keywords", recursive = false) + } - testClass { - model("findUsages/kotlin", pattern = """^(.+)\.0\.(kt|kts)$""") - model("findUsages/java", pattern = """^(.+)\.0\.java$""") - model("findUsages/propertyFiles", pattern = """^(.+)\.0\.properties$""") - } + testClass { + model("basic/withLib", recursive = false) + } - testClass { - model("findUsages/libraryUsages", pattern = """^(.+)\.0\.kt$""") - } - - testClass { - model("refactoring/move", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/copy", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/moveMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/copyMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/safeDeleteMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("multiFileIntentions", extension = "test", singleClass = true, filenameStartsLowerCase = true) - } - - testClass { - model("multiFileLocalInspections", extension = "test", singleClass = true, filenameStartsLowerCase = true) - } - - testClass { - model("multiFileInspections", extension = "test", singleClass = true) - } - - testClass { - model("formatter", pattern = """^([^\.]+)\.after\.kt.*$""") - model( - "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.kt.*$""", - testMethod = "doTestCallSite", testClassName = "FormatterCallSite" - ) - model( - "formatter", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", - testMethod = "doTestInverted", testClassName = "FormatterInverted" - ) - model( - "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.inv\.kt.*$""", - testMethod = "doTestInvertedCallSite", testClassName = "FormatterInvertedCallSite" - ) - } - - testClass { - model("indentationOnNewline", pattern = """^([^\.]+)\.after\.kt.*$""", testMethod = "doNewlineTest", - testClassName = "DirectSettings") - model("indentationOnNewline", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", testMethod = "doNewlineTestWithInvert", - testClassName = "InvertedSettings") - } - - testClass { - model("diagnosticMessage", recursive = false) - } - - testClass { - model("diagnosticMessage/js", recursive = false, targetBackend = TargetBackend.JS) - } - - testClass { - model("refactoring/rename", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/renameMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("codeInsight/outOfBlock", pattern = KT_OR_KTS) - } - - testClass { - model("dataFlowValueRendering") - } + testClass { + model("handlers/basic", pattern = KT_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("copyPaste/conversion", pattern = """^([^\.]+)\.java$""") - } - - testClass { - model("copyPaste/plainTextConversion", pattern = """^([^\.]+)\.txt$""") - } - - testClass { - model("copyPaste/plainTextLiteral", pattern = """^([^\.]+)\.txt$""") - } - - testClass { - model("copyPaste/literal", pattern = """^([^\.]+)\.kt$""") - } - - testClass { - model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCopy", testClassName = "Copy", recursive = false) - model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCut", testClassName = "Cut", recursive = false) - } - - testClass { - model("copyPaste/moveDeclarations", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTest") - } - - testClass { - model("copyright", pattern = KT_OR_KTS, testMethod = "doTest") - } - - testClass { - model("exitPoints") - } - - testClass { - model("codeInsight/lineMarker") - } - - testClass { - model("codeInsightInLibrary/lineMarker", testMethod = "doTestWithLibrary") - } - - testClass { - model("multiModuleLineMarker", extension = null, recursive = false) - } - - testClass { - model("shortenRefs", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - testClass { - model("addImport", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("smartSelection", testMethod = "doTestSmartSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("structureView/fileStructure", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("expressionSelection", testMethod = "doTestExpressionSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("decompiler/decompiledText", pattern = """^([^\.]+)$""") - } - - testClass { - model("decompiler/decompiledTextJvm", pattern = """^([^\.]+)$""") - } - - testClass { - model("decompiler/decompiledText", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) - } - - testClass { - model("decompiler/decompiledTextJs", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) - } - - testClass { - model("decompiler/stubBuilder", extension = null, recursive = false) - } - - testClass { - model("editor/optimizeImports/jvm", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - testClass { - model("editor/optimizeImports/js", pattern = KT_WITHOUT_DOTS_IN_NAME) - model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) - } - - testClass { - model("stubs", extension = "kt") - } - - testClass { - model("multiFileHighlighting", recursive = false) - } - - testClass { - model("multiModuleHighlighting/multiplatform/", recursive = false, extension = null) - } - - testClass { - model("multiModuleHighlighting/hierarchicalExpectActualMatching/", recursive = false, extension = null) - } - - testClass { - model("multiModuleQuickFix", extension = null, deep = 1) - } - - testClass { - model("navigation/implementations/multiModule", recursive = false, extension = null) - } - - testClass { - model("navigation/relatedSymbols/multiModule", recursive = false, extension = null) - } - - testClass { - model("navigation/gotoSuper/multiModule", recursive = false, extension = null) - } - - testClass { - model("refactoring/introduceVariable", pattern = KT_OR_KTS, testMethod = "doIntroduceVariableTest") - model("refactoring/extractFunction", pattern = KT_OR_KTS, testMethod = "doExtractFunctionTest") - model("refactoring/introduceProperty", pattern = KT_OR_KTS, testMethod = "doIntroducePropertyTest") - model("refactoring/introduceParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceSimpleParameterTest") - model("refactoring/introduceLambdaParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceLambdaParameterTest") - model("refactoring/introduceJavaParameter", extension = "java", testMethod = "doIntroduceJavaParameterTest") - model("refactoring/introduceTypeParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeParameterTest") - model("refactoring/introduceTypeAlias", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeAliasTest") - model("refactoring/extractSuperclass", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractSuperclassTest") - model("refactoring/extractInterface", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractInterfaceTest") - } - - testClass { - model("refactoring/pullUp/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") - model("refactoring/pullUp/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") - model("refactoring/pullUp/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") - } - - testClass { - model("refactoring/pushDown/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") - model("refactoring/pushDown/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") - model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") - } - - testClass { - model("coverage/outputFiles") - } - - testClass { - model("internal/toolWindow", recursive = false, extension = null) - } - - testClass("org.jetbrains.kotlin.idea.kdoc.KdocResolveTestGenerated") { - model("kdoc/resolve") - } - - testClass { - model("kdoc/highlighting") - } - - testClass { - model("kdoc/typing") - } - - testClass { - model("codeInsight/generate/testFrameworkSupport") - } - - testClass { - model("codeInsight/generate/equalsWithHashCode") - } - - testClass { - model("codeInsight/generate/secondaryConstructors") - } - - testClass { - model("codeInsight/generate/toString") - } - - testClass { - model("repl/completion") - } - - testClass { - model("codeInsight/postfix") - } - - testClass { - model("script/definition/highlighting", extension = null, recursive = false) - model("script/definition/complex", extension = null, recursive = false, testMethod = "doComplexTest") - } - - testClass { - model("script/definition/navigation", extension = null, recursive = false) - } - - testClass { - model("script/definition/completion", extension = null, recursive = false) - } - - testClass { - model("script/definition/order", extension = null, recursive = false) - } - - testClass { - model("refactoring/nameSuggestionProvider") - } - - testClass { - model("slicer", excludeDirs = listOf("mpp")) - } - - testClass { - model("slicer/inflow", singleClass = true) - } - - testClass { - model("slicer/inflow", singleClass = true) - } - - testClass { - model("slicer/mpp", recursive = false, extension = null) - } - } - - testGroup("idea/scripting-support/test", "idea/scripting-support/testData") { - testClass { - model("scratch", extension = "kts", testMethod = "doScratchCompilingTest", testClassName = "ScratchCompiling", recursive = false) - model("scratch", extension = "kts", testMethod = "doScratchReplTest", testClassName = "ScratchRepl", recursive = false) - model("scratch/multiFile", extension = null, testMethod = "doScratchMultiFileTest", testClassName = "ScratchMultiFile", recursive = false) - - model("worksheet", extension = "ws.kts", testMethod = "doWorksheetCompilingTest", testClassName = "WorksheetCompiling", recursive = false) - model("worksheet", extension = "ws.kts", testMethod = "doWorksheetReplTest", testClassName = "WorksheetRepl", recursive = false) - model("worksheet/multiFile", extension = null, testMethod = "doWorksheetMultiFileTest", testClassName = "WorksheetMultiFile", recursive = false) - - model("scratch/rightPanelOutput", extension = "kts", testMethod = "doRightPreviewPanelOutputTest", testClassName = "ScratchRightPanelOutput", recursive = false) - } - - testClass { - model("scratch/lineMarker", testMethod = "doScratchTest", pattern = KT_OR_KTS) - } - - } - - /* - // Maven and Gradle are not relevant for AS branch - - testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { - testClass { - model("configurator/jvm", extension = null, recursive = false, testMethod = "doTestWithMaven") - model("configurator/js", extension = null, recursive = false, testMethod = "doTestWithJSMaven") - } - - testClass { - model("maven-inspections", pattern = "^([\\w\\-]+).xml$", singleClass = true) - } - } - - testGroup("idea/idea-gradle/tests", "idea/testData") { - testClass { - model("configuration/gradle", extension = null, recursive = false, testMethod = "doTestGradle") - model("configuration/gsk", extension = null, recursive = false, testMethod = "doTestGradle") - } - } + testClass { + model("handlers/smart") + } + testClass { + model("handlers/keywords") + } + + testClass { + model("handlers/charFilter") + } + + testClass { + model("basic/multifile", extension = null, recursive = false) + } + + testClass { + model("smartMultiFile", extension = null, recursive = false) + } + + testClass("KDocCompletionTestGenerated") { + model("kdoc") + } + + testClass { + model("basic/java8") + } + + testClass { + model("incrementalResolve") + } + + testClass { + model("multiPlatform", recursive = false, extension = null) + } + } + + //TODO: move these tests into idea-completion module + testGroup("idea/tests", "idea/idea-completion/testData") { + testClass { + model("handlers/runtimeCast") + } + + testClass { + model("basic/codeFragments", extension = "kt") + } + } + + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("fileOrElement", extension = "java") + } + } + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("multiFile", extension = null, recursive = false) + } + } + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("fileOrElement", extension = "java") + } + } + + testGroup("nj2k/tests", "nj2k/testData") { + testClass { + model("newJ2k", pattern = """^([^\.]+)\.java$""") + } + testClass { + model("inference/common") + } + testClass { + model("inference/nullability") + } + testClass { + model("inference/mutability") + } + testClass { + model("copyPaste", pattern = """^([^\.]+)\.java$""") + } + testClass { + model("copyPastePlainText", pattern = """^([^\.]+)\.txt$""") + } + testClass { + model("multiFile", extension = null, recursive = false) + } + } + + /* There is no jps in AS + .... */ + testGroup("compiler/incremental-compilation-impl/test", "jps-plugin/testData") { + testClass { + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/classHierarchyAffected", extension = null, recursive = false) + model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true) + model("incremental/withJava", extension = null, excludeParentDirs = true) + model("incremental/incrementalJvmCompilerOnly", extension = null, excludeParentDirs = true) + } - testGroup("idea/tests", "compiler/testData") { - testClass { - model("loadJava/compiledKotlin") + testClass { + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/classHierarchyAffected", extension = null, recursive = false) + model("incremental/js", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/js/friendsModuleDisabled", extension = null, recursive = false) + } + + testClass { + model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) + } + testClass { + model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) + } } - testClass { - model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") + testGroup("plugins/android-extensions/android-extensions-compiler/test", "plugins/android-extensions/android-extensions-compiler/testData") { + testClass { + model("descriptors", recursive = false, extension = null) + } + + testClass { + model("codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest") + model("codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke") + } + + testClass { + model("codegen/bytecodeShape", recursive = false, extension = null) + } + + testClass { + model("parcel/codegen") + } } - testClass { - model("asJava/lightClasses", excludeDirs = listOf("delegation", "script"), pattern = KT_WITHOUT_DOTS_IN_NAME) + testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { + testClass { + model("converter") + } + + testClass { + model("kotlinRunner") + } } - testClass { - model("asJava/script/ide", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + testGroup("plugins/kapt3/kapt3-cli/test", "plugins/kapt3/kapt3-cli/testData") { + testClass { + model("argumentParsing", extension = "txt") + } + + testClass { + model("integration", recursive = false, extension = null) + } } - testClass { - model("asJava/lightClasses", excludeDirs = listOf("local", "compilationErrors", "ideRegression"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + testGroup("plugins/allopen/allopen-cli/test", "plugins/allopen/allopen-cli/testData") { + testClass { + model("bytecodeListing", extension = "kt") + } } + + testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") { + testClass { + model("bytecodeListing", extension = "kt") + } + + testClass { + model("box", targetBackend = TargetBackend.JVM) + } + } + + testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") { + testClass { + model("diagnostics") + } + testClass { + model("script", extension = "kts") + } + } + + testGroup( + "plugins/kotlin-serialization/kotlin-serialization-compiler/test", + "plugins/kotlin-serialization/kotlin-serialization-compiler/testData" + ) { + testClass { + model("diagnostics") + } + + testClass { + model("codegen") + } + + testClass { + model("codegen") + } + } + /* + testGroup("plugins/android-extensions/android-extensions-idea/tests", "plugins/android-extensions/android-extensions-idea/testData") { + testClass { + model("android/completion", recursive = false, extension = null) + } + + testClass { + model("android/goto", recursive = false, extension = null) + } + + testClass { + model("android/rename", recursive = false, extension = null) + } + + testClass { + model("android/renameLayout", recursive = false, extension = null) + } + + testClass { + model("android/findUsages", recursive = false, extension = null) + } + + testClass { + model("android/usageHighlighting", recursive = false, extension = null) + } + + testClass { + model("android/extraction", recursive = false, extension = null) + } + + testClass { + model("android/parcel/checker", excludeParentDirs = true) + } + + testClass { + model("android/parcel/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + } + + testGroup("idea/idea-android/tests", "idea/testData") { + testClass { + model("configuration/android-gradle", pattern = """(\w+)_before\.gradle$""", testMethod = "doTestAndroidGradle") + model("configuration/android-gsk", pattern = """(\w+)_before\.gradle.kts$""", testMethod = "doTestAndroidGradle") + } + + testClass { + model("android/intention", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("android/resourceIntention", extension = "test", singleClass = true) + } + + testClass { + model("android/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + + testClass { + model("android/lint", excludeParentDirs = true) + } + + testClass { + model("android/lintQuickfix", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("android/folding") + } + + testClass { + model("android/gutterIcon") + } + } + */ } - - testGroup("idea/idea-completion/tests", "idea/idea-completion/testData") { - testClass { - model("injava", extension = "java", recursive = false) - } - - testClass { - model("injava", extension = "java", recursive = false) - } - - testClass { - model("injava/stdlib", extension = "java", recursive = false) - } - - testClass { - model("weighers/basic", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("weighers/smart", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("basic/common") - model("basic/js") - } - - testClass { - model("basic/common") - model("basic/java") - } - - testClass { - model("smart") - } - - testClass { - model("keywords", recursive = false) - } - - testClass { - model("basic/withLib", recursive = false) - } - - testClass { - model("handlers/basic", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("handlers/smart") - } - - testClass { - model("handlers/keywords") - } - - testClass { - model("handlers/charFilter") - } - - testClass { - model("basic/multifile", extension = null, recursive = false) - } - - testClass { - model("smartMultiFile", extension = null, recursive = false) - } - - testClass("KDocCompletionTestGenerated") { - model("kdoc") - } - - testClass { - model("basic/java8") - } - - testClass { - model("incrementalResolve") - } - - testClass { - model("multiPlatform", recursive = false, extension = null) - } - } - - //TODO: move these tests into idea-completion module - testGroup("idea/tests", "idea/idea-completion/testData") { - testClass { - model("handlers/runtimeCast") - } - - testClass { - model("basic/codeFragments", extension = "kt") - } - } - - testGroup("j2k/tests", "j2k/testData") { - testClass { - model("fileOrElement", extension = "java") - } - } - testGroup("j2k/tests", "j2k/testData") { - testClass { - model("multiFile", extension = null, recursive = false) - } - } - testGroup("j2k/tests", "j2k/testData") { - testClass { - model("fileOrElement", extension = "java") - } - } - - testGroup("nj2k/tests", "nj2k/testData") { - testClass { - model("newJ2k", pattern = """^([^\.]+)\.java$""") - } - testClass { - model("inference/common") - } - testClass { - model("inference/nullability") - } - testClass { - model("inference/mutability") - } - testClass { - model("copyPaste", pattern = """^([^\.]+)\.java$""") - } - testClass { - model("copyPastePlainText", pattern = """^([^\.]+)\.txt$""") - } - testClass { - model("multiFile", extension = null, recursive = false) - } - } - -/* There is no jps in AS - .... -*/ - testGroup("compiler/incremental-compilation-impl/test", "jps-plugin/testData") { - testClass { - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/classHierarchyAffected", extension = null, recursive = false) - model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true) - model("incremental/withJava", extension = null, excludeParentDirs = true) - model("incremental/incrementalJvmCompilerOnly", extension = null, excludeParentDirs = true) - } - - testClass { - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/classHierarchyAffected", extension = null, recursive = false) - model("incremental/js", extension = null, excludeParentDirs = true) - } - - testClass { - model("incremental/js/friendsModuleDisabled", extension = null, recursive = false) - } - - testClass { - model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) - } - testClass { - model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) - } - } - - testGroup("plugins/android-extensions/android-extensions-compiler/test", "plugins/android-extensions/android-extensions-compiler/testData") { - testClass { - model("descriptors", recursive = false, extension = null) - } - - testClass { - model("codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest") - model("codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke") - } - - testClass { - model("codegen/bytecodeShape", recursive = false, extension = null) - } - - testClass { - model("parcel/codegen") - } - } - - testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { - testClass { - model("converter") - } - - testClass { - model("kotlinRunner") - } - } - - testGroup("plugins/kapt3/kapt3-cli/test", "plugins/kapt3/kapt3-cli/testData") { - testClass { - model("argumentParsing", extension = "txt") - } - - testClass { - model("integration", recursive = false, extension = null) - } - } - - testGroup("plugins/allopen/allopen-cli/test", "plugins/allopen/allopen-cli/testData") { - testClass { - model("bytecodeListing", extension = "kt") - } - } - - testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") { - testClass { - model("bytecodeListing", extension = "kt") - } - - testClass { - model("box", targetBackend = TargetBackend.JVM) - } - } - - testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") { - testClass { - model("diagnostics") - } - testClass { - model("script", extension = "kts") - } - } - - testGroup( - "plugins/kotlin-serialization/kotlin-serialization-compiler/test", - "plugins/kotlin-serialization/kotlin-serialization-compiler/testData" - ) { - testClass { - model("diagnostics") - } - - testClass { - model("codegen") - } - - testClass { - model("codegen") - } - } -/* - testGroup("plugins/android-extensions/android-extensions-idea/tests", "plugins/android-extensions/android-extensions-idea/testData") { - testClass { - model("android/completion", recursive = false, extension = null) - } - - testClass { - model("android/goto", recursive = false, extension = null) - } - - testClass { - model("android/rename", recursive = false, extension = null) - } - - testClass { - model("android/renameLayout", recursive = false, extension = null) - } - - testClass { - model("android/findUsages", recursive = false, extension = null) - } - - testClass { - model("android/usageHighlighting", recursive = false, extension = null) - } - - testClass { - model("android/extraction", recursive = false, extension = null) - } - - testClass { - model("android/parcel/checker", excludeParentDirs = true) - } - - testClass { - model("android/parcel/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } - } - - testGroup("idea/idea-android/tests", "idea/testData") { - testClass { - model("configuration/android-gradle", pattern = """(\w+)_before\.gradle$""", testMethod = "doTestAndroidGradle") - model("configuration/android-gsk", pattern = """(\w+)_before\.gradle.kts$""", testMethod = "doTestAndroidGradle") - } - - testClass { - model("android/intention", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("android/resourceIntention", extension = "test", singleClass = true) - } - - testClass { - model("android/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } - - testClass { - model("android/lint", excludeParentDirs = true) - } - - testClass { - model("android/lintQuickfix", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("android/folding") - } - - testClass { - model("android/gutterIcon") - } - } -*/ } diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as40 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as40 index 0bd2c00c83f..8318d94daa5 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as40 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as40 @@ -31,7 +31,7 @@ import org.jetbrains.kotlin.formatter.AbstractFormatterTest import org.jetbrains.kotlin.formatter.AbstractTypingIndentationTestBase import org.jetbrains.kotlin.generators.tests.generator.TestGroup import org.jetbrains.kotlin.generators.tests.generator.muteExtraSuffix -import org.jetbrains.kotlin.generators.tests.generator.testGroup +import org.jetbrains.kotlin.generators.tests.generator.testGroupSuite import org.jetbrains.kotlin.generators.util.KT_OR_KTS import org.jetbrains.kotlin.generators.util.KT_OR_KTS_WITHOUT_DOTS_IN_NAME import org.jetbrains.kotlin.generators.util.KT_WITHOUT_DOTS_IN_NAME @@ -162,1062 +162,1064 @@ import org.jetbrains.kotlinx.serialization.AbstractSerializationPluginBytecodeLi import org.jetbrains.kotlinx.serialization.AbstractSerializationPluginDiagnosticTest import org.jetbrains.kotlinx.serialization.AbstractSerializationIrBytecodeListingTest -fun main() { +fun main(args: Array) { System.setProperty("java.awt.headless", "true") - testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { - testClass { - model( - "stepping/stepIntoAndSmartStepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doStepIntoTest", - testClassName = "StepInto" - ) - model( - "stepping/stepIntoAndSmartStepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doSmartStepIntoTest", - testClassName = "SmartStepInto" - ) - model( - "stepping/stepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doStepIntoTest", - testClassName = "StepIntoOnly" - ) - model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") - model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") - model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") - model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") + testGroupSuite(args) { + testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { + testClass { + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepInto" + ) + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doSmartStepIntoTest", + testClassName = "SmartStepInto" + ) + model( + "stepping/stepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepIntoOnly" + ) + model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") + model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") + model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") + model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") + } + + testClass { + model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") + model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") + } + + testClass { + model("selectExpression", recursive = false) + model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") + } + + testClass { + model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") + model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") + } + + testClass { + model("smartStepInto") + } + + testClass { + model("breakpointApplicability") + } + + testClass { + model("fileRanking") + } + + testClass { + model("asyncStackTrace") + } + + testClass { + // TODO: implement mapping logic for terminal operations + model("sequence/streams/sequence", excludeDirs = listOf("terminal")) + } + } + + testGroup("idea/tests", "idea/testData") { + testClass { + model("resolve/additionalLazyResolve") + } + + testClass { + model("resolve/partialBodyResolve") + } + + testClass { + model("checker", recursive = false) + model("checker/regression") + model("checker/recovery") + model("checker/rendering") + model("checker/scripts", extension = "kts") + model("checker/duplicateJvmSignature") + model("checker/infos", testMethod = "doTestWithInfos") + model("checker/diagnosticsMessage") + } + + testClass { + model("kotlinAndJavaChecker/javaAgainstKotlin") + model("kotlinAndJavaChecker/javaWithKotlin") + } + + testClass { + model("kotlinAndJavaChecker/javaAgainstKotlin") + } + + testClass { + model("unifier") + } + + testClass { + model("checker/codeFragments", extension = "kt", recursive = false) + model("checker/codeFragments/imports", testMethod = "doTestWithImport", extension = "kt") + } + + testClass { + model("quickfix.special/codeFragmentAutoImport", extension = "kt", recursive = false) + } + + testClass { + model("checker/js") + } + + testClass { + model("quickfix", pattern = "^([\\w\\-_]+)\\.kt$", filenameStartsLowerCase = true) + } + + testClass { + model("navigation/gotoSuper", extension = "test", recursive = false) + } + + testClass { + model("navigation/gotoTypeDeclaration", extension = "test") + } + + testClass { + model("navigation/gotoDeclaration", extension = "test") + } + + testClass { + model( + "parameterInfo", + pattern = "^([\\w\\-_]+)\\.kt$", recursive = true, + excludeDirs = listOf("withLib1/sharedLib", "withLib2/sharedLib", "withLib3/sharedLib") + ) + } + + testClass { + model("navigation/gotoClass", testMethod = "doClassTest") + model("navigation/gotoSymbol", testMethod = "doSymbolTest") + } + + testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { + model("decompiler/navigation/usercode") + } + + testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { + model("decompiler/navigation/userJavaCode", pattern = "^(.+)\\.java$") + } + + testClass(annotations = listOf(muteExtraSuffix(".libsrcjs"))) { + model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") + } + + testClass { + model("decompiler/navigation/usercode") + } + + testClass { + model("navigation/implementations", recursive = false) + } + + testClass { + model("navigation/gotoTestOrCode", pattern = "^(.+)\\.main\\..+\$") + } + + testClass { + model("search/inheritance") + } + + testClass { + model("search/annotations") + } + + testClass { + model("quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + + testClass { + model("typealiasExpansionIndex") + } + + testClass { + model("highlighter") + } + + testClass { + model("dslHighlighter") + } + + testClass { + model("usageHighlighter") + } + + testClass { + model("folding/noCollapse") + model("folding/checkCollapse", testMethod = "doSettingsFoldingTest") + } + + testClass { + model("codeInsight/surroundWith/if", testMethod = "doTestWithIfSurrounder") + model("codeInsight/surroundWith/ifElse", testMethod = "doTestWithIfElseSurrounder") + model("codeInsight/surroundWith/ifElseExpression", testMethod = "doTestWithIfElseExpressionSurrounder") + model("codeInsight/surroundWith/ifElseExpressionBraces", testMethod = "doTestWithIfElseExpressionBracesSurrounder") + model("codeInsight/surroundWith/not", testMethod = "doTestWithNotSurrounder") + model("codeInsight/surroundWith/parentheses", testMethod = "doTestWithParenthesesSurrounder") + model("codeInsight/surroundWith/stringTemplate", testMethod = "doTestWithStringTemplateSurrounder") + model("codeInsight/surroundWith/when", testMethod = "doTestWithWhenSurrounder") + model("codeInsight/surroundWith/tryCatch", testMethod = "doTestWithTryCatchSurrounder") + model("codeInsight/surroundWith/tryCatchExpression", testMethod = "doTestWithTryCatchExpressionSurrounder") + model("codeInsight/surroundWith/tryCatchFinally", testMethod = "doTestWithTryCatchFinallySurrounder") + model("codeInsight/surroundWith/tryCatchFinallyExpression", testMethod = "doTestWithTryCatchFinallyExpressionSurrounder") + model("codeInsight/surroundWith/tryFinally", testMethod = "doTestWithTryFinallySurrounder") + model("codeInsight/surroundWith/functionLiteral", testMethod = "doTestWithFunctionLiteralSurrounder") + model("codeInsight/surroundWith/withIfExpression", testMethod = "doTestWithSurroundWithIfExpression") + model("codeInsight/surroundWith/withIfElseExpression", testMethod = "doTestWithSurroundWithIfElseExpression") + } + + testClass { + model("joinLines") + } + + testClass { + model("codeInsight/breadcrumbs") + } + + testClass { + model("intentions", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") + } + + testClass { + model("intentions/loopToCallChain", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("concatenatedStringGenerator", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("intentions", pattern = "^(inspections\\.test)$", singleClass = true) + model("inspections", pattern = "^(inspections\\.test)$", singleClass = true) + model("inspectionsLocal", pattern = "^(inspections\\.test)$", singleClass = true) + } + + testClass { + model("inspectionsLocal", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") + } + + testClass { + model("hierarchy/class/type", extension = null, recursive = false, testMethod = "doTypeClassHierarchyTest") + model("hierarchy/class/super", extension = null, recursive = false, testMethod = "doSuperClassHierarchyTest") + model("hierarchy/class/sub", extension = null, recursive = false, testMethod = "doSubClassHierarchyTest") + model("hierarchy/calls/callers", extension = null, recursive = false, testMethod = "doCallerHierarchyTest") + model("hierarchy/calls/callersJava", extension = null, recursive = false, testMethod = "doCallerJavaHierarchyTest") + model("hierarchy/calls/callees", extension = null, recursive = false, testMethod = "doCalleeHierarchyTest") + model("hierarchy/overrides", extension = null, recursive = false, testMethod = "doOverrideHierarchyTest") + } + + testClass { + model("hierarchy/withLib", extension = null, recursive = false) + } + + testClass { + model("codeInsight/moveUpDown/classBodyDeclarations", pattern = KT_OR_KTS, testMethod = "doTestClassBodyDeclaration") + model("codeInsight/moveUpDown/closingBraces", testMethod = "doTestExpression") + model("codeInsight/moveUpDown/expressions", pattern = KT_OR_KTS, testMethod = "doTestExpression") + model("codeInsight/moveUpDown/parametersAndArguments", testMethod = "doTestExpression") + model("codeInsight/moveUpDown/trailingComma", testMethod = "doTestExpressionWithTrailingComma") + } + + testClass { + model("codeInsight/moveLeftRight") + } + + testClass { + model("refactoring/inline", pattern = "^(\\w+)\\.kt$") + } + + testClass { + model("codeInsight/unwrapAndRemove/removeExpression", testMethod = "doTestExpressionRemover") + model("codeInsight/unwrapAndRemove/unwrapThen", testMethod = "doTestThenUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapElse", testMethod = "doTestElseUnwrapper") + model("codeInsight/unwrapAndRemove/removeElse", testMethod = "doTestElseRemover") + model("codeInsight/unwrapAndRemove/unwrapLoop", testMethod = "doTestLoopUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapTry", testMethod = "doTestTryUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapCatch", testMethod = "doTestCatchUnwrapper") + model("codeInsight/unwrapAndRemove/removeCatch", testMethod = "doTestCatchRemover") + model("codeInsight/unwrapAndRemove/unwrapFinally", testMethod = "doTestFinallyUnwrapper") + model("codeInsight/unwrapAndRemove/removeFinally", testMethod = "doTestFinallyRemover") + model("codeInsight/unwrapAndRemove/unwrapLambda", testMethod = "doTestLambdaUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapFunctionParameter", testMethod = "doTestFunctionParameterUnwrapper") + } + + testClass { + model("codeInsight/expressionType") + } + + testClass { + model("editor/backspaceHandler") + } + + testClass { + model("editor/enterHandler/multilineString") + } + + testClass { + model("editor/quickDoc", pattern = """^([^_]+)\.(kt|java)$""") + } + + testClass { + model("refactoring/safeDelete/deleteClass/kotlinClass", testMethod = "doClassTest") + model("refactoring/safeDelete/deleteClass/kotlinClassWithJava", testMethod = "doClassTestWithJava") + model("refactoring/safeDelete/deleteClass/javaClassWithKotlin", extension = "java", testMethod = "doJavaClassTest") + model("refactoring/safeDelete/deleteObject/kotlinObject", testMethod = "doObjectTest") + model("refactoring/safeDelete/deleteFunction/kotlinFunction", testMethod = "doFunctionTest") + model("refactoring/safeDelete/deleteFunction/kotlinFunctionWithJava", testMethod = "doFunctionTestWithJava") + model("refactoring/safeDelete/deleteFunction/javaFunctionWithKotlin", testMethod = "doJavaMethodTest") + model("refactoring/safeDelete/deleteProperty/kotlinProperty", testMethod = "doPropertyTest") + model("refactoring/safeDelete/deleteProperty/kotlinPropertyWithJava", testMethod = "doPropertyTestWithJava") + model("refactoring/safeDelete/deleteProperty/javaPropertyWithKotlin", testMethod = "doJavaPropertyTest") + model("refactoring/safeDelete/deleteTypeAlias/kotlinTypeAlias", testMethod = "doTypeAliasTest") + model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameter", testMethod = "doTypeParameterTest") + model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameterWithJava", testMethod = "doTypeParameterTestWithJava") + model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameter", testMethod = "doValueParameterTest") + model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameterWithJava", testMethod = "doValueParameterTestWithJava") + } + + testClass { + model("resolve/references", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("resolve/referenceInJava/binaryAndSource", extension = "java") + model("resolve/referenceInJava/sourceOnly", extension = "java") + } + + testClass { + model("resolve/referenceInJava/binaryAndSource", extension = "java") + } + + testClass { + model("resolve/referenceWithLib", recursive = false) + } + + testClass { + model("resolve/referenceInLib", recursive = false) + } + + testClass { + model("resolve/referenceToJavaWithWrongFileStructure", recursive = false) + } + + testClass { + model("findUsages/kotlin", pattern = """^(.+)\.0\.(kt|kts)$""") + model("findUsages/java", pattern = """^(.+)\.0\.java$""") + model("findUsages/propertyFiles", pattern = """^(.+)\.0\.properties$""") + } + + testClass { + model("findUsages/libraryUsages", pattern = """^(.+)\.0\.kt$""") + } + + testClass { + model("refactoring/move", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/copy", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/moveMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/copyMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/safeDeleteMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("multiFileIntentions", extension = "test", singleClass = true, filenameStartsLowerCase = true) + } + + testClass { + model("multiFileLocalInspections", extension = "test", singleClass = true, filenameStartsLowerCase = true) + } + + testClass { + model("multiFileInspections", extension = "test", singleClass = true) + } + + testClass { + model("formatter", pattern = """^([^\.]+)\.after\.kt.*$""") + model( + "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.kt.*$""", + testMethod = "doTestCallSite", testClassName = "FormatterCallSite" + ) + model( + "formatter", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", + testMethod = "doTestInverted", testClassName = "FormatterInverted" + ) + model( + "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.inv\.kt.*$""", + testMethod = "doTestInvertedCallSite", testClassName = "FormatterInvertedCallSite" + ) + } + + testClass { + model("indentationOnNewline", pattern = """^([^\.]+)\.after\.kt.*$""", testMethod = "doNewlineTest", + testClassName = "DirectSettings") + model("indentationOnNewline", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", testMethod = "doNewlineTestWithInvert", + testClassName = "InvertedSettings") + } + + testClass { + model("diagnosticMessage", recursive = false) + } + + testClass { + model("diagnosticMessage/js", recursive = false, targetBackend = TargetBackend.JS) + } + + testClass { + model("refactoring/rename", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/renameMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("codeInsight/outOfBlock", pattern = KT_OR_KTS) + } + + testClass { + model("dataFlowValueRendering") + } + + testClass { + model("copyPaste/conversion", pattern = """^([^\.]+)\.java$""") + } + + testClass { + model("copyPaste/plainTextConversion", pattern = """^([^\.]+)\.txt$""") + } + + testClass { + model("copyPaste/plainTextLiteral", pattern = """^([^\.]+)\.txt$""") + } + + testClass { + model("copyPaste/literal", pattern = """^([^\.]+)\.kt$""") + } + + testClass { + model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCopy", testClassName = "Copy", recursive = false) + model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCut", testClassName = "Cut", recursive = false) + } + + testClass { + model("copyPaste/moveDeclarations", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTest") + } + + testClass { + model("copyright", pattern = KT_OR_KTS, testMethod = "doTest") + } + + testClass { + model("exitPoints") + } + + testClass { + model("codeInsight/lineMarker") + } + + testClass { + model("codeInsightInLibrary/lineMarker", testMethod = "doTestWithLibrary") + } + + testClass { + model("multiModuleLineMarker", extension = null, recursive = false) + } + + testClass { + model("shortenRefs", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + testClass { + model("addImport", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("smartSelection", testMethod = "doTestSmartSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("structureView/fileStructure", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("expressionSelection", testMethod = "doTestExpressionSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("decompiler/decompiledText", pattern = """^([^\.]+)$""") + } + + testClass { + model("decompiler/decompiledTextJvm", pattern = """^([^\.]+)$""") + } + + testClass { + model("decompiler/decompiledText", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) + } + + testClass { + model("decompiler/decompiledTextJs", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) + } + + testClass { + model("decompiler/stubBuilder", extension = null, recursive = false) + } + + testClass { + model("editor/optimizeImports/jvm", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + testClass { + model("editor/optimizeImports/js", pattern = KT_WITHOUT_DOTS_IN_NAME) + model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) + } + + testClass { + model("stubs", extension = "kt") + } + + testClass { + model("multiFileHighlighting", recursive = false) + } + + testClass { + model("multiModuleHighlighting/multiplatform/", recursive = false, extension = null) + } + + testClass { + model("multiModuleHighlighting/hierarchicalExpectActualMatching/", recursive = false, extension = null) + } + + testClass { + model("multiModuleQuickFix", extension = null, deep = 1) + } + + testClass { + model("navigation/implementations/multiModule", recursive = false, extension = null) + } + + testClass { + model("navigation/relatedSymbols/multiModule", recursive = false, extension = null) + } + + testClass { + model("navigation/gotoSuper/multiModule", recursive = false, extension = null) + } + + testClass { + model("refactoring/introduceVariable", pattern = KT_OR_KTS, testMethod = "doIntroduceVariableTest") + model("refactoring/extractFunction", pattern = KT_OR_KTS, testMethod = "doExtractFunctionTest") + model("refactoring/introduceProperty", pattern = KT_OR_KTS, testMethod = "doIntroducePropertyTest") + model("refactoring/introduceParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceSimpleParameterTest") + model("refactoring/introduceLambdaParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceLambdaParameterTest") + model("refactoring/introduceJavaParameter", extension = "java", testMethod = "doIntroduceJavaParameterTest") + model("refactoring/introduceTypeParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeParameterTest") + model("refactoring/introduceTypeAlias", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeAliasTest") + model("refactoring/extractSuperclass", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractSuperclassTest") + model("refactoring/extractInterface", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractInterfaceTest") + } + + testClass { + model("refactoring/pullUp/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") + model("refactoring/pullUp/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") + model("refactoring/pullUp/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") + } + + testClass { + model("refactoring/pushDown/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") + model("refactoring/pushDown/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") + model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") + } + + testClass { + model("coverage/outputFiles") + } + + testClass { + model("internal/toolWindow", recursive = false, extension = null) + } + + testClass("org.jetbrains.kotlin.idea.kdoc.KdocResolveTestGenerated") { + model("kdoc/resolve") + } + + testClass { + model("kdoc/highlighting") + } + + testClass { + model("kdoc/typing") + } + + testClass { + model("codeInsight/generate/testFrameworkSupport") + } + + testClass { + model("codeInsight/generate/equalsWithHashCode") + } + + testClass { + model("codeInsight/generate/secondaryConstructors") + } + + testClass { + model("codeInsight/generate/toString") + } + + testClass { + model("repl/completion") + } + + testClass { + model("codeInsight/postfix") + } + + testClass { + model("script/definition/highlighting", extension = null, recursive = false) + model("script/definition/complex", extension = null, recursive = false, testMethod = "doComplexTest") + } + + testClass { + model("script/definition/navigation", extension = null, recursive = false) + } + + testClass { + model("script/definition/completion", extension = null, recursive = false) + } + + testClass { + model("script/definition/order", extension = null, recursive = false) + } + + testClass { + model("refactoring/nameSuggestionProvider") + } + + testClass { + model("slicer", excludeDirs = listOf("mpp")) + } + + testClass { + model("slicer/inflow", singleClass = true) + } + + testClass { + model("slicer/inflow", singleClass = true) + } + + testClass { + model("slicer/mpp", recursive = false, extension = null) + } } - testClass { - model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") - model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") - } - - testClass { - model("selectExpression", recursive = false) - model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") - } - - testClass { - model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") - model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") - } - - testClass { - model("smartStepInto") - } - - testClass { - model("breakpointApplicability") - } - - testClass { - model("fileRanking") - } - - testClass { - model("asyncStackTrace") - } - - testClass { - // TODO: implement mapping logic for terminal operations - model("sequence/streams/sequence", excludeDirs = listOf("terminal")) - } - } - - testGroup("idea/tests", "idea/testData") { - testClass { - model("resolve/additionalLazyResolve") - } - - testClass { - model("resolve/partialBodyResolve") - } - - testClass { - model("checker", recursive = false) - model("checker/regression") - model("checker/recovery") - model("checker/rendering") - model("checker/scripts", extension = "kts") - model("checker/duplicateJvmSignature") - model("checker/infos", testMethod = "doTestWithInfos") - model("checker/diagnosticsMessage") - } - - testClass { - model("kotlinAndJavaChecker/javaAgainstKotlin") - model("kotlinAndJavaChecker/javaWithKotlin") - } - - testClass { - model("kotlinAndJavaChecker/javaAgainstKotlin") - } - - testClass { - model("unifier") - } - - testClass { - model("checker/codeFragments", extension = "kt", recursive = false) - model("checker/codeFragments/imports", testMethod = "doTestWithImport", extension = "kt") - } - - testClass { - model("quickfix.special/codeFragmentAutoImport", extension = "kt", recursive = false) - } - - testClass { - model("checker/js") - } - - testClass { - model("quickfix", pattern = "^([\\w\\-_]+)\\.kt$", filenameStartsLowerCase = true) - } - - testClass { - model("navigation/gotoSuper", extension = "test", recursive = false) - } - - testClass { - model("navigation/gotoTypeDeclaration", extension = "test") - } - - testClass { - model("navigation/gotoDeclaration", extension = "test") - } - - testClass { - model( - "parameterInfo", - pattern = "^([\\w\\-_]+)\\.kt$", recursive = true, - excludeDirs = listOf("withLib1/sharedLib", "withLib2/sharedLib", "withLib3/sharedLib") - ) - } - - testClass { - model("navigation/gotoClass", testMethod = "doClassTest") - model("navigation/gotoSymbol", testMethod = "doSymbolTest") - } - - testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { - model("decompiler/navigation/usercode") - } - - testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { - model("decompiler/navigation/userJavaCode", pattern = "^(.+)\\.java$") - } - - testClass(annotations = listOf(muteExtraSuffix(".libsrcjs"))) { - model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") - } - - testClass { - model("decompiler/navigation/usercode") - } - - testClass { - model("navigation/implementations", recursive = false) - } - - testClass { - model("navigation/gotoTestOrCode", pattern = "^(.+)\\.main\\..+\$") - } - - testClass { - model("search/inheritance") - } - - testClass { - model("search/annotations") - } - - testClass { - model("quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } - - testClass { - model("typealiasExpansionIndex") - } - - testClass { - model("highlighter") - } - - testClass { - model("dslHighlighter") - } - - testClass { - model("usageHighlighter") - } - - testClass { - model("folding/noCollapse") - model("folding/checkCollapse", testMethod = "doSettingsFoldingTest") - } - - testClass { - model("codeInsight/surroundWith/if", testMethod = "doTestWithIfSurrounder") - model("codeInsight/surroundWith/ifElse", testMethod = "doTestWithIfElseSurrounder") - model("codeInsight/surroundWith/ifElseExpression", testMethod = "doTestWithIfElseExpressionSurrounder") - model("codeInsight/surroundWith/ifElseExpressionBraces", testMethod = "doTestWithIfElseExpressionBracesSurrounder") - model("codeInsight/surroundWith/not", testMethod = "doTestWithNotSurrounder") - model("codeInsight/surroundWith/parentheses", testMethod = "doTestWithParenthesesSurrounder") - model("codeInsight/surroundWith/stringTemplate", testMethod = "doTestWithStringTemplateSurrounder") - model("codeInsight/surroundWith/when", testMethod = "doTestWithWhenSurrounder") - model("codeInsight/surroundWith/tryCatch", testMethod = "doTestWithTryCatchSurrounder") - model("codeInsight/surroundWith/tryCatchExpression", testMethod = "doTestWithTryCatchExpressionSurrounder") - model("codeInsight/surroundWith/tryCatchFinally", testMethod = "doTestWithTryCatchFinallySurrounder") - model("codeInsight/surroundWith/tryCatchFinallyExpression", testMethod = "doTestWithTryCatchFinallyExpressionSurrounder") - model("codeInsight/surroundWith/tryFinally", testMethod = "doTestWithTryFinallySurrounder") - model("codeInsight/surroundWith/functionLiteral", testMethod = "doTestWithFunctionLiteralSurrounder") - model("codeInsight/surroundWith/withIfExpression", testMethod = "doTestWithSurroundWithIfExpression") - model("codeInsight/surroundWith/withIfElseExpression", testMethod = "doTestWithSurroundWithIfElseExpression") - } - - testClass { - model("joinLines") - } - - testClass { - model("codeInsight/breadcrumbs") - } - - testClass { - model("intentions", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") - } - - testClass { - model("intentions/loopToCallChain", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("concatenatedStringGenerator", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("intentions", pattern = "^(inspections\\.test)$", singleClass = true) - model("inspections", pattern = "^(inspections\\.test)$", singleClass = true) - model("inspectionsLocal", pattern = "^(inspections\\.test)$", singleClass = true) - } - - testClass { - model("inspectionsLocal", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") - } - - testClass { - model("hierarchy/class/type", extension = null, recursive = false, testMethod = "doTypeClassHierarchyTest") - model("hierarchy/class/super", extension = null, recursive = false, testMethod = "doSuperClassHierarchyTest") - model("hierarchy/class/sub", extension = null, recursive = false, testMethod = "doSubClassHierarchyTest") - model("hierarchy/calls/callers", extension = null, recursive = false, testMethod = "doCallerHierarchyTest") - model("hierarchy/calls/callersJava", extension = null, recursive = false, testMethod = "doCallerJavaHierarchyTest") - model("hierarchy/calls/callees", extension = null, recursive = false, testMethod = "doCalleeHierarchyTest") - model("hierarchy/overrides", extension = null, recursive = false, testMethod = "doOverrideHierarchyTest") - } - - testClass { - model("hierarchy/withLib", extension = null, recursive = false) - } - - testClass { - model("codeInsight/moveUpDown/classBodyDeclarations", pattern = KT_OR_KTS, testMethod = "doTestClassBodyDeclaration") - model("codeInsight/moveUpDown/closingBraces", testMethod = "doTestExpression") - model("codeInsight/moveUpDown/expressions", pattern = KT_OR_KTS, testMethod = "doTestExpression") - model("codeInsight/moveUpDown/parametersAndArguments", testMethod = "doTestExpression") - model("codeInsight/moveUpDown/trailingComma", testMethod = "doTestExpressionWithTrailingComma") - } - - testClass { - model("codeInsight/moveLeftRight") - } - - testClass { - model("refactoring/inline", pattern = "^(\\w+)\\.kt$") - } - - testClass { - model("codeInsight/unwrapAndRemove/removeExpression", testMethod = "doTestExpressionRemover") - model("codeInsight/unwrapAndRemove/unwrapThen", testMethod = "doTestThenUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapElse", testMethod = "doTestElseUnwrapper") - model("codeInsight/unwrapAndRemove/removeElse", testMethod = "doTestElseRemover") - model("codeInsight/unwrapAndRemove/unwrapLoop", testMethod = "doTestLoopUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapTry", testMethod = "doTestTryUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapCatch", testMethod = "doTestCatchUnwrapper") - model("codeInsight/unwrapAndRemove/removeCatch", testMethod = "doTestCatchRemover") - model("codeInsight/unwrapAndRemove/unwrapFinally", testMethod = "doTestFinallyUnwrapper") - model("codeInsight/unwrapAndRemove/removeFinally", testMethod = "doTestFinallyRemover") - model("codeInsight/unwrapAndRemove/unwrapLambda", testMethod = "doTestLambdaUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapFunctionParameter", testMethod = "doTestFunctionParameterUnwrapper") - } - - testClass { - model("codeInsight/expressionType") - } - - testClass { - model("editor/backspaceHandler") - } - - testClass { - model("editor/enterHandler/multilineString") - } - - testClass { - model("editor/quickDoc", pattern = """^([^_]+)\.(kt|java)$""") - } - - testClass { - model("refactoring/safeDelete/deleteClass/kotlinClass", testMethod = "doClassTest") - model("refactoring/safeDelete/deleteClass/kotlinClassWithJava", testMethod = "doClassTestWithJava") - model("refactoring/safeDelete/deleteClass/javaClassWithKotlin", extension = "java", testMethod = "doJavaClassTest") - model("refactoring/safeDelete/deleteObject/kotlinObject", testMethod = "doObjectTest") - model("refactoring/safeDelete/deleteFunction/kotlinFunction", testMethod = "doFunctionTest") - model("refactoring/safeDelete/deleteFunction/kotlinFunctionWithJava", testMethod = "doFunctionTestWithJava") - model("refactoring/safeDelete/deleteFunction/javaFunctionWithKotlin", testMethod = "doJavaMethodTest") - model("refactoring/safeDelete/deleteProperty/kotlinProperty", testMethod = "doPropertyTest") - model("refactoring/safeDelete/deleteProperty/kotlinPropertyWithJava", testMethod = "doPropertyTestWithJava") - model("refactoring/safeDelete/deleteProperty/javaPropertyWithKotlin", testMethod = "doJavaPropertyTest") - model("refactoring/safeDelete/deleteTypeAlias/kotlinTypeAlias", testMethod = "doTypeAliasTest") - model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameter", testMethod = "doTypeParameterTest") - model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameterWithJava", testMethod = "doTypeParameterTestWithJava") - model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameter", testMethod = "doValueParameterTest") - model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameterWithJava", testMethod = "doValueParameterTestWithJava") - } - - testClass { - model("resolve/references", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("resolve/referenceInJava/binaryAndSource", extension = "java") - model("resolve/referenceInJava/sourceOnly", extension = "java") - } - - testClass { - model("resolve/referenceInJava/binaryAndSource", extension = "java") - } - - testClass { - model("resolve/referenceWithLib", recursive = false) - } - - testClass { - model("resolve/referenceInLib", recursive = false) - } - - testClass { - model("resolve/referenceToJavaWithWrongFileStructure", recursive = false) - } - - testClass { - model("findUsages/kotlin", pattern = """^(.+)\.0\.(kt|kts)$""") - model("findUsages/java", pattern = """^(.+)\.0\.java$""") - model("findUsages/propertyFiles", pattern = """^(.+)\.0\.properties$""") - } - - testClass { - model("findUsages/libraryUsages", pattern = """^(.+)\.0\.kt$""") - } + testGroup("idea/scripting-support/test", "idea/scripting-support/testData") { + testClass { + model("scratch", extension = "kts", testMethod = "doScratchCompilingTest", testClassName = "ScratchCompiling", recursive = false) + model("scratch", extension = "kts", testMethod = "doScratchReplTest", testClassName = "ScratchRepl", recursive = false) + model("scratch/multiFile", extension = null, testMethod = "doScratchMultiFileTest", testClassName = "ScratchMultiFile", recursive = false) - testClass { - model("refactoring/move", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/copy", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/moveMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/copyMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/safeDeleteMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("multiFileIntentions", extension = "test", singleClass = true, filenameStartsLowerCase = true) - } - - testClass { - model("multiFileLocalInspections", extension = "test", singleClass = true, filenameStartsLowerCase = true) - } - - testClass { - model("multiFileInspections", extension = "test", singleClass = true) - } - - testClass { - model("formatter", pattern = """^([^\.]+)\.after\.kt.*$""") - model( - "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.kt.*$""", - testMethod = "doTestCallSite", testClassName = "FormatterCallSite" - ) - model( - "formatter", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", - testMethod = "doTestInverted", testClassName = "FormatterInverted" - ) - model( - "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.inv\.kt.*$""", - testMethod = "doTestInvertedCallSite", testClassName = "FormatterInvertedCallSite" - ) - } - - testClass { - model("indentationOnNewline", pattern = """^([^\.]+)\.after\.kt.*$""", testMethod = "doNewlineTest", - testClassName = "DirectSettings") - model("indentationOnNewline", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", testMethod = "doNewlineTestWithInvert", - testClassName = "InvertedSettings") - } - - testClass { - model("diagnosticMessage", recursive = false) - } - - testClass { - model("diagnosticMessage/js", recursive = false, targetBackend = TargetBackend.JS) - } - - testClass { - model("refactoring/rename", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/renameMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("codeInsight/outOfBlock", pattern = KT_OR_KTS) - } - - testClass { - model("dataFlowValueRendering") - } - - testClass { - model("copyPaste/conversion", pattern = """^([^\.]+)\.java$""") - } - - testClass { - model("copyPaste/plainTextConversion", pattern = """^([^\.]+)\.txt$""") - } - - testClass { - model("copyPaste/plainTextLiteral", pattern = """^([^\.]+)\.txt$""") - } - - testClass { - model("copyPaste/literal", pattern = """^([^\.]+)\.kt$""") - } - - testClass { - model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCopy", testClassName = "Copy", recursive = false) - model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCut", testClassName = "Cut", recursive = false) - } - - testClass { - model("copyPaste/moveDeclarations", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTest") - } - - testClass { - model("copyright", pattern = KT_OR_KTS, testMethod = "doTest") - } + model("worksheet", extension = "ws.kts", testMethod = "doWorksheetCompilingTest", testClassName = "WorksheetCompiling", recursive = false) + model("worksheet", extension = "ws.kts", testMethod = "doWorksheetReplTest", testClassName = "WorksheetRepl", recursive = false) + model("worksheet/multiFile", extension = null, testMethod = "doWorksheetMultiFileTest", testClassName = "WorksheetMultiFile", recursive = false) - testClass { - model("exitPoints") - } + model("scratch/rightPanelOutput", extension = "kts", testMethod = "doRightPreviewPanelOutputTest", testClassName = "ScratchRightPanelOutput", recursive = false) + } - testClass { - model("codeInsight/lineMarker") + testClass { + model("scratch/lineMarker", testMethod = "doScratchTest", pattern = KT_OR_KTS) + } } - testClass { - model("codeInsightInLibrary/lineMarker", testMethod = "doTestWithLibrary") - } + /* + // Maven and Gradle are not relevant for AS branch - testClass { - model("multiModuleLineMarker", extension = null, recursive = false) - } + testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { + testClass { + model("configurator/jvm", extension = null, recursive = false, testMethod = "doTestWithMaven") + model("configurator/js", extension = null, recursive = false, testMethod = "doTestWithJSMaven") + } - testClass { - model("shortenRefs", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - testClass { - model("addImport", pattern = KT_WITHOUT_DOTS_IN_NAME) + testClass { + model("maven-inspections", pattern = "^([\\w\\-]+).xml$", singleClass = true) + } } - testClass { - model("smartSelection", testMethod = "doTestSmartSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) + testGroup("idea/idea-gradle/tests", "idea/testData") { + testClass { + model("configuration/gradle", extension = null, recursive = false, testMethod = "doTestGradle") + model("configuration/gsk", extension = null, recursive = false, testMethod = "doTestGradle") + } } - testClass { - model("structureView/fileStructure", pattern = KT_WITHOUT_DOTS_IN_NAME) - } + */ - testClass { - model("expressionSelection", testMethod = "doTestExpressionSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) - } + testGroup("idea/tests", "compiler/testData") { + testClass { + model("loadJava/compiledKotlin") + } - testClass { - model("decompiler/decompiledText", pattern = """^([^\.]+)$""") - } + testClass { + model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") + } - testClass { - model("decompiler/decompiledTextJvm", pattern = """^([^\.]+)$""") - } + testClass { + model("asJava/lightClasses", excludeDirs = listOf("delegation", "script"), pattern = KT_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("decompiler/decompiledText", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) - } + testClass { + model("asJava/script/ide", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("decompiler/decompiledTextJs", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) + testClass { + model("asJava/lightClasses", excludeDirs = listOf("local", "compilationErrors", "ideRegression"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } } - testClass { - model("decompiler/stubBuilder", extension = null, recursive = false) - } + testGroup("idea/idea-completion/tests", "idea/idea-completion/testData") { + testClass { + model("injava", extension = "java", recursive = false) + } - testClass { - model("editor/optimizeImports/jvm", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - testClass { - model("editor/optimizeImports/js", pattern = KT_WITHOUT_DOTS_IN_NAME) - model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) - } + testClass { + model("injava", extension = "java", recursive = false) + } - testClass { - model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) - } + testClass { + model("injava/stdlib", extension = "java", recursive = false) + } - testClass { - model("stubs", extension = "kt") - } + testClass { + model("weighers/basic", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("multiFileHighlighting", recursive = false) - } + testClass { + model("weighers/smart", pattern = KT_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("multiModuleHighlighting/multiplatform/", recursive = false, extension = null) - } + testClass { + model("basic/common") + model("basic/js") + } - testClass { - model("multiModuleHighlighting/hierarchicalExpectActualMatching/", recursive = false, extension = null) - } + testClass { + model("basic/common") + model("basic/java") + } + + testClass { + model("smart") + } - testClass { - model("multiModuleQuickFix", extension = null, deep = 1) - } + testClass { + model("keywords", recursive = false) + } + + testClass { + model("basic/withLib", recursive = false) + } - testClass { - model("navigation/implementations/multiModule", recursive = false, extension = null) - } - - testClass { - model("navigation/relatedSymbols/multiModule", recursive = false, extension = null) - } - - testClass { - model("navigation/gotoSuper/multiModule", recursive = false, extension = null) - } - - testClass { - model("refactoring/introduceVariable", pattern = KT_OR_KTS, testMethod = "doIntroduceVariableTest") - model("refactoring/extractFunction", pattern = KT_OR_KTS, testMethod = "doExtractFunctionTest") - model("refactoring/introduceProperty", pattern = KT_OR_KTS, testMethod = "doIntroducePropertyTest") - model("refactoring/introduceParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceSimpleParameterTest") - model("refactoring/introduceLambdaParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceLambdaParameterTest") - model("refactoring/introduceJavaParameter", extension = "java", testMethod = "doIntroduceJavaParameterTest") - model("refactoring/introduceTypeParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeParameterTest") - model("refactoring/introduceTypeAlias", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeAliasTest") - model("refactoring/extractSuperclass", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractSuperclassTest") - model("refactoring/extractInterface", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractInterfaceTest") - } - - testClass { - model("refactoring/pullUp/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") - model("refactoring/pullUp/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") - model("refactoring/pullUp/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") - } - - testClass { - model("refactoring/pushDown/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") - model("refactoring/pushDown/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") - model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") - } - - testClass { - model("coverage/outputFiles") - } - - testClass { - model("internal/toolWindow", recursive = false, extension = null) - } - - testClass("org.jetbrains.kotlin.idea.kdoc.KdocResolveTestGenerated") { - model("kdoc/resolve") - } - - testClass { - model("kdoc/highlighting") - } - - testClass { - model("kdoc/typing") - } - - testClass { - model("codeInsight/generate/testFrameworkSupport") - } - - testClass { - model("codeInsight/generate/equalsWithHashCode") - } - - testClass { - model("codeInsight/generate/secondaryConstructors") - } - - testClass { - model("codeInsight/generate/toString") - } - - testClass { - model("repl/completion") - } - - testClass { - model("codeInsight/postfix") - } - - testClass { - model("script/definition/highlighting", extension = null, recursive = false) - model("script/definition/complex", extension = null, recursive = false, testMethod = "doComplexTest") - } - - testClass { - model("script/definition/navigation", extension = null, recursive = false) - } - - testClass { - model("script/definition/completion", extension = null, recursive = false) - } - - testClass { - model("script/definition/order", extension = null, recursive = false) - } - - testClass { - model("refactoring/nameSuggestionProvider") - } - - testClass { - model("slicer", excludeDirs = listOf("mpp")) - } - - testClass { - model("slicer/inflow", singleClass = true) - } - - testClass { - model("slicer/inflow", singleClass = true) - } - - testClass { - model("slicer/mpp", recursive = false, extension = null) - } - } - - testGroup("idea/scripting-support/test", "idea/scripting-support/testData") { - testClass { - model("scratch", extension = "kts", testMethod = "doScratchCompilingTest", testClassName = "ScratchCompiling", recursive = false) - model("scratch", extension = "kts", testMethod = "doScratchReplTest", testClassName = "ScratchRepl", recursive = false) - model("scratch/multiFile", extension = null, testMethod = "doScratchMultiFileTest", testClassName = "ScratchMultiFile", recursive = false) - - model("worksheet", extension = "ws.kts", testMethod = "doWorksheetCompilingTest", testClassName = "WorksheetCompiling", recursive = false) - model("worksheet", extension = "ws.kts", testMethod = "doWorksheetReplTest", testClassName = "WorksheetRepl", recursive = false) - model("worksheet/multiFile", extension = null, testMethod = "doWorksheetMultiFileTest", testClassName = "WorksheetMultiFile", recursive = false) - - model("scratch/rightPanelOutput", extension = "kts", testMethod = "doRightPreviewPanelOutputTest", testClassName = "ScratchRightPanelOutput", recursive = false) - } - - testClass { - model("scratch/lineMarker", testMethod = "doScratchTest", pattern = KT_OR_KTS) - } - } - - /* - // Maven and Gradle are not relevant for AS branch - - testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { - testClass { - model("configurator/jvm", extension = null, recursive = false, testMethod = "doTestWithMaven") - model("configurator/js", extension = null, recursive = false, testMethod = "doTestWithJSMaven") - } - - testClass { - model("maven-inspections", pattern = "^([\\w\\-]+).xml$", singleClass = true) - } - } - - testGroup("idea/idea-gradle/tests", "idea/testData") { - testClass { - model("configuration/gradle", extension = null, recursive = false, testMethod = "doTestGradle") - model("configuration/gsk", extension = null, recursive = false, testMethod = "doTestGradle") - } - } + testClass { + model("handlers/basic", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + testClass { + model("handlers/smart") + } + + testClass { + model("handlers/keywords") + } + + testClass { + model("handlers/charFilter") + } + + testClass { + model("basic/multifile", extension = null, recursive = false) + } + + testClass { + model("smartMultiFile", extension = null, recursive = false) + } + + testClass("KDocCompletionTestGenerated") { + model("kdoc") + } + + testClass { + model("basic/java8") + } + + testClass { + model("incrementalResolve") + } + + testClass { + model("multiPlatform", recursive = false, extension = null) + } + } + + //TODO: move these tests into idea-completion module + testGroup("idea/tests", "idea/idea-completion/testData") { + testClass { + model("handlers/runtimeCast") + } + + testClass { + model("basic/codeFragments", extension = "kt") + } + } + + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("fileOrElement", extension = "java") + } + } + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("multiFile", extension = null, recursive = false) + } + } + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("fileOrElement", extension = "java") + } + } + + testGroup("nj2k/tests", "nj2k/testData") { + testClass { + model("newJ2k", pattern = """^([^\.]+)\.java$""") + } + testClass { + model("inference/common") + } + testClass { + model("inference/nullability") + } + testClass { + model("inference/mutability") + } + testClass { + model("copyPaste", pattern = """^([^\.]+)\.java$""") + } + testClass { + model("copyPastePlainText", pattern = """^([^\.]+)\.txt$""") + } + testClass { + model("multiFile", extension = null, recursive = false) + } + } + + /* There is no jps in AS + .... */ + testGroup("compiler/incremental-compilation-impl/test", "jps-plugin/testData") { + testClass { + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/classHierarchyAffected", extension = null, recursive = false) + model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true) + model("incremental/withJava", extension = null, excludeParentDirs = true) + model("incremental/incrementalJvmCompilerOnly", extension = null, excludeParentDirs = true) + } - testGroup("idea/tests", "compiler/testData") { - testClass { - model("loadJava/compiledKotlin") + testClass { + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/classHierarchyAffected", extension = null, recursive = false) + model("incremental/js", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/js/friendsModuleDisabled", extension = null, recursive = false) + } + + testClass { + model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) + } + testClass { + model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) + } } - testClass { - model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") + testGroup("plugins/android-extensions/android-extensions-compiler/test", "plugins/android-extensions/android-extensions-compiler/testData") { + testClass { + model("descriptors", recursive = false, extension = null) + } + + testClass { + model("codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest") + model("codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke") + } + + testClass { + model("codegen/bytecodeShape", recursive = false, extension = null) + } + + testClass { + model("parcel/codegen") + } } - testClass { - model("asJava/lightClasses", excludeDirs = listOf("delegation", "script"), pattern = KT_WITHOUT_DOTS_IN_NAME) + testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { + testClass { + model("converter") + } + + testClass { + model("kotlinRunner") + } } - testClass { - model("asJava/script/ide", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + testGroup("plugins/kapt3/kapt3-cli/test", "plugins/kapt3/kapt3-cli/testData") { + testClass { + model("argumentParsing", extension = "txt") + } + + testClass { + model("integration", recursive = false, extension = null) + } } - testClass { - model("asJava/lightClasses", excludeDirs = listOf("local", "compilationErrors", "ideRegression"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + testGroup("plugins/allopen/allopen-cli/test", "plugins/allopen/allopen-cli/testData") { + testClass { + model("bytecodeListing", extension = "kt") + } } + + testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") { + testClass { + model("bytecodeListing", extension = "kt") + } + + testClass { + model("box", targetBackend = TargetBackend.JVM) + } + } + + testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") { + testClass { + model("diagnostics") + } + testClass { + model("script", extension = "kts") + } + } + + testGroup( + "plugins/kotlin-serialization/kotlin-serialization-compiler/test", + "plugins/kotlin-serialization/kotlin-serialization-compiler/testData" + ) { + testClass { + model("diagnostics") + } + + testClass { + model("codegen") + } + + testClass { + model("codegen") + } + } + /* + testGroup("plugins/android-extensions/android-extensions-idea/tests", "plugins/android-extensions/android-extensions-idea/testData") { + testClass { + model("android/completion", recursive = false, extension = null) + } + + testClass { + model("android/goto", recursive = false, extension = null) + } + + testClass { + model("android/rename", recursive = false, extension = null) + } + + testClass { + model("android/renameLayout", recursive = false, extension = null) + } + + testClass { + model("android/findUsages", recursive = false, extension = null) + } + + testClass { + model("android/usageHighlighting", recursive = false, extension = null) + } + + testClass { + model("android/extraction", recursive = false, extension = null) + } + + testClass { + model("android/parcel/checker", excludeParentDirs = true) + } + + testClass { + model("android/parcel/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + } + + testGroup("idea/idea-android/tests", "idea/testData") { + testClass { + model("configuration/android-gradle", pattern = """(\w+)_before\.gradle$""", testMethod = "doTestAndroidGradle") + model("configuration/android-gsk", pattern = """(\w+)_before\.gradle.kts$""", testMethod = "doTestAndroidGradle") + } + + testClass { + model("android/intention", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("android/resourceIntention", extension = "test", singleClass = true) + } + + testClass { + model("android/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + + testClass { + model("android/lint", excludeParentDirs = true) + } + + testClass { + model("android/lintQuickfix", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("android/folding") + } + + testClass { + model("android/gutterIcon") + } + } + */ } - - testGroup("idea/idea-completion/tests", "idea/idea-completion/testData") { - testClass { - model("injava", extension = "java", recursive = false) - } - - testClass { - model("injava", extension = "java", recursive = false) - } - - testClass { - model("injava/stdlib", extension = "java", recursive = false) - } - - testClass { - model("weighers/basic", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("weighers/smart", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("basic/common") - model("basic/js") - } - - testClass { - model("basic/common") - model("basic/java") - } - - testClass { - model("smart") - } - - testClass { - model("keywords", recursive = false) - } - - testClass { - model("basic/withLib", recursive = false) - } - - testClass { - model("handlers/basic", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("handlers/smart") - } - - testClass { - model("handlers/keywords") - } - - testClass { - model("handlers/charFilter") - } - - testClass { - model("basic/multifile", extension = null, recursive = false) - } - - testClass { - model("smartMultiFile", extension = null, recursive = false) - } - - testClass("KDocCompletionTestGenerated") { - model("kdoc") - } - - testClass { - model("basic/java8") - } - - testClass { - model("incrementalResolve") - } - - testClass { - model("multiPlatform", recursive = false, extension = null) - } - } - - //TODO: move these tests into idea-completion module - testGroup("idea/tests", "idea/idea-completion/testData") { - testClass { - model("handlers/runtimeCast") - } - - testClass { - model("basic/codeFragments", extension = "kt") - } - } - - testGroup("j2k/tests", "j2k/testData") { - testClass { - model("fileOrElement", extension = "java") - } - } - testGroup("j2k/tests", "j2k/testData") { - testClass { - model("multiFile", extension = null, recursive = false) - } - } - testGroup("j2k/tests", "j2k/testData") { - testClass { - model("fileOrElement", extension = "java") - } - } - - testGroup("nj2k/tests", "nj2k/testData") { - testClass { - model("newJ2k", pattern = """^([^\.]+)\.java$""") - } - testClass { - model("inference/common") - } - testClass { - model("inference/nullability") - } - testClass { - model("inference/mutability") - } - testClass { - model("copyPaste", pattern = """^([^\.]+)\.java$""") - } - testClass { - model("copyPastePlainText", pattern = """^([^\.]+)\.txt$""") - } - testClass { - model("multiFile", extension = null, recursive = false) - } - } - -/* There is no jps in AS - .... -*/ - testGroup("compiler/incremental-compilation-impl/test", "jps-plugin/testData") { - testClass { - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/classHierarchyAffected", extension = null, recursive = false) - model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true) - model("incremental/withJava", extension = null, excludeParentDirs = true) - model("incremental/incrementalJvmCompilerOnly", extension = null, excludeParentDirs = true) - } - - testClass { - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/classHierarchyAffected", extension = null, recursive = false) - model("incremental/js", extension = null, excludeParentDirs = true) - } - - testClass { - model("incremental/js/friendsModuleDisabled", extension = null, recursive = false) - } - - testClass { - model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) - } - testClass { - model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) - } - } - - testGroup("plugins/android-extensions/android-extensions-compiler/test", "plugins/android-extensions/android-extensions-compiler/testData") { - testClass { - model("descriptors", recursive = false, extension = null) - } - - testClass { - model("codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest") - model("codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke") - } - - testClass { - model("codegen/bytecodeShape", recursive = false, extension = null) - } - - testClass { - model("parcel/codegen") - } - } - - testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { - testClass { - model("converter") - } - - testClass { - model("kotlinRunner") - } - } - - testGroup("plugins/kapt3/kapt3-cli/test", "plugins/kapt3/kapt3-cli/testData") { - testClass { - model("argumentParsing", extension = "txt") - } - - testClass { - model("integration", recursive = false, extension = null) - } - } - - testGroup("plugins/allopen/allopen-cli/test", "plugins/allopen/allopen-cli/testData") { - testClass { - model("bytecodeListing", extension = "kt") - } - } - - testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") { - testClass { - model("bytecodeListing", extension = "kt") - } - - testClass { - model("box", targetBackend = TargetBackend.JVM) - } - } - - testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") { - testClass { - model("diagnostics") - } - testClass { - model("script", extension = "kts") - } - } - - testGroup( - "plugins/kotlin-serialization/kotlin-serialization-compiler/test", - "plugins/kotlin-serialization/kotlin-serialization-compiler/testData" - ) { - testClass { - model("diagnostics") - } - - testClass { - model("codegen") - } - - testClass { - model("codegen") - } - } -/* - testGroup("plugins/android-extensions/android-extensions-idea/tests", "plugins/android-extensions/android-extensions-idea/testData") { - testClass { - model("android/completion", recursive = false, extension = null) - } - - testClass { - model("android/goto", recursive = false, extension = null) - } - - testClass { - model("android/rename", recursive = false, extension = null) - } - - testClass { - model("android/renameLayout", recursive = false, extension = null) - } - - testClass { - model("android/findUsages", recursive = false, extension = null) - } - - testClass { - model("android/usageHighlighting", recursive = false, extension = null) - } - - testClass { - model("android/extraction", recursive = false, extension = null) - } - - testClass { - model("android/parcel/checker", excludeParentDirs = true) - } - - testClass { - model("android/parcel/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } - } - - testGroup("idea/idea-android/tests", "idea/testData") { - testClass { - model("configuration/android-gradle", pattern = """(\w+)_before\.gradle$""", testMethod = "doTestAndroidGradle") - model("configuration/android-gsk", pattern = """(\w+)_before\.gradle.kts$""", testMethod = "doTestAndroidGradle") - } - - testClass { - model("android/intention", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("android/resourceIntention", extension = "test", singleClass = true) - } - - testClass { - model("android/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } - - testClass { - model("android/lint", excludeParentDirs = true) - } - - testClass { - model("android/lintQuickfix", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("android/folding") - } - - testClass { - model("android/gutterIcon") - } - } -*/ } diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as41 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as41 index 3414ed8fbf0..8318d94daa5 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as41 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as41 @@ -31,7 +31,7 @@ import org.jetbrains.kotlin.formatter.AbstractFormatterTest import org.jetbrains.kotlin.formatter.AbstractTypingIndentationTestBase import org.jetbrains.kotlin.generators.tests.generator.TestGroup import org.jetbrains.kotlin.generators.tests.generator.muteExtraSuffix -import org.jetbrains.kotlin.generators.tests.generator.testGroup +import org.jetbrains.kotlin.generators.tests.generator.testGroupSuite import org.jetbrains.kotlin.generators.util.KT_OR_KTS import org.jetbrains.kotlin.generators.util.KT_OR_KTS_WITHOUT_DOTS_IN_NAME import org.jetbrains.kotlin.generators.util.KT_WITHOUT_DOTS_IN_NAME @@ -165,1059 +165,1061 @@ import org.jetbrains.kotlinx.serialization.AbstractSerializationIrBytecodeListin fun main(args: Array) { System.setProperty("java.awt.headless", "true") - testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { - testClass { - model( - "stepping/stepIntoAndSmartStepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doStepIntoTest", - testClassName = "StepInto" - ) - model( - "stepping/stepIntoAndSmartStepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doSmartStepIntoTest", - testClassName = "SmartStepInto" - ) - model( - "stepping/stepInto", - pattern = KT_WITHOUT_DOTS_IN_NAME, - testMethod = "doStepIntoTest", - testClassName = "StepIntoOnly" - ) - model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") - model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") - model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") - model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") + testGroupSuite(args) { + testGroup("idea/jvm-debugger/jvm-debugger-test/test", "idea/jvm-debugger/jvm-debugger-test/testData") { + testClass { + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepInto" + ) + model( + "stepping/stepIntoAndSmartStepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doSmartStepIntoTest", + testClassName = "SmartStepInto" + ) + model( + "stepping/stepInto", + pattern = KT_WITHOUT_DOTS_IN_NAME, + testMethod = "doStepIntoTest", + testClassName = "StepIntoOnly" + ) + model("stepping/stepOut", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOutTest") + model("stepping/stepOver", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepOverTest") + model("stepping/filters", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doStepIntoTest") + model("stepping/custom", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doCustomTest") + } + + testClass { + model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") + model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") + } + + testClass { + model("selectExpression", recursive = false) + model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") + } + + testClass { + model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") + model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") + } + + testClass { + model("smartStepInto") + } + + testClass { + model("breakpointApplicability") + } + + testClass { + model("fileRanking") + } + + testClass { + model("asyncStackTrace") + } + + testClass { + // TODO: implement mapping logic for terminal operations + model("sequence/streams/sequence", excludeDirs = listOf("terminal")) + } + } + + testGroup("idea/tests", "idea/testData") { + testClass { + model("resolve/additionalLazyResolve") + } + + testClass { + model("resolve/partialBodyResolve") + } + + testClass { + model("checker", recursive = false) + model("checker/regression") + model("checker/recovery") + model("checker/rendering") + model("checker/scripts", extension = "kts") + model("checker/duplicateJvmSignature") + model("checker/infos", testMethod = "doTestWithInfos") + model("checker/diagnosticsMessage") + } + + testClass { + model("kotlinAndJavaChecker/javaAgainstKotlin") + model("kotlinAndJavaChecker/javaWithKotlin") + } + + testClass { + model("kotlinAndJavaChecker/javaAgainstKotlin") + } + + testClass { + model("unifier") + } + + testClass { + model("checker/codeFragments", extension = "kt", recursive = false) + model("checker/codeFragments/imports", testMethod = "doTestWithImport", extension = "kt") + } + + testClass { + model("quickfix.special/codeFragmentAutoImport", extension = "kt", recursive = false) + } + + testClass { + model("checker/js") + } + + testClass { + model("quickfix", pattern = "^([\\w\\-_]+)\\.kt$", filenameStartsLowerCase = true) + } + + testClass { + model("navigation/gotoSuper", extension = "test", recursive = false) + } + + testClass { + model("navigation/gotoTypeDeclaration", extension = "test") + } + + testClass { + model("navigation/gotoDeclaration", extension = "test") + } + + testClass { + model( + "parameterInfo", + pattern = "^([\\w\\-_]+)\\.kt$", recursive = true, + excludeDirs = listOf("withLib1/sharedLib", "withLib2/sharedLib", "withLib3/sharedLib") + ) + } + + testClass { + model("navigation/gotoClass", testMethod = "doClassTest") + model("navigation/gotoSymbol", testMethod = "doSymbolTest") + } + + testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { + model("decompiler/navigation/usercode") + } + + testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { + model("decompiler/navigation/userJavaCode", pattern = "^(.+)\\.java$") + } + + testClass(annotations = listOf(muteExtraSuffix(".libsrcjs"))) { + model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") + } + + testClass { + model("decompiler/navigation/usercode") + } + + testClass { + model("navigation/implementations", recursive = false) + } + + testClass { + model("navigation/gotoTestOrCode", pattern = "^(.+)\\.main\\..+\$") + } + + testClass { + model("search/inheritance") + } + + testClass { + model("search/annotations") + } + + testClass { + model("quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + + testClass { + model("typealiasExpansionIndex") + } + + testClass { + model("highlighter") + } + + testClass { + model("dslHighlighter") + } + + testClass { + model("usageHighlighter") + } + + testClass { + model("folding/noCollapse") + model("folding/checkCollapse", testMethod = "doSettingsFoldingTest") + } + + testClass { + model("codeInsight/surroundWith/if", testMethod = "doTestWithIfSurrounder") + model("codeInsight/surroundWith/ifElse", testMethod = "doTestWithIfElseSurrounder") + model("codeInsight/surroundWith/ifElseExpression", testMethod = "doTestWithIfElseExpressionSurrounder") + model("codeInsight/surroundWith/ifElseExpressionBraces", testMethod = "doTestWithIfElseExpressionBracesSurrounder") + model("codeInsight/surroundWith/not", testMethod = "doTestWithNotSurrounder") + model("codeInsight/surroundWith/parentheses", testMethod = "doTestWithParenthesesSurrounder") + model("codeInsight/surroundWith/stringTemplate", testMethod = "doTestWithStringTemplateSurrounder") + model("codeInsight/surroundWith/when", testMethod = "doTestWithWhenSurrounder") + model("codeInsight/surroundWith/tryCatch", testMethod = "doTestWithTryCatchSurrounder") + model("codeInsight/surroundWith/tryCatchExpression", testMethod = "doTestWithTryCatchExpressionSurrounder") + model("codeInsight/surroundWith/tryCatchFinally", testMethod = "doTestWithTryCatchFinallySurrounder") + model("codeInsight/surroundWith/tryCatchFinallyExpression", testMethod = "doTestWithTryCatchFinallyExpressionSurrounder") + model("codeInsight/surroundWith/tryFinally", testMethod = "doTestWithTryFinallySurrounder") + model("codeInsight/surroundWith/functionLiteral", testMethod = "doTestWithFunctionLiteralSurrounder") + model("codeInsight/surroundWith/withIfExpression", testMethod = "doTestWithSurroundWithIfExpression") + model("codeInsight/surroundWith/withIfElseExpression", testMethod = "doTestWithSurroundWithIfElseExpression") + } + + testClass { + model("joinLines") + } + + testClass { + model("codeInsight/breadcrumbs") + } + + testClass { + model("intentions", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") + } + + testClass { + model("intentions/loopToCallChain", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("concatenatedStringGenerator", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("intentions", pattern = "^(inspections\\.test)$", singleClass = true) + model("inspections", pattern = "^(inspections\\.test)$", singleClass = true) + model("inspectionsLocal", pattern = "^(inspections\\.test)$", singleClass = true) + } + + testClass { + model("inspectionsLocal", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") + } + + testClass { + model("hierarchy/class/type", extension = null, recursive = false, testMethod = "doTypeClassHierarchyTest") + model("hierarchy/class/super", extension = null, recursive = false, testMethod = "doSuperClassHierarchyTest") + model("hierarchy/class/sub", extension = null, recursive = false, testMethod = "doSubClassHierarchyTest") + model("hierarchy/calls/callers", extension = null, recursive = false, testMethod = "doCallerHierarchyTest") + model("hierarchy/calls/callersJava", extension = null, recursive = false, testMethod = "doCallerJavaHierarchyTest") + model("hierarchy/calls/callees", extension = null, recursive = false, testMethod = "doCalleeHierarchyTest") + model("hierarchy/overrides", extension = null, recursive = false, testMethod = "doOverrideHierarchyTest") + } + + testClass { + model("hierarchy/withLib", extension = null, recursive = false) + } + + testClass { + model("codeInsight/moveUpDown/classBodyDeclarations", pattern = KT_OR_KTS, testMethod = "doTestClassBodyDeclaration") + model("codeInsight/moveUpDown/closingBraces", testMethod = "doTestExpression") + model("codeInsight/moveUpDown/expressions", pattern = KT_OR_KTS, testMethod = "doTestExpression") + model("codeInsight/moveUpDown/parametersAndArguments", testMethod = "doTestExpression") + model("codeInsight/moveUpDown/trailingComma", testMethod = "doTestExpressionWithTrailingComma") + } + + testClass { + model("codeInsight/moveLeftRight") + } + + testClass { + model("refactoring/inline", pattern = "^(\\w+)\\.kt$") + } + + testClass { + model("codeInsight/unwrapAndRemove/removeExpression", testMethod = "doTestExpressionRemover") + model("codeInsight/unwrapAndRemove/unwrapThen", testMethod = "doTestThenUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapElse", testMethod = "doTestElseUnwrapper") + model("codeInsight/unwrapAndRemove/removeElse", testMethod = "doTestElseRemover") + model("codeInsight/unwrapAndRemove/unwrapLoop", testMethod = "doTestLoopUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapTry", testMethod = "doTestTryUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapCatch", testMethod = "doTestCatchUnwrapper") + model("codeInsight/unwrapAndRemove/removeCatch", testMethod = "doTestCatchRemover") + model("codeInsight/unwrapAndRemove/unwrapFinally", testMethod = "doTestFinallyUnwrapper") + model("codeInsight/unwrapAndRemove/removeFinally", testMethod = "doTestFinallyRemover") + model("codeInsight/unwrapAndRemove/unwrapLambda", testMethod = "doTestLambdaUnwrapper") + model("codeInsight/unwrapAndRemove/unwrapFunctionParameter", testMethod = "doTestFunctionParameterUnwrapper") + } + + testClass { + model("codeInsight/expressionType") + } + + testClass { + model("editor/backspaceHandler") + } + + testClass { + model("editor/enterHandler/multilineString") + } + + testClass { + model("editor/quickDoc", pattern = """^([^_]+)\.(kt|java)$""") + } + + testClass { + model("refactoring/safeDelete/deleteClass/kotlinClass", testMethod = "doClassTest") + model("refactoring/safeDelete/deleteClass/kotlinClassWithJava", testMethod = "doClassTestWithJava") + model("refactoring/safeDelete/deleteClass/javaClassWithKotlin", extension = "java", testMethod = "doJavaClassTest") + model("refactoring/safeDelete/deleteObject/kotlinObject", testMethod = "doObjectTest") + model("refactoring/safeDelete/deleteFunction/kotlinFunction", testMethod = "doFunctionTest") + model("refactoring/safeDelete/deleteFunction/kotlinFunctionWithJava", testMethod = "doFunctionTestWithJava") + model("refactoring/safeDelete/deleteFunction/javaFunctionWithKotlin", testMethod = "doJavaMethodTest") + model("refactoring/safeDelete/deleteProperty/kotlinProperty", testMethod = "doPropertyTest") + model("refactoring/safeDelete/deleteProperty/kotlinPropertyWithJava", testMethod = "doPropertyTestWithJava") + model("refactoring/safeDelete/deleteProperty/javaPropertyWithKotlin", testMethod = "doJavaPropertyTest") + model("refactoring/safeDelete/deleteTypeAlias/kotlinTypeAlias", testMethod = "doTypeAliasTest") + model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameter", testMethod = "doTypeParameterTest") + model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameterWithJava", testMethod = "doTypeParameterTestWithJava") + model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameter", testMethod = "doValueParameterTest") + model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameterWithJava", testMethod = "doValueParameterTestWithJava") + } + + testClass { + model("resolve/references", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("resolve/referenceInJava/binaryAndSource", extension = "java") + model("resolve/referenceInJava/sourceOnly", extension = "java") + } + + testClass { + model("resolve/referenceInJava/binaryAndSource", extension = "java") + } + + testClass { + model("resolve/referenceWithLib", recursive = false) + } + + testClass { + model("resolve/referenceInLib", recursive = false) + } + + testClass { + model("resolve/referenceToJavaWithWrongFileStructure", recursive = false) + } + + testClass { + model("findUsages/kotlin", pattern = """^(.+)\.0\.(kt|kts)$""") + model("findUsages/java", pattern = """^(.+)\.0\.java$""") + model("findUsages/propertyFiles", pattern = """^(.+)\.0\.properties$""") + } + + testClass { + model("findUsages/libraryUsages", pattern = """^(.+)\.0\.kt$""") + } + + testClass { + model("refactoring/move", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/copy", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/moveMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/copyMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/safeDeleteMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("multiFileIntentions", extension = "test", singleClass = true, filenameStartsLowerCase = true) + } + + testClass { + model("multiFileLocalInspections", extension = "test", singleClass = true, filenameStartsLowerCase = true) + } + + testClass { + model("multiFileInspections", extension = "test", singleClass = true) + } + + testClass { + model("formatter", pattern = """^([^\.]+)\.after\.kt.*$""") + model( + "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.kt.*$""", + testMethod = "doTestCallSite", testClassName = "FormatterCallSite" + ) + model( + "formatter", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", + testMethod = "doTestInverted", testClassName = "FormatterInverted" + ) + model( + "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.inv\.kt.*$""", + testMethod = "doTestInvertedCallSite", testClassName = "FormatterInvertedCallSite" + ) + } + + testClass { + model("indentationOnNewline", pattern = """^([^\.]+)\.after\.kt.*$""", testMethod = "doNewlineTest", + testClassName = "DirectSettings") + model("indentationOnNewline", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", testMethod = "doNewlineTestWithInvert", + testClassName = "InvertedSettings") + } + + testClass { + model("diagnosticMessage", recursive = false) + } + + testClass { + model("diagnosticMessage/js", recursive = false, targetBackend = TargetBackend.JS) + } + + testClass { + model("refactoring/rename", extension = "test", singleClass = true) + } + + testClass { + model("refactoring/renameMultiModule", extension = "test", singleClass = true) + } + + testClass { + model("codeInsight/outOfBlock", pattern = KT_OR_KTS) + } + + testClass { + model("dataFlowValueRendering") + } + + testClass { + model("copyPaste/conversion", pattern = """^([^\.]+)\.java$""") + } + + testClass { + model("copyPaste/plainTextConversion", pattern = """^([^\.]+)\.txt$""") + } + + testClass { + model("copyPaste/plainTextLiteral", pattern = """^([^\.]+)\.txt$""") + } + + testClass { + model("copyPaste/literal", pattern = """^([^\.]+)\.kt$""") + } + + testClass { + model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCopy", testClassName = "Copy", recursive = false) + model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCut", testClassName = "Cut", recursive = false) + } + + testClass { + model("copyPaste/moveDeclarations", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTest") + } + + testClass { + model("copyright", pattern = KT_OR_KTS, testMethod = "doTest") + } + + testClass { + model("exitPoints") + } + + testClass { + model("codeInsight/lineMarker") + } + + testClass { + model("codeInsightInLibrary/lineMarker", testMethod = "doTestWithLibrary") + } + + testClass { + model("multiModuleLineMarker", extension = null, recursive = false) + } + + testClass { + model("shortenRefs", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + testClass { + model("addImport", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("smartSelection", testMethod = "doTestSmartSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("structureView/fileStructure", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("expressionSelection", testMethod = "doTestExpressionSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("decompiler/decompiledText", pattern = """^([^\.]+)$""") + } + + testClass { + model("decompiler/decompiledTextJvm", pattern = """^([^\.]+)$""") + } + + testClass { + model("decompiler/decompiledText", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) + } + + testClass { + model("decompiler/decompiledTextJs", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) + } + + testClass { + model("decompiler/stubBuilder", extension = null, recursive = false) + } + + testClass { + model("editor/optimizeImports/jvm", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + testClass { + model("editor/optimizeImports/js", pattern = KT_WITHOUT_DOTS_IN_NAME) + model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + + testClass { + model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) + } + + testClass { + model("stubs", extension = "kt") + } + + testClass { + model("multiFileHighlighting", recursive = false) + } + + testClass { + model("multiModuleHighlighting/multiplatform/", recursive = false, extension = null) + } + + testClass { + model("multiModuleHighlighting/hierarchicalExpectActualMatching/", recursive = false, extension = null) + } + + testClass { + model("multiModuleQuickFix", extension = null, deep = 1) + } + + testClass { + model("navigation/implementations/multiModule", recursive = false, extension = null) + } + + testClass { + model("navigation/relatedSymbols/multiModule", recursive = false, extension = null) + } + + testClass { + model("navigation/gotoSuper/multiModule", recursive = false, extension = null) + } + + testClass { + model("refactoring/introduceVariable", pattern = KT_OR_KTS, testMethod = "doIntroduceVariableTest") + model("refactoring/extractFunction", pattern = KT_OR_KTS, testMethod = "doExtractFunctionTest") + model("refactoring/introduceProperty", pattern = KT_OR_KTS, testMethod = "doIntroducePropertyTest") + model("refactoring/introduceParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceSimpleParameterTest") + model("refactoring/introduceLambdaParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceLambdaParameterTest") + model("refactoring/introduceJavaParameter", extension = "java", testMethod = "doIntroduceJavaParameterTest") + model("refactoring/introduceTypeParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeParameterTest") + model("refactoring/introduceTypeAlias", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeAliasTest") + model("refactoring/extractSuperclass", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractSuperclassTest") + model("refactoring/extractInterface", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractInterfaceTest") + } + + testClass { + model("refactoring/pullUp/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") + model("refactoring/pullUp/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") + model("refactoring/pullUp/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") + } + + testClass { + model("refactoring/pushDown/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") + model("refactoring/pushDown/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") + model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") + } + + testClass { + model("coverage/outputFiles") + } + + testClass { + model("internal/toolWindow", recursive = false, extension = null) + } + + testClass("org.jetbrains.kotlin.idea.kdoc.KdocResolveTestGenerated") { + model("kdoc/resolve") + } + + testClass { + model("kdoc/highlighting") + } + + testClass { + model("kdoc/typing") + } + + testClass { + model("codeInsight/generate/testFrameworkSupport") + } + + testClass { + model("codeInsight/generate/equalsWithHashCode") + } + + testClass { + model("codeInsight/generate/secondaryConstructors") + } + + testClass { + model("codeInsight/generate/toString") + } + + testClass { + model("repl/completion") + } + + testClass { + model("codeInsight/postfix") + } + + testClass { + model("script/definition/highlighting", extension = null, recursive = false) + model("script/definition/complex", extension = null, recursive = false, testMethod = "doComplexTest") + } + + testClass { + model("script/definition/navigation", extension = null, recursive = false) + } + + testClass { + model("script/definition/completion", extension = null, recursive = false) + } + + testClass { + model("script/definition/order", extension = null, recursive = false) + } + + testClass { + model("refactoring/nameSuggestionProvider") + } + + testClass { + model("slicer", excludeDirs = listOf("mpp")) + } + + testClass { + model("slicer/inflow", singleClass = true) + } + + testClass { + model("slicer/inflow", singleClass = true) + } + + testClass { + model("slicer/mpp", recursive = false, extension = null) + } } - testClass { - model("evaluation/singleBreakpoint", testMethod = "doSingleBreakpointTest") - model("evaluation/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest") - } - - testClass { - model("selectExpression", recursive = false) - model("selectExpression/disallowMethodCalls", testMethod = "doTestWoMethodCalls") - } - - testClass { - model("positionManager", recursive = false, extension = "kt", testClassName = "SingleFile") - model("positionManager", recursive = false, extension = null, testClassName = "MultiFile") - } - - testClass { - model("smartStepInto") - } - - testClass { - model("breakpointApplicability") - } - - testClass { - model("fileRanking") - } - - testClass { - model("asyncStackTrace") - } - - testClass { - // TODO: implement mapping logic for terminal operations - model("sequence/streams/sequence", excludeDirs = listOf("terminal")) - } - } - - testGroup("idea/tests", "idea/testData") { - testClass { - model("resolve/additionalLazyResolve") - } - - testClass { - model("resolve/partialBodyResolve") - } - - testClass { - model("checker", recursive = false) - model("checker/regression") - model("checker/recovery") - model("checker/rendering") - model("checker/scripts", extension = "kts") - model("checker/duplicateJvmSignature") - model("checker/infos", testMethod = "doTestWithInfos") - model("checker/diagnosticsMessage") - } - - testClass { - model("kotlinAndJavaChecker/javaAgainstKotlin") - model("kotlinAndJavaChecker/javaWithKotlin") - } - - testClass { - model("kotlinAndJavaChecker/javaAgainstKotlin") - } - - testClass { - model("unifier") - } - - testClass { - model("checker/codeFragments", extension = "kt", recursive = false) - model("checker/codeFragments/imports", testMethod = "doTestWithImport", extension = "kt") - } - - testClass { - model("quickfix.special/codeFragmentAutoImport", extension = "kt", recursive = false) - } - - testClass { - model("checker/js") - } - - testClass { - model("quickfix", pattern = "^([\\w\\-_]+)\\.kt$", filenameStartsLowerCase = true) - } - - testClass { - model("navigation/gotoSuper", extension = "test", recursive = false) - } - - testClass { - model("navigation/gotoTypeDeclaration", extension = "test") - } - - testClass { - model("navigation/gotoDeclaration", extension = "test") - } - - testClass { - model( - "parameterInfo", - pattern = "^([\\w\\-_]+)\\.kt$", recursive = true, - excludeDirs = listOf("withLib1/sharedLib", "withLib2/sharedLib", "withLib3/sharedLib") - ) - } - - testClass { - model("navigation/gotoClass", testMethod = "doClassTest") - model("navigation/gotoSymbol", testMethod = "doSymbolTest") - } - - testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { - model("decompiler/navigation/usercode") - } - - testClass(annotations = listOf(muteExtraSuffix(".libsrc"))) { - model("decompiler/navigation/userJavaCode", pattern = "^(.+)\\.java$") - } - - testClass(annotations = listOf(muteExtraSuffix(".libsrcjs"))) { - model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") - } - - testClass { - model("decompiler/navigation/usercode") - } - - testClass { - model("navigation/implementations", recursive = false) - } - - testClass { - model("navigation/gotoTestOrCode", pattern = "^(.+)\\.main\\..+\$") - } - - testClass { - model("search/inheritance") - } - - testClass { - model("search/annotations") - } - - testClass { - model("quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } - - testClass { - model("typealiasExpansionIndex") - } - - testClass { - model("highlighter") - } - - testClass { - model("dslHighlighter") - } - - testClass { - model("usageHighlighter") - } - - testClass { - model("folding/noCollapse") - model("folding/checkCollapse", testMethod = "doSettingsFoldingTest") - } - - testClass { - model("codeInsight/surroundWith/if", testMethod = "doTestWithIfSurrounder") - model("codeInsight/surroundWith/ifElse", testMethod = "doTestWithIfElseSurrounder") - model("codeInsight/surroundWith/ifElseExpression", testMethod = "doTestWithIfElseExpressionSurrounder") - model("codeInsight/surroundWith/ifElseExpressionBraces", testMethod = "doTestWithIfElseExpressionBracesSurrounder") - model("codeInsight/surroundWith/not", testMethod = "doTestWithNotSurrounder") - model("codeInsight/surroundWith/parentheses", testMethod = "doTestWithParenthesesSurrounder") - model("codeInsight/surroundWith/stringTemplate", testMethod = "doTestWithStringTemplateSurrounder") - model("codeInsight/surroundWith/when", testMethod = "doTestWithWhenSurrounder") - model("codeInsight/surroundWith/tryCatch", testMethod = "doTestWithTryCatchSurrounder") - model("codeInsight/surroundWith/tryCatchExpression", testMethod = "doTestWithTryCatchExpressionSurrounder") - model("codeInsight/surroundWith/tryCatchFinally", testMethod = "doTestWithTryCatchFinallySurrounder") - model("codeInsight/surroundWith/tryCatchFinallyExpression", testMethod = "doTestWithTryCatchFinallyExpressionSurrounder") - model("codeInsight/surroundWith/tryFinally", testMethod = "doTestWithTryFinallySurrounder") - model("codeInsight/surroundWith/functionLiteral", testMethod = "doTestWithFunctionLiteralSurrounder") - model("codeInsight/surroundWith/withIfExpression", testMethod = "doTestWithSurroundWithIfExpression") - model("codeInsight/surroundWith/withIfElseExpression", testMethod = "doTestWithSurroundWithIfElseExpression") - } - - testClass { - model("joinLines") - } - - testClass { - model("codeInsight/breadcrumbs") - } - - testClass { - model("intentions", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") - } - - testClass { - model("intentions/loopToCallChain", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("concatenatedStringGenerator", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("intentions", pattern = "^(inspections\\.test)$", singleClass = true) - model("inspections", pattern = "^(inspections\\.test)$", singleClass = true) - model("inspectionsLocal", pattern = "^(inspections\\.test)$", singleClass = true) - } - - testClass { - model("inspectionsLocal", pattern = "^([\\w\\-_]+)\\.(kt|kts)$") - } - - testClass { - model("hierarchy/class/type", extension = null, recursive = false, testMethod = "doTypeClassHierarchyTest") - model("hierarchy/class/super", extension = null, recursive = false, testMethod = "doSuperClassHierarchyTest") - model("hierarchy/class/sub", extension = null, recursive = false, testMethod = "doSubClassHierarchyTest") - model("hierarchy/calls/callers", extension = null, recursive = false, testMethod = "doCallerHierarchyTest") - model("hierarchy/calls/callersJava", extension = null, recursive = false, testMethod = "doCallerJavaHierarchyTest") - model("hierarchy/calls/callees", extension = null, recursive = false, testMethod = "doCalleeHierarchyTest") - model("hierarchy/overrides", extension = null, recursive = false, testMethod = "doOverrideHierarchyTest") - } - - testClass { - model("hierarchy/withLib", extension = null, recursive = false) - } - - testClass { - model("codeInsight/moveUpDown/classBodyDeclarations", pattern = KT_OR_KTS, testMethod = "doTestClassBodyDeclaration") - model("codeInsight/moveUpDown/closingBraces", testMethod = "doTestExpression") - model("codeInsight/moveUpDown/expressions", pattern = KT_OR_KTS, testMethod = "doTestExpression") - model("codeInsight/moveUpDown/parametersAndArguments", testMethod = "doTestExpression") - model("codeInsight/moveUpDown/trailingComma", testMethod = "doTestExpressionWithTrailingComma") - } - - testClass { - model("codeInsight/moveLeftRight") - } - - testClass { - model("refactoring/inline", pattern = "^(\\w+)\\.kt$") - } - - testClass { - model("codeInsight/unwrapAndRemove/removeExpression", testMethod = "doTestExpressionRemover") - model("codeInsight/unwrapAndRemove/unwrapThen", testMethod = "doTestThenUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapElse", testMethod = "doTestElseUnwrapper") - model("codeInsight/unwrapAndRemove/removeElse", testMethod = "doTestElseRemover") - model("codeInsight/unwrapAndRemove/unwrapLoop", testMethod = "doTestLoopUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapTry", testMethod = "doTestTryUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapCatch", testMethod = "doTestCatchUnwrapper") - model("codeInsight/unwrapAndRemove/removeCatch", testMethod = "doTestCatchRemover") - model("codeInsight/unwrapAndRemove/unwrapFinally", testMethod = "doTestFinallyUnwrapper") - model("codeInsight/unwrapAndRemove/removeFinally", testMethod = "doTestFinallyRemover") - model("codeInsight/unwrapAndRemove/unwrapLambda", testMethod = "doTestLambdaUnwrapper") - model("codeInsight/unwrapAndRemove/unwrapFunctionParameter", testMethod = "doTestFunctionParameterUnwrapper") - } - - testClass { - model("codeInsight/expressionType") - } - - testClass { - model("editor/backspaceHandler") - } - - testClass { - model("editor/enterHandler/multilineString") - } - - testClass { - model("editor/quickDoc", pattern = """^([^_]+)\.(kt|java)$""") - } - - testClass { - model("refactoring/safeDelete/deleteClass/kotlinClass", testMethod = "doClassTest") - model("refactoring/safeDelete/deleteClass/kotlinClassWithJava", testMethod = "doClassTestWithJava") - model("refactoring/safeDelete/deleteClass/javaClassWithKotlin", extension = "java", testMethod = "doJavaClassTest") - model("refactoring/safeDelete/deleteObject/kotlinObject", testMethod = "doObjectTest") - model("refactoring/safeDelete/deleteFunction/kotlinFunction", testMethod = "doFunctionTest") - model("refactoring/safeDelete/deleteFunction/kotlinFunctionWithJava", testMethod = "doFunctionTestWithJava") - model("refactoring/safeDelete/deleteFunction/javaFunctionWithKotlin", testMethod = "doJavaMethodTest") - model("refactoring/safeDelete/deleteProperty/kotlinProperty", testMethod = "doPropertyTest") - model("refactoring/safeDelete/deleteProperty/kotlinPropertyWithJava", testMethod = "doPropertyTestWithJava") - model("refactoring/safeDelete/deleteProperty/javaPropertyWithKotlin", testMethod = "doJavaPropertyTest") - model("refactoring/safeDelete/deleteTypeAlias/kotlinTypeAlias", testMethod = "doTypeAliasTest") - model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameter", testMethod = "doTypeParameterTest") - model("refactoring/safeDelete/deleteTypeParameter/kotlinTypeParameterWithJava", testMethod = "doTypeParameterTestWithJava") - model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameter", testMethod = "doValueParameterTest") - model("refactoring/safeDelete/deleteValueParameter/kotlinValueParameterWithJava", testMethod = "doValueParameterTestWithJava") - } - - testClass { - model("resolve/references", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("resolve/referenceInJava/binaryAndSource", extension = "java") - model("resolve/referenceInJava/sourceOnly", extension = "java") - } - - testClass { - model("resolve/referenceInJava/binaryAndSource", extension = "java") - } - - testClass { - model("resolve/referenceWithLib", recursive = false) - } - - testClass { - model("resolve/referenceInLib", recursive = false) - } - - testClass { - model("resolve/referenceToJavaWithWrongFileStructure", recursive = false) - } - - testClass { - model("findUsages/kotlin", pattern = """^(.+)\.0\.(kt|kts)$""") - model("findUsages/java", pattern = """^(.+)\.0\.java$""") - model("findUsages/propertyFiles", pattern = """^(.+)\.0\.properties$""") - } - - testClass { - model("findUsages/libraryUsages", pattern = """^(.+)\.0\.kt$""") - } + testGroup("idea/scripting-support/test", "idea/scripting-support/testData") { + testClass { + model("scratch", extension = "kts", testMethod = "doScratchCompilingTest", testClassName = "ScratchCompiling", recursive = false) + model("scratch", extension = "kts", testMethod = "doScratchReplTest", testClassName = "ScratchRepl", recursive = false) + model("scratch/multiFile", extension = null, testMethod = "doScratchMultiFileTest", testClassName = "ScratchMultiFile", recursive = false) - testClass { - model("refactoring/move", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/copy", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/moveMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/copyMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/safeDeleteMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("multiFileIntentions", extension = "test", singleClass = true, filenameStartsLowerCase = true) - } - - testClass { - model("multiFileLocalInspections", extension = "test", singleClass = true, filenameStartsLowerCase = true) - } - - testClass { - model("multiFileInspections", extension = "test", singleClass = true) - } - - testClass { - model("formatter", pattern = """^([^\.]+)\.after\.kt.*$""") - model( - "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.kt.*$""", - testMethod = "doTestCallSite", testClassName = "FormatterCallSite" - ) - model( - "formatter", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", - testMethod = "doTestInverted", testClassName = "FormatterInverted" - ) - model( - "formatter/trailingComma", pattern = """^([^\.]+)\.call\.after\.inv\.kt.*$""", - testMethod = "doTestInvertedCallSite", testClassName = "FormatterInvertedCallSite" - ) - } - - testClass { - model("indentationOnNewline", pattern = """^([^\.]+)\.after\.kt.*$""", testMethod = "doNewlineTest", - testClassName = "DirectSettings") - model("indentationOnNewline", pattern = """^([^\.]+)\.after\.inv\.kt.*$""", testMethod = "doNewlineTestWithInvert", - testClassName = "InvertedSettings") - } - - testClass { - model("diagnosticMessage", recursive = false) - } - - testClass { - model("diagnosticMessage/js", recursive = false, targetBackend = TargetBackend.JS) - } - - testClass { - model("refactoring/rename", extension = "test", singleClass = true) - } - - testClass { - model("refactoring/renameMultiModule", extension = "test", singleClass = true) - } - - testClass { - model("codeInsight/outOfBlock", pattern = KT_OR_KTS) - } - - testClass { - model("dataFlowValueRendering") - } - - testClass { - model("copyPaste/conversion", pattern = """^([^\.]+)\.java$""") - } - - testClass { - model("copyPaste/plainTextConversion", pattern = """^([^\.]+)\.txt$""") - } - - testClass { - model("copyPaste/plainTextLiteral", pattern = """^([^\.]+)\.txt$""") - } - - testClass { - model("copyPaste/literal", pattern = """^([^\.]+)\.kt$""") - } - - testClass { - model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCopy", testClassName = "Copy", recursive = false) - model("copyPaste/imports", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTestCut", testClassName = "Cut", recursive = false) - } - - testClass { - model("copyPaste/moveDeclarations", pattern = KT_WITHOUT_DOTS_IN_NAME, testMethod = "doTest") - } - - testClass { - model("copyright", pattern = KT_OR_KTS, testMethod = "doTest") - } + model("worksheet", extension = "ws.kts", testMethod = "doWorksheetCompilingTest", testClassName = "WorksheetCompiling", recursive = false) + model("worksheet", extension = "ws.kts", testMethod = "doWorksheetReplTest", testClassName = "WorksheetRepl", recursive = false) + model("worksheet/multiFile", extension = null, testMethod = "doWorksheetMultiFileTest", testClassName = "WorksheetMultiFile", recursive = false) - testClass { - model("exitPoints") - } + model("scratch/rightPanelOutput", extension = "kts", testMethod = "doRightPreviewPanelOutputTest", testClassName = "ScratchRightPanelOutput", recursive = false) + } - testClass { - model("codeInsight/lineMarker") + testClass { + model("scratch/lineMarker", testMethod = "doScratchTest", pattern = KT_OR_KTS) + } } - testClass { - model("codeInsightInLibrary/lineMarker", testMethod = "doTestWithLibrary") - } + /* + // Maven and Gradle are not relevant for AS branch - testClass { - model("multiModuleLineMarker", extension = null, recursive = false) - } + testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { + testClass { + model("configurator/jvm", extension = null, recursive = false, testMethod = "doTestWithMaven") + model("configurator/js", extension = null, recursive = false, testMethod = "doTestWithJSMaven") + } - testClass { - model("shortenRefs", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - testClass { - model("addImport", pattern = KT_WITHOUT_DOTS_IN_NAME) + testClass { + model("maven-inspections", pattern = "^([\\w\\-]+).xml$", singleClass = true) + } } - testClass { - model("smartSelection", testMethod = "doTestSmartSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) + testGroup("idea/idea-gradle/tests", "idea/testData") { + testClass { + model("configuration/gradle", extension = null, recursive = false, testMethod = "doTestGradle") + model("configuration/gsk", extension = null, recursive = false, testMethod = "doTestGradle") + } } - testClass { - model("structureView/fileStructure", pattern = KT_WITHOUT_DOTS_IN_NAME) - } + */ - testClass { - model("expressionSelection", testMethod = "doTestExpressionSelection", pattern = KT_WITHOUT_DOTS_IN_NAME) - } + testGroup("idea/tests", "compiler/testData") { + testClass { + model("loadJava/compiledKotlin") + } - testClass { - model("decompiler/decompiledText", pattern = """^([^\.]+)$""") - } + testClass { + model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") + } - testClass { - model("decompiler/decompiledTextJvm", pattern = """^([^\.]+)$""") - } + testClass { + model("asJava/lightClasses", excludeDirs = listOf("delegation", "script"), pattern = KT_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("decompiler/decompiledText", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) - } + testClass { + model("asJava/script/ide", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("decompiler/decompiledTextJs", pattern = """^([^\.]+)$""", targetBackend = TargetBackend.JS) + testClass { + model("asJava/lightClasses", excludeDirs = listOf("local", "compilationErrors", "ideRegression"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } } - testClass { - model("decompiler/stubBuilder", extension = null, recursive = false) - } + testGroup("idea/idea-completion/tests", "idea/idea-completion/testData") { + testClass { + model("injava", extension = "java", recursive = false) + } - testClass { - model("editor/optimizeImports/jvm", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - testClass { - model("editor/optimizeImports/js", pattern = KT_WITHOUT_DOTS_IN_NAME) - model("editor/optimizeImports/common", pattern = KT_WITHOUT_DOTS_IN_NAME) - } + testClass { + model("injava", extension = "java", recursive = false) + } - testClass { - model("debugger/exceptionFilter", pattern = """^([^\.]+)$""", recursive = false) - } + testClass { + model("injava/stdlib", extension = "java", recursive = false) + } - testClass { - model("stubs", extension = "kt") - } + testClass { + model("weighers/basic", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("multiFileHighlighting", recursive = false) - } + testClass { + model("weighers/smart", pattern = KT_WITHOUT_DOTS_IN_NAME) + } - testClass { - model("multiModuleHighlighting/multiplatform/", recursive = false, extension = null) - } + testClass { + model("basic/common") + model("basic/js") + } - testClass { - model("multiModuleHighlighting/hierarchicalExpectActualMatching/", recursive = false, extension = null) - } + testClass { + model("basic/common") + model("basic/java") + } + + testClass { + model("smart") + } - testClass { - model("multiModuleQuickFix", extension = null, deep = 1) - } + testClass { + model("keywords", recursive = false) + } + + testClass { + model("basic/withLib", recursive = false) + } - testClass { - model("navigation/implementations/multiModule", recursive = false, extension = null) - } - - testClass { - model("navigation/relatedSymbols/multiModule", recursive = false, extension = null) - } - - testClass { - model("navigation/gotoSuper/multiModule", recursive = false, extension = null) - } - - testClass { - model("refactoring/introduceVariable", pattern = KT_OR_KTS, testMethod = "doIntroduceVariableTest") - model("refactoring/extractFunction", pattern = KT_OR_KTS, testMethod = "doExtractFunctionTest") - model("refactoring/introduceProperty", pattern = KT_OR_KTS, testMethod = "doIntroducePropertyTest") - model("refactoring/introduceParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceSimpleParameterTest") - model("refactoring/introduceLambdaParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceLambdaParameterTest") - model("refactoring/introduceJavaParameter", extension = "java", testMethod = "doIntroduceJavaParameterTest") - model("refactoring/introduceTypeParameter", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeParameterTest") - model("refactoring/introduceTypeAlias", pattern = KT_OR_KTS, testMethod = "doIntroduceTypeAliasTest") - model("refactoring/extractSuperclass", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractSuperclassTest") - model("refactoring/extractInterface", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME, testMethod = "doExtractInterfaceTest") - } - - testClass { - model("refactoring/pullUp/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") - model("refactoring/pullUp/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") - model("refactoring/pullUp/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") - } - - testClass { - model("refactoring/pushDown/k2k", extension = "kt", singleClass = true, testClassName = "K2K", testMethod = "doKotlinTest") - model("refactoring/pushDown/k2j", extension = "kt", singleClass = true, testClassName = "K2J", testMethod = "doKotlinTest") - model("refactoring/pushDown/j2k", extension = "java", singleClass = true, testClassName = "J2K", testMethod = "doJavaTest") - } - - testClass { - model("coverage/outputFiles") - } - - testClass { - model("internal/toolWindow", recursive = false, extension = null) - } - - testClass("org.jetbrains.kotlin.idea.kdoc.KdocResolveTestGenerated") { - model("kdoc/resolve") - } - - testClass { - model("kdoc/highlighting") - } - - testClass { - model("kdoc/typing") - } - - testClass { - model("codeInsight/generate/testFrameworkSupport") - } - - testClass { - model("codeInsight/generate/equalsWithHashCode") - } - - testClass { - model("codeInsight/generate/secondaryConstructors") - } - - testClass { - model("codeInsight/generate/toString") - } - - testClass { - model("repl/completion") - } - - testClass { - model("codeInsight/postfix") - } - - testClass { - model("script/definition/highlighting", extension = null, recursive = false) - model("script/definition/complex", extension = null, recursive = false, testMethod = "doComplexTest") - } - - testClass { - model("script/definition/navigation", extension = null, recursive = false) - } - - testClass { - model("script/definition/completion", extension = null, recursive = false) - } - - testClass { - model("script/definition/order", extension = null, recursive = false) - } - - testClass { - model("refactoring/nameSuggestionProvider") - } - - testClass { - model("slicer", excludeDirs = listOf("mpp")) - } - - testClass { - model("slicer/inflow", singleClass = true) - } - - testClass { - model("slicer/inflow", singleClass = true) - } - - testClass { - model("slicer/mpp", recursive = false, extension = null) - } - } - - testGroup("idea/scripting-support/test", "idea/scripting-support/testData") { - testClass { - model("scratch", extension = "kts", testMethod = "doScratchCompilingTest", testClassName = "ScratchCompiling", recursive = false) - model("scratch", extension = "kts", testMethod = "doScratchReplTest", testClassName = "ScratchRepl", recursive = false) - model("scratch/multiFile", extension = null, testMethod = "doScratchMultiFileTest", testClassName = "ScratchMultiFile", recursive = false) - - model("worksheet", extension = "ws.kts", testMethod = "doWorksheetCompilingTest", testClassName = "WorksheetCompiling", recursive = false) - model("worksheet", extension = "ws.kts", testMethod = "doWorksheetReplTest", testClassName = "WorksheetRepl", recursive = false) - model("worksheet/multiFile", extension = null, testMethod = "doWorksheetMultiFileTest", testClassName = "WorksheetMultiFile", recursive = false) - - model("scratch/rightPanelOutput", extension = "kts", testMethod = "doRightPreviewPanelOutputTest", testClassName = "ScratchRightPanelOutput", recursive = false) - } - - testClass { - model("scratch/lineMarker", testMethod = "doScratchTest", pattern = KT_OR_KTS) - } - } - - /* - // Maven and Gradle are not relevant for AS branch - - testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { - testClass { - model("configurator/jvm", extension = null, recursive = false, testMethod = "doTestWithMaven") - model("configurator/js", extension = null, recursive = false, testMethod = "doTestWithJSMaven") - } - - testClass { - model("maven-inspections", pattern = "^([\\w\\-]+).xml$", singleClass = true) - } - } - - testGroup("idea/idea-gradle/tests", "idea/testData") { - testClass { - model("configuration/gradle", extension = null, recursive = false, testMethod = "doTestGradle") - model("configuration/gsk", extension = null, recursive = false, testMethod = "doTestGradle") - } - } + testClass { + model("handlers/basic", pattern = KT_WITHOUT_DOTS_IN_NAME) + } + testClass { + model("handlers/smart") + } + + testClass { + model("handlers/keywords") + } + + testClass { + model("handlers/charFilter") + } + + testClass { + model("basic/multifile", extension = null, recursive = false) + } + + testClass { + model("smartMultiFile", extension = null, recursive = false) + } + + testClass("KDocCompletionTestGenerated") { + model("kdoc") + } + + testClass { + model("basic/java8") + } + + testClass { + model("incrementalResolve") + } + + testClass { + model("multiPlatform", recursive = false, extension = null) + } + } + + //TODO: move these tests into idea-completion module + testGroup("idea/tests", "idea/idea-completion/testData") { + testClass { + model("handlers/runtimeCast") + } + + testClass { + model("basic/codeFragments", extension = "kt") + } + } + + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("fileOrElement", extension = "java") + } + } + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("multiFile", extension = null, recursive = false) + } + } + testGroup("j2k/tests", "j2k/testData") { + testClass { + model("fileOrElement", extension = "java") + } + } + + testGroup("nj2k/tests", "nj2k/testData") { + testClass { + model("newJ2k", pattern = """^([^\.]+)\.java$""") + } + testClass { + model("inference/common") + } + testClass { + model("inference/nullability") + } + testClass { + model("inference/mutability") + } + testClass { + model("copyPaste", pattern = """^([^\.]+)\.java$""") + } + testClass { + model("copyPastePlainText", pattern = """^([^\.]+)\.txt$""") + } + testClass { + model("multiFile", extension = null, recursive = false) + } + } + + /* There is no jps in AS + .... */ + testGroup("compiler/incremental-compilation-impl/test", "jps-plugin/testData") { + testClass { + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/classHierarchyAffected", extension = null, recursive = false) + model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true) + model("incremental/withJava", extension = null, excludeParentDirs = true) + model("incremental/incrementalJvmCompilerOnly", extension = null, excludeParentDirs = true) + } - testGroup("idea/tests", "compiler/testData") { - testClass { - model("loadJava/compiledKotlin") + testClass { + model("incremental/pureKotlin", extension = null, recursive = false) + model("incremental/classHierarchyAffected", extension = null, recursive = false) + model("incremental/js", extension = null, excludeParentDirs = true) + } + + testClass { + model("incremental/js/friendsModuleDisabled", extension = null, recursive = false) + } + + testClass { + model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) + } + testClass { + model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) + } } - testClass { - model("loadJava/compiledKotlin", testMethod = "doTestCompiledKotlin") + testGroup("plugins/android-extensions/android-extensions-compiler/test", "plugins/android-extensions/android-extensions-compiler/testData") { + testClass { + model("descriptors", recursive = false, extension = null) + } + + testClass { + model("codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest") + model("codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke") + } + + testClass { + model("codegen/bytecodeShape", recursive = false, extension = null) + } + + testClass { + model("parcel/codegen") + } } - testClass { - model("asJava/lightClasses", excludeDirs = listOf("delegation", "script"), pattern = KT_WITHOUT_DOTS_IN_NAME) + testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { + testClass { + model("converter") + } + + testClass { + model("kotlinRunner") + } } - testClass { - model("asJava/script/ide", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + testGroup("plugins/kapt3/kapt3-cli/test", "plugins/kapt3/kapt3-cli/testData") { + testClass { + model("argumentParsing", extension = "txt") + } + + testClass { + model("integration", recursive = false, extension = null) + } } - testClass { - model("asJava/lightClasses", excludeDirs = listOf("local", "compilationErrors", "ideRegression"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) + testGroup("plugins/allopen/allopen-cli/test", "plugins/allopen/allopen-cli/testData") { + testClass { + model("bytecodeListing", extension = "kt") + } } + + testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") { + testClass { + model("bytecodeListing", extension = "kt") + } + + testClass { + model("box", targetBackend = TargetBackend.JVM) + } + } + + testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") { + testClass { + model("diagnostics") + } + testClass { + model("script", extension = "kts") + } + } + + testGroup( + "plugins/kotlin-serialization/kotlin-serialization-compiler/test", + "plugins/kotlin-serialization/kotlin-serialization-compiler/testData" + ) { + testClass { + model("diagnostics") + } + + testClass { + model("codegen") + } + + testClass { + model("codegen") + } + } + /* + testGroup("plugins/android-extensions/android-extensions-idea/tests", "plugins/android-extensions/android-extensions-idea/testData") { + testClass { + model("android/completion", recursive = false, extension = null) + } + + testClass { + model("android/goto", recursive = false, extension = null) + } + + testClass { + model("android/rename", recursive = false, extension = null) + } + + testClass { + model("android/renameLayout", recursive = false, extension = null) + } + + testClass { + model("android/findUsages", recursive = false, extension = null) + } + + testClass { + model("android/usageHighlighting", recursive = false, extension = null) + } + + testClass { + model("android/extraction", recursive = false, extension = null) + } + + testClass { + model("android/parcel/checker", excludeParentDirs = true) + } + + testClass { + model("android/parcel/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + } + + testGroup("idea/idea-android/tests", "idea/testData") { + testClass { + model("configuration/android-gradle", pattern = """(\w+)_before\.gradle$""", testMethod = "doTestAndroidGradle") + model("configuration/android-gsk", pattern = """(\w+)_before\.gradle.kts$""", testMethod = "doTestAndroidGradle") + } + + testClass { + model("android/intention", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("android/resourceIntention", extension = "test", singleClass = true) + } + + testClass { + model("android/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") + } + + testClass { + model("android/lint", excludeParentDirs = true) + } + + testClass { + model("android/lintQuickfix", pattern = "^([\\w\\-_]+)\\.kt$") + } + + testClass { + model("android/folding") + } + + testClass { + model("android/gutterIcon") + } + } + */ } - - testGroup("idea/idea-completion/tests", "idea/idea-completion/testData") { - testClass { - model("injava", extension = "java", recursive = false) - } - - testClass { - model("injava", extension = "java", recursive = false) - } - - testClass { - model("injava/stdlib", extension = "java", recursive = false) - } - - testClass { - model("weighers/basic", pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("weighers/smart", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("basic/common") - model("basic/js") - } - - testClass { - model("basic/common") - model("basic/java") - } - - testClass { - model("smart") - } - - testClass { - model("keywords", recursive = false) - } - - testClass { - model("basic/withLib", recursive = false) - } - - testClass { - model("handlers/basic", pattern = KT_WITHOUT_DOTS_IN_NAME) - } - - testClass { - model("handlers/smart") - } - - testClass { - model("handlers/keywords") - } - - testClass { - model("handlers/charFilter") - } - - testClass { - model("basic/multifile", extension = null, recursive = false) - } - - testClass { - model("smartMultiFile", extension = null, recursive = false) - } - - testClass("KDocCompletionTestGenerated") { - model("kdoc") - } - - testClass { - model("basic/java8") - } - - testClass { - model("incrementalResolve") - } - - testClass { - model("multiPlatform", recursive = false, extension = null) - } - } - - //TODO: move these tests into idea-completion module - testGroup("idea/tests", "idea/idea-completion/testData") { - testClass { - model("handlers/runtimeCast") - } - - testClass { - model("basic/codeFragments", extension = "kt") - } - } - - testGroup("j2k/tests", "j2k/testData") { - testClass { - model("fileOrElement", extension = "java") - } - } - testGroup("j2k/tests", "j2k/testData") { - testClass { - model("multiFile", extension = null, recursive = false) - } - } - testGroup("j2k/tests", "j2k/testData") { - testClass { - model("fileOrElement", extension = "java") - } - } - - testGroup("nj2k/tests", "nj2k/testData") { - testClass { - model("newJ2k", pattern = """^([^\.]+)\.java$""") - } - testClass { - model("inference/common") - } - testClass { - model("inference/nullability") - } - testClass { - model("inference/mutability") - } - testClass { - model("copyPaste", pattern = """^([^\.]+)\.java$""") - } - testClass { - model("copyPastePlainText", pattern = """^([^\.]+)\.txt$""") - } - testClass { - model("multiFile", extension = null, recursive = false) - } - } - -/* There is no jps in AS - .... -*/ - testGroup("compiler/incremental-compilation-impl/test", "jps-plugin/testData") { - testClass { - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/classHierarchyAffected", extension = null, recursive = false) - model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true) - model("incremental/withJava", extension = null, excludeParentDirs = true) - model("incremental/incrementalJvmCompilerOnly", extension = null, excludeParentDirs = true) - } - - testClass { - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/classHierarchyAffected", extension = null, recursive = false) - model("incremental/js", extension = null, excludeParentDirs = true) - } - - testClass { - model("incremental/js/friendsModuleDisabled", extension = null, recursive = false) - } - - testClass { - model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) - } - testClass { - model("incremental/multiplatform/singleModule", extension = null, excludeParentDirs = true) - } - } - - testGroup("plugins/android-extensions/android-extensions-compiler/test", "plugins/android-extensions/android-extensions-compiler/testData") { - testClass { - model("descriptors", recursive = false, extension = null) - } - - testClass { - model("codegen/android", recursive = false, extension = null, testMethod = "doCompileAgainstAndroidSdkTest") - model("codegen/android", recursive = false, extension = null, testMethod = "doFakeInvocationTest", testClassName = "Invoke") - } - - testClass { - model("codegen/bytecodeShape", recursive = false, extension = null) - } - - testClass { - model("parcel/codegen") - } - } - - testGroup("plugins/kapt3/kapt3-compiler/test", "plugins/kapt3/kapt3-compiler/testData") { - testClass { - model("converter") - } - - testClass { - model("kotlinRunner") - } - } - - testGroup("plugins/kapt3/kapt3-cli/test", "plugins/kapt3/kapt3-cli/testData") { - testClass { - model("argumentParsing", extension = "txt") - } - - testClass { - model("integration", recursive = false, extension = null) - } - } - - testGroup("plugins/allopen/allopen-cli/test", "plugins/allopen/allopen-cli/testData") { - testClass { - model("bytecodeListing", extension = "kt") - } - } - - testGroup("plugins/noarg/noarg-cli/test", "plugins/noarg/noarg-cli/testData") { - testClass { - model("bytecodeListing", extension = "kt") - } - - testClass { - model("box", targetBackend = TargetBackend.JVM) - } - } - - testGroup("plugins/sam-with-receiver/sam-with-receiver-cli/test", "plugins/sam-with-receiver/sam-with-receiver-cli/testData") { - testClass { - model("diagnostics") - } - testClass { - model("script", extension = "kts") - } - } - - testGroup( - "plugins/kotlin-serialization/kotlin-serialization-compiler/test", - "plugins/kotlin-serialization/kotlin-serialization-compiler/testData" - ) { - testClass { - model("diagnostics") - } - - testClass { - model("codegen") - } - - testClass { - model("codegen") - } - } -/* - testGroup("plugins/android-extensions/android-extensions-idea/tests", "plugins/android-extensions/android-extensions-idea/testData") { - testClass { - model("android/completion", recursive = false, extension = null) - } - - testClass { - model("android/goto", recursive = false, extension = null) - } - - testClass { - model("android/rename", recursive = false, extension = null) - } - - testClass { - model("android/renameLayout", recursive = false, extension = null) - } - - testClass { - model("android/findUsages", recursive = false, extension = null) - } - - testClass { - model("android/usageHighlighting", recursive = false, extension = null) - } - - testClass { - model("android/extraction", recursive = false, extension = null) - } - - testClass { - model("android/parcel/checker", excludeParentDirs = true) - } - - testClass { - model("android/parcel/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } - } - - testGroup("idea/idea-android/tests", "idea/testData") { - testClass { - model("configuration/android-gradle", pattern = """(\w+)_before\.gradle$""", testMethod = "doTestAndroidGradle") - model("configuration/android-gsk", pattern = """(\w+)_before\.gradle.kts$""", testMethod = "doTestAndroidGradle") - } - - testClass { - model("android/intention", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("android/resourceIntention", extension = "test", singleClass = true) - } - - testClass { - model("android/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile") - } - - testClass { - model("android/lint", excludeParentDirs = true) - } - - testClass { - model("android/lintQuickfix", pattern = "^([\\w\\-_]+)\\.kt$") - } - - testClass { - model("android/folding") - } - - testClass { - model("android/gutterIcon") - } - } -*/ } diff --git a/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt b/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt index 77491216a62..fd9d1653dab 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt +++ b/js/js.tests/test/org/jetbrains/kotlin/generators/tests/GenerateJsTests.kt @@ -5,7 +5,7 @@ package org.jetbrains.kotlin.generators.tests -import org.jetbrains.kotlin.generators.tests.generator.testGroup +import org.jetbrains.kotlin.generators.tests.generator.testGroupSuite import org.jetbrains.kotlin.js.test.AbstractDceTest import org.jetbrains.kotlin.js.test.AbstractJsLineNumberTest import org.jetbrains.kotlin.js.test.es6.semantics.* @@ -14,90 +14,92 @@ import org.jetbrains.kotlin.js.test.semantics.* import org.jetbrains.kotlin.js.test.wasm.semantics.AbstractIrWasmBoxWasmTest import org.jetbrains.kotlin.test.TargetBackend -fun main() { +fun main(args: Array) { System.setProperty("java.awt.headless", "true") // TODO: repair these tests //generateTestDataForReservedWords() - testGroup("js/js.tests/test", "js/js.translator/testData", testRunnerMethodName = "runTest0") { - testClass { - model("box/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS) + testGroupSuite(args) { + testGroup("js/js.tests/test", "js/js.translator/testData", testRunnerMethodName = "runTest0") { + testClass { + model("box/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS) + } + + testClass { + model("box/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS_IR) + } + + testClass { + model("box/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS_IR_ES6) + } + + testClass { + model("typescript-export/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS_IR) + } + + testClass { + model("typescript-export/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS_IR_ES6) + } + + testClass { + model("typescript-export/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS) + } + + + testClass { + model("sourcemap/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS) + } + + testClass { + model("outputPrefixPostfix/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS) + } + + testClass { + model("dce/", pattern = "(.+)\\.js", targetBackend = TargetBackend.JS) + } + + testClass { + model("lineNumbers/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS) + } + + testClass { + model("wasmBox", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.WASM) + } + + testClass { + model("wasmBox", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS_IR) + } } - testClass { - model("box/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS_IR) - } + testGroup("js/js.tests/test", "compiler/testData", testRunnerMethodName = "runTest0") { + testClass { + model("codegen/box", targetBackend = TargetBackend.JS) + } - testClass { - model("box/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS_IR_ES6) - } + testClass { + model("codegen/box", targetBackend = TargetBackend.JS_IR) + } - testClass { - model("typescript-export/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS_IR) - } + testClass { + model("codegen/box", targetBackend = TargetBackend.JS_IR_ES6) + } - testClass { - model("typescript-export/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS_IR_ES6) - } + testClass { + model("codegen/boxInline/", targetBackend = TargetBackend.JS) + } - testClass { - model("typescript-export/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS) - } + testClass { + model("codegen/boxInline/", targetBackend = TargetBackend.JS_IR) + } + testClass { + model("codegen/boxInline/", targetBackend = TargetBackend.JS_IR_ES6) + } - testClass { - model("sourcemap/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS) - } - - testClass { - model("outputPrefixPostfix/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS) - } - - testClass { - model("dce/", pattern = "(.+)\\.js", targetBackend = TargetBackend.JS) - } - - testClass { - model("lineNumbers/", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS) - } - - testClass { - model("wasmBox", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.WASM) - } - - testClass { - model("wasmBox", pattern = "^([^_](.+))\\.kt$", targetBackend = TargetBackend.JS_IR) - } - } - - testGroup("js/js.tests/test", "compiler/testData", testRunnerMethodName = "runTest0") { - testClass { - model("codegen/box", targetBackend = TargetBackend.JS) - } - - testClass { - model("codegen/box", targetBackend = TargetBackend.JS_IR) - } - - testClass { - model("codegen/box", targetBackend = TargetBackend.JS_IR_ES6) - } - - testClass { - model("codegen/boxInline/", targetBackend = TargetBackend.JS) - } - - testClass { - model("codegen/boxInline/", targetBackend = TargetBackend.JS_IR) - } - - testClass { - model("codegen/boxInline/", targetBackend = TargetBackend.JS_IR_ES6) - } - - testClass { - model("codegen/box/arrays", targetBackend = TargetBackend.JS) + testClass { + model("codegen/box/arrays", targetBackend = TargetBackend.JS) + } } } } diff --git a/plugins/pill/generate-all-tests/test/org/jetbrains/kotlin/pill/generateAllTests/Main.java b/plugins/pill/generate-all-tests/test/org/jetbrains/kotlin/pill/generateAllTests/Main.java index 430e6a13bec..0d3b5a1b9ce 100644 --- a/plugins/pill/generate-all-tests/test/org/jetbrains/kotlin/pill/generateAllTests/Main.java +++ b/plugins/pill/generate-all-tests/test/org/jetbrains/kotlin/pill/generateAllTests/Main.java @@ -6,13 +6,24 @@ package org.jetbrains.kotlin.pill.generateAllTests; import org.jetbrains.kotlin.generators.tests.*; +import org.jetbrains.kotlin.generators.tests.generator.InconsistencyChecker; + +import java.util.List; public class Main { public static void main(String[] args) { - GenerateCompilerTestsKt.main(); - GenerateTestsKt.main(); - GenerateJsTestsKt.main(); - GenerateJava8TestsKt.main(); - GenerateRuntimeDescriptorTestsKt.main(); + GenerateCompilerTestsKt.main(args); + GenerateTestsKt.main(args); + GenerateJsTestsKt.main(args); + GenerateJava8TestsKt.main(args); + GenerateRuntimeDescriptorTestsKt.main(args); + + boolean dryRun = InconsistencyChecker.Companion.hasDryRunArg(args); + List affectedFiles = InconsistencyChecker.Companion.inconsistencyChecker(dryRun).getAffectedFiles(); + int size = affectedFiles.size(); + if (size > 0) { + throw new IllegalStateException("There " + (size == 1 ? "is a test" : "are " + size + " tests") + " to be regenerated:\n" + + String.join("\n", affectedFiles)); + } } }