Extract GenerateCompilerTests out of GenerateTests

Rename the run configuration "Generate Tests" -> "Generate All Tests"
This commit is contained in:
Alexander Udalov
2017-10-19 19:02:42 +02:00
parent d0274c3c53
commit 8695c6a1e4
9 changed files with 409 additions and 350 deletions
@@ -1,8 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate Tests" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="Generate All Tests" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/generators" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
+20
View File
@@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate Compiler Tests" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/compiler" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="generateTests" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<method />
</configuration>
</component>
+3
View File
@@ -44,6 +44,7 @@ dependencies {
testCompileOnly(projectDist(":kotlin-test:kotlin-test-junit"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(projectTests(":compiler:tests-common-jvm6"))
testCompile(projectTests(":generators:test-generator"))
testCompile(project(":compiler:ir.ir2cfg"))
testCompile(project(":compiler:ir.tree")) // used for deepCopyWithSymbols call that is removed by proguard from the compiler TODO: make it more straightforward
testCompileOnly(project(":kotlin-daemon-client"))
@@ -168,3 +169,5 @@ codegenTest(target = 9, jvm = 9) {
systemProperty("kotlin.test.default.jvm.target", "1.8")
systemProperty("kotlin.test.substitute.bytecode.1.8.to.1.9", "true")
}
val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateCompilerTestsKt")
@@ -0,0 +1,354 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.generators.tests
import org.intellij.lang.annotations.Language
import org.jetbrains.kotlin.asJava.AbstractCompilerLightClassTest
import org.jetbrains.kotlin.cfg.AbstractControlFlowTest
import org.jetbrains.kotlin.cfg.AbstractDataFlowTest
import org.jetbrains.kotlin.cfg.AbstractDiagnosticsWithModifiedMockJdkTest
import org.jetbrains.kotlin.cfg.AbstractPseudoValueTest
import org.jetbrains.kotlin.checkers.*
import org.jetbrains.kotlin.checkers.javac.*
import org.jetbrains.kotlin.cli.AbstractCliTest
import org.jetbrains.kotlin.codegen.*
import org.jetbrains.kotlin.codegen.defaultConstructor.AbstractDefaultArgumentsReflectionTest
import org.jetbrains.kotlin.codegen.flags.AbstractWriteFlagsTest
import org.jetbrains.kotlin.codegen.ir.AbstractIrBlackBoxCodegenTest
import org.jetbrains.kotlin.generators.tests.generator.testGroup
import org.jetbrains.kotlin.integration.AbstractAntTaskTest
import org.jetbrains.kotlin.ir.AbstractIrCfgTestCase
import org.jetbrains.kotlin.ir.AbstractIrSourceRangesTestCase
import org.jetbrains.kotlin.ir.AbstractIrTextTestCase
import org.jetbrains.kotlin.jvm.compiler.*
import org.jetbrains.kotlin.jvm.compiler.javac.AbstractLoadJavaUsingJavacTest
import org.jetbrains.kotlin.jvm.runtime.AbstractJvmRuntimeDescriptorLoaderTest
import org.jetbrains.kotlin.kdoc.AbstractKDocLexerTest
import org.jetbrains.kotlin.modules.xml.AbstractModuleXmlParserTest
import org.jetbrains.kotlin.multiplatform.AbstractMultiPlatformIntegrationTest
import org.jetbrains.kotlin.parsing.AbstractParsingTest
import org.jetbrains.kotlin.renderer.AbstractDescriptorRendererTest
import org.jetbrains.kotlin.renderer.AbstractFunctionDescriptorInExpressionRendererTest
import org.jetbrains.kotlin.repl.AbstractReplInterpreterTest
import org.jetbrains.kotlin.resolve.AbstractResolveTest
import org.jetbrains.kotlin.resolve.annotation.AbstractAnnotationParameterTest
import org.jetbrains.kotlin.resolve.calls.AbstractResolvedCallsTest
import org.jetbrains.kotlin.resolve.calls.AbstractResolvedConstructorDelegationCallsTests
import org.jetbrains.kotlin.resolve.constants.evaluate.AbstractCompileTimeConstantEvaluatorTest
import org.jetbrains.kotlin.resolve.constraintSystem.AbstractConstraintSystemTest
import org.jetbrains.kotlin.serialization.AbstractLocalClassProtoTest
import org.jetbrains.kotlin.test.TargetBackend
import org.jetbrains.kotlin.types.AbstractTypeBindingTest
@Language("RegExp") const val KT_OR_KTS = """^(.+)\.(kt|kts)$"""
@Language("RegExp") const val KT_OR_KTS_WITHOUT_DOTS_IN_NAME = """^([^.]+)\.(kt|kts)$"""
@Language("RegExp") const val KT_WITHOUT_DOTS_IN_NAME = """^([^.]+)\.kt$"""
fun main(args: Array<String>) {
System.setProperty("java.awt.headless", "true")
testGroup("compiler/tests", "compiler/testData") {
testClass<AbstractDiagnosticsTest> {
model("diagnostics/tests")
model("diagnostics/tests/script", extension = "kts")
model("codegen/box/diagnostics")
}
testClass<AbstractDiagnosticsUsingJavacTest> {
model("diagnostics/tests")
model("codegen/box/diagnostics")
}
testClass<AbstractJavacDiagnosticsTest> {
model("javac/diagnostics/tests")
model("javac/diagnostics/tests", testClassName = "TestsWithoutJavac", testMethod = "doTestWithoutJavacWrapper")
}
testClass<AbstractJavacFieldResolutionTest> {
model("javac/fieldsResolution/tests")
model("javac/fieldsResolution/tests", testClassName = "TestsWithoutJavac", testMethod = "doTestWithoutJavacWrapper")
}
testClass<AbstractDiagnosticsTestWithStdLib> {
model("diagnostics/testsWithStdLib")
}
testClass<AbstractDiagnosticsTestWithStdLibUsingJavac> {
model("diagnostics/testsWithStdLib")
}
testClass<AbstractDiagnosticsTestWithJsStdLib> {
model("diagnostics/testsWithJsStdLib")
}
testClass<AbstractDiagnosticsTestWithJsStdLibAndBackendCompilation> {
model("diagnostics/testsWithJsStdLibAndBackendCompilation")
}
testClass<AbstractDiagnosticsWithModifiedMockJdkTest> {
model("diagnostics/testWithModifiedMockJdk")
}
testClass<AbstractDiagnosticsWithJdk9Test> {
model("diagnostics/testsWithJava9")
}
testClass<AbstractMultiPlatformIntegrationTest> {
model("multiplatform", extension = null, recursive = true, excludeParentDirs = true)
}
testClass<AbstractForeignAnnotationsTest> {
model("foreignAnnotations/tests")
}
testClass<AbstractForeignAnnotationsNoAnnotationInClasspathTest> {
model("foreignAnnotations/tests")
}
testClass<AbstractForeignAnnotationsNoAnnotationInClasspathWithFastClassReadingTest> {
model("foreignAnnotations/tests")
}
testClass<AbstractJavacForeignAnnotationsTest> {
model("foreignAnnotations/tests")
}
testClass<AbstractResolveTest> {
model("resolve", extension = "resolve")
}
testClass<AbstractResolvedCallsTest> {
model("resolvedCalls", excludeDirs = listOf("enhancedSignatures"))
}
testClass<AbstractResolvedConstructorDelegationCallsTests> {
model("resolveConstructorDelegationCalls")
}
testClass<AbstractConstraintSystemTest> {
model("constraintSystem", extension = "constraints")
}
testClass<AbstractParsingTest> {
model("psi", testMethod = "doParsingTest", pattern = "^(.*)\\.kts?$")
model("parseCodeFragment/expression", testMethod = "doExpressionCodeFragmentParsingTest", extension = "kt")
model("parseCodeFragment/block", testMethod = "doBlockCodeFragmentParsingTest", extension = "kt")
}
GenerateRangesCodegenTestData.main(emptyArray<String>())
testClass<AbstractBlackBoxCodegenTest> {
model("codegen/box", targetBackend = TargetBackend.JVM)
}
testClass<AbstractLightAnalysisModeTest> {
model("codegen/box", targetBackend = TargetBackend.JVM, skipIgnored = true)
}
testClass<AbstractKapt3BuilderModeBytecodeShapeTest> {
model("codegen/kapt", targetBackend = TargetBackend.JVM)
}
testClass<AbstractIrBlackBoxCodegenTest>("IrOnlyBoxCodegenTestGenerated") {
model("ir/box", targetBackend = TargetBackend.JVM)
}
testClass<AbstractBlackBoxInlineCodegenTest> {
model("codegen/boxInline")
}
testClass<AbstractCompileKotlinAgainstInlineKotlinTest> {
model("codegen/boxInline")
}
testClass<AbstractBlackBoxAgainstJavaCodegenTest> {
model("codegen/boxAgainstJava")
}
testClass<AbstractScriptCodegenTest> {
model("codegen/script", extension = "kts")
}
testClass<AbstractBytecodeTextTest> {
model("codegen/bytecodeText")
}
testClass<AbstractIrTextTestCase> {
model("ir/irText")
}
testClass<AbstractIrCfgTestCase> {
model("ir/irCfg")
}
testClass<AbstractIrSourceRangesTestCase> {
model("ir/sourceRanges")
}
testClass<AbstractBytecodeListingTest> {
model("codegen/bytecodeListing")
}
testClass<AbstractTopLevelMembersInvocationTest> {
model("codegen/topLevelMemberInvocation", extension = null, recursive = false)
}
testClass<AbstractCheckLocalVariablesTableTest> {
model("checkLocalVariablesTable")
}
testClass<AbstractWriteFlagsTest> {
model("writeFlags")
}
testClass<AbstractDefaultArgumentsReflectionTest> {
model("codegen/defaultArguments/reflection")
}
testClass<AbstractDumpDeclarationsTest> {
model("codegen/dumpDeclarations")
}
testClass<AbstractLoadJavaTest> {
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<AbstractLoadJavaUsingJavacTest> {
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<AbstractLoadKotlinWithTypeTableTest> {
model("loadJava/compiledKotlin")
}
testClass<AbstractJvmRuntimeDescriptorLoaderTest> {
model("loadJava/compiledKotlin")
model("loadJava/compiledJava", extension = "java", excludeDirs = listOf("sam", "kotlinSignature/propagation"))
}
testClass<AbstractLoadJavaWithFastClassReadingTest> {
model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava")
}
testClass<AbstractCompileJavaAgainstKotlinTest> {
model("compileJavaAgainstKotlin", testClassName = "WithoutJavac", testMethod = "doTestWithoutJavac")
model("compileJavaAgainstKotlin", testClassName = "WithJavac", testMethod = "doTestWithJavac")
}
testClass<AbstractCompileKotlinAgainstJavaTest> {
model("compileKotlinAgainstJava")
}
testClass<AbstractCompileKotlinAgainstKotlinTest> {
model("compileKotlinAgainstKotlin")
}
testClass<AbstractDescriptorRendererTest> {
model("renderer")
}
testClass<AbstractFunctionDescriptorInExpressionRendererTest> {
model("renderFunctionDescriptorInExpression")
}
testClass<AbstractModuleXmlParserTest> {
model("modules.xml", extension = "xml")
}
testClass<AbstractWriteSignatureTest> {
model("writeSignature")
}
testClass<AbstractCliTest> {
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)
}
testClass<AbstractReplInterpreterTest> {
model("repl", extension = "repl")
}
testClass<AbstractAntTaskTest> {
model("integration/ant/jvm", extension = null, recursive = false, excludeParentDirs = true)
}
testClass<AbstractControlFlowTest> {
model("cfg")
model("cfgWithStdLib", testMethod = "doTestWithStdLib")
}
testClass<AbstractDataFlowTest> {
model("cfg-variables")
model("cfgVariablesWithStdLib", testMethod = "doTestWithStdLib")
}
testClass<AbstractPseudoValueTest> {
model("cfg")
model("cfgWithStdLib", testMethod = "doTestWithStdLib")
model("cfg-variables")
model("cfgVariablesWithStdLib", testMethod = "doTestWithStdLib")
}
testClass<AbstractAnnotationParameterTest> {
model("resolveAnnotations/parameters")
}
testClass<AbstractCompileTimeConstantEvaluatorTest> {
model("evaluate/constant", testMethod = "doConstantTest")
model("evaluate/isPure", testMethod = "doIsPureTest")
model("evaluate/usesVariableAsConstant", testMethod = "doUsesVariableAsConstantTest")
}
testClass<AbstractCompilerLightClassTest> {
model("asJava/lightClasses", excludeDirs = listOf("local", "ideRegression"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME)
}
testClass<AbstractTypeBindingTest> {
model("type/binding")
}
testClass<AbstractLineNumberTest> {
model("lineNumber", recursive = false)
model("lineNumber/custom", testMethod = "doTestCustom")
}
testClass<AbstractLocalClassProtoTest> {
model("serialization/local")
}
testClass<AbstractKDocLexerTest> {
model("kdoc/lexer")
}
}
}
@@ -44,26 +44,26 @@ public class GenerateRangesCodegenTestData {
private static final Pattern SUBTEST_INVOCATION_PATTERN = Pattern.compile("doTest\\(([^,]+), [^,]+, [^,]+, [^,]+,\\s+listOf[\\w<>]*\\(([^\\n]*)\\)\\)", Pattern.DOTALL);
// $LIST.size() check is needed in order for tests not to run forever
public static final String LITERAL_TEMPLATE = " val $LIST = ArrayList<$TYPE>()\n" +
" for (i in $RANGE_EXPR) {\n" +
" $LIST.add(i)\n" +
" if ($LIST.size > 23) break\n" +
" }\n" +
" if ($LIST != listOf<$TYPE>($LIST_ELEMENTS)) {\n" +
" return \"Wrong elements for $RANGE_EXPR_ESCAPED: $$LIST\"\n" +
" }\n" +
"\n";
private static final String LITERAL_TEMPLATE = " val $LIST = ArrayList<$TYPE>()\n" +
" for (i in $RANGE_EXPR) {\n" +
" $LIST.add(i)\n" +
" if ($LIST.size > 23) break\n" +
" }\n" +
" if ($LIST != listOf<$TYPE>($LIST_ELEMENTS)) {\n" +
" return \"Wrong elements for $RANGE_EXPR_ESCAPED: $$LIST\"\n" +
" }\n" +
"\n";
public static final String EXPRESSION_TEMPLATE = " val $LIST = ArrayList<$TYPE>()\n" +
" val $RANGE = $RANGE_EXPR\n" +
" for (i in $RANGE) {\n" +
" $LIST.add(i)\n" +
" if ($LIST.size > 23) break\n" +
" }\n" +
" if ($LIST != listOf<$TYPE>($LIST_ELEMENTS)) {\n" +
" return \"Wrong elements for $RANGE_EXPR_ESCAPED: $$LIST\"\n" +
" }\n" +
"\n";
private static final String EXPRESSION_TEMPLATE = " val $LIST = ArrayList<$TYPE>()\n" +
" val $RANGE = $RANGE_EXPR\n" +
" for (i in $RANGE) {\n" +
" $LIST.add(i)\n" +
" if ($LIST.size > 23) break\n" +
" }\n" +
" if ($LIST != listOf<$TYPE>($LIST_ELEMENTS)) {\n" +
" return \"Wrong elements for $RANGE_EXPR_ESCAPED: $$LIST\"\n" +
" }\n" +
"\n";
private static final Map<String, String> ELEMENT_TYPE_KNOWN_SUBSTRINGS = new ContainerUtil.ImmutableMapBuilder<String, String>()
.put("'", "Char")
@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.generators.tests
import org.intellij.lang.annotations.Language
import org.jetbrains.kotlin.AbstractDataFlowValueRenderingTest
import org.jetbrains.kotlin.addImport.AbstractAddImportTest
import org.jetbrains.kotlin.allopen.AbstractBytecodeListingTestForAllOpen
@@ -34,16 +33,11 @@ import org.jetbrains.kotlin.android.synthetic.test.AbstractAndroidBoxTest
import org.jetbrains.kotlin.android.synthetic.test.AbstractAndroidBytecodeShapeTest
import org.jetbrains.kotlin.android.synthetic.test.AbstractAndroidSyntheticPropertyDescriptorTest
import org.jetbrains.kotlin.annotation.AbstractAnnotationProcessorBoxTest
import org.jetbrains.kotlin.asJava.AbstractCompilerLightClassTest
import org.jetbrains.kotlin.cfg.AbstractControlFlowTest
import org.jetbrains.kotlin.cfg.AbstractDataFlowTest
import org.jetbrains.kotlin.cfg.AbstractDiagnosticsWithModifiedMockJdkTest
import org.jetbrains.kotlin.cfg.AbstractPseudoValueTest
import org.jetbrains.kotlin.checkers.*
import org.jetbrains.kotlin.checkers.javac.*
import org.jetbrains.kotlin.cli.AbstractCliTest
import org.jetbrains.kotlin.codegen.*
import org.jetbrains.kotlin.codegen.defaultConstructor.AbstractDefaultArgumentsReflectionTest
import org.jetbrains.kotlin.checkers.javac.AbstractJavacForeignJava8AnnotationsTest
import org.jetbrains.kotlin.codegen.AbstractBlackBoxCodegenTest
import org.jetbrains.kotlin.codegen.AbstractBytecodeTextTest
import org.jetbrains.kotlin.codegen.AbstractCompileKotlinAgainstKotlinTest
import org.jetbrains.kotlin.codegen.flags.AbstractWriteFlagsTest
import org.jetbrains.kotlin.codegen.ir.AbstractIrBlackBoxCodegenTest
import org.jetbrains.kotlin.codegen.ir.AbstractIrBlackBoxInlineCodegenTest
@@ -145,10 +139,6 @@ import org.jetbrains.kotlin.idea.stubs.AbstractResolveByStubTest
import org.jetbrains.kotlin.idea.stubs.AbstractStubBuilderTest
import org.jetbrains.kotlin.incremental.AbstractIncrementalJsCompilerRunnerTest
import org.jetbrains.kotlin.incremental.AbstractIncrementalJvmCompilerRunnerTest
import org.jetbrains.kotlin.integration.AbstractAntTaskTest
import org.jetbrains.kotlin.ir.AbstractIrCfgTestCase
import org.jetbrains.kotlin.ir.AbstractIrSourceRangesTestCase
import org.jetbrains.kotlin.ir.AbstractIrTextTestCase
import org.jetbrains.kotlin.j2k.AbstractJavaToKotlinConverterForWebDemoTest
import org.jetbrains.kotlin.j2k.AbstractJavaToKotlinConverterMultiFileTest
import org.jetbrains.kotlin.j2k.AbstractJavaToKotlinConverterSingleFileTest
@@ -159,337 +149,27 @@ import org.jetbrains.kotlin.jps.incremental.AbstractJvmProtoComparisonTest
import org.jetbrains.kotlin.js.test.AbstractDceTest
import org.jetbrains.kotlin.js.test.AbstractJsLineNumberTest
import org.jetbrains.kotlin.js.test.semantics.*
import org.jetbrains.kotlin.jvm.compiler.*
import org.jetbrains.kotlin.jvm.compiler.AbstractJava8WriteSignatureTest
import org.jetbrains.kotlin.jvm.compiler.AbstractLoadJava8Test
import org.jetbrains.kotlin.jvm.compiler.AbstractLoadJava8WithFastClassReadingTest
import org.jetbrains.kotlin.jvm.compiler.javac.AbstractLoadJava8UsingJavacTest
import org.jetbrains.kotlin.jvm.compiler.javac.AbstractLoadJavaUsingJavacTest
import org.jetbrains.kotlin.jvm.runtime.AbstractJvm8RuntimeDescriptorLoaderTest
import org.jetbrains.kotlin.jvm.runtime.AbstractJvmRuntimeDescriptorLoaderTest
import org.jetbrains.kotlin.kapt3.test.AbstractClassFileToSourceStubConverterTest
import org.jetbrains.kotlin.kapt3.test.AbstractKotlinKaptContextTest
import org.jetbrains.kotlin.kdoc.AbstractKDocLexerTest
import org.jetbrains.kotlin.modules.xml.AbstractModuleXmlParserTest
import org.jetbrains.kotlin.multiplatform.AbstractMultiPlatformIntegrationTest
import org.jetbrains.kotlin.noarg.AbstractBlackBoxCodegenTestForNoArg
import org.jetbrains.kotlin.noarg.AbstractBytecodeListingTestForNoArg
import org.jetbrains.kotlin.parsing.AbstractParsingTest
import org.jetbrains.kotlin.psi.patternMatching.AbstractPsiUnifierTest
import org.jetbrains.kotlin.renderer.AbstractDescriptorRendererTest
import org.jetbrains.kotlin.renderer.AbstractFunctionDescriptorInExpressionRendererTest
import org.jetbrains.kotlin.repl.AbstractReplInterpreterTest
import org.jetbrains.kotlin.resolve.AbstractResolveTest
import org.jetbrains.kotlin.resolve.annotation.AbstractAnnotationParameterTest
import org.jetbrains.kotlin.resolve.calls.AbstractEnhancedSignaturesResolvedCallsTest
import org.jetbrains.kotlin.resolve.calls.AbstractResolvedCallsTest
import org.jetbrains.kotlin.resolve.calls.AbstractResolvedConstructorDelegationCallsTests
import org.jetbrains.kotlin.resolve.constants.evaluate.AbstractCompileTimeConstantEvaluatorTest
import org.jetbrains.kotlin.resolve.constraintSystem.AbstractConstraintSystemTest
import org.jetbrains.kotlin.samWithReceiver.AbstractSamWithReceiverScriptTest
import org.jetbrains.kotlin.samWithReceiver.AbstractSamWithReceiverTest
import org.jetbrains.kotlin.search.AbstractAnnotatedMembersSearchTest
import org.jetbrains.kotlin.search.AbstractInheritorsSearchTest
import org.jetbrains.kotlin.serialization.AbstractLocalClassProtoTest
import org.jetbrains.kotlin.shortenRefs.AbstractShortenRefsTest
import org.jetbrains.kotlin.test.TargetBackend
import org.jetbrains.kotlin.types.AbstractTypeBindingTest
@Language("RegExp") private const val KT_OR_KTS = """^(.+)\.(kt|kts)$"""
@Language("RegExp") private const val KT_OR_KTS_WITHOUT_DOTS_IN_NAME = """^([^.]+)\.(kt|kts)$"""
@Language("RegExp") private const val KT_WITHOUT_DOTS_IN_NAME = """^([^.]+)\.kt$"""
fun main(args: Array<String>) {
System.setProperty("java.awt.headless", "true")
testGroup("compiler/tests", "compiler/testData") {
testClass<AbstractDiagnosticsTest> {
model("diagnostics/tests")
model("diagnostics/tests/script", extension = "kts")
model("codegen/box/diagnostics")
}
testClass<AbstractDiagnosticsUsingJavacTest> {
model("diagnostics/tests")
model("codegen/box/diagnostics")
}
testClass<AbstractJavacDiagnosticsTest> {
model("javac/diagnostics/tests")
model("javac/diagnostics/tests", testClassName = "TestsWithoutJavac", testMethod = "doTestWithoutJavacWrapper")
}
testClass<AbstractJavacFieldResolutionTest> {
model("javac/fieldsResolution/tests")
model("javac/fieldsResolution/tests", testClassName = "TestsWithoutJavac", testMethod = "doTestWithoutJavacWrapper")
}
testClass<AbstractDiagnosticsTestWithStdLib> {
model("diagnostics/testsWithStdLib")
}
testClass<AbstractDiagnosticsTestWithStdLibUsingJavac> {
model("diagnostics/testsWithStdLib")
}
testClass<AbstractDiagnosticsTestWithJsStdLib> {
model("diagnostics/testsWithJsStdLib")
}
testClass<AbstractDiagnosticsTestWithJsStdLibAndBackendCompilation> {
model("diagnostics/testsWithJsStdLibAndBackendCompilation")
}
testClass<AbstractDiagnosticsWithModifiedMockJdkTest> {
model("diagnostics/testWithModifiedMockJdk")
}
testClass<AbstractDiagnosticsWithJdk9Test> {
model("diagnostics/testsWithJava9")
}
testClass<AbstractMultiPlatformIntegrationTest> {
model("multiplatform", extension = null, recursive = true, excludeParentDirs = true)
}
testClass<AbstractForeignAnnotationsTest> {
model("foreignAnnotations/tests")
}
testClass<AbstractForeignAnnotationsNoAnnotationInClasspathTest> {
model("foreignAnnotations/tests")
}
testClass<AbstractForeignAnnotationsNoAnnotationInClasspathWithFastClassReadingTest> {
model("foreignAnnotations/tests")
}
testClass<AbstractJavacForeignAnnotationsTest> {
model("foreignAnnotations/tests")
}
testClass<AbstractResolveTest> {
model("resolve", extension = "resolve")
}
testClass<AbstractResolvedCallsTest> {
model("resolvedCalls", excludeDirs = listOf("enhancedSignatures"))
}
testClass<AbstractResolvedConstructorDelegationCallsTests> {
model("resolveConstructorDelegationCalls")
}
testClass<AbstractConstraintSystemTest> {
model("constraintSystem", extension = "constraints")
}
testClass<AbstractParsingTest> {
model("psi", testMethod = "doParsingTest", pattern = "^(.*)\\.kts?$")
model("parseCodeFragment/expression", testMethod = "doExpressionCodeFragmentParsingTest", extension = "kt")
model("parseCodeFragment/block", testMethod = "doBlockCodeFragmentParsingTest", extension = "kt")
}
GenerateRangesCodegenTestData.main(arrayOf<String>())
testClass<AbstractBlackBoxCodegenTest> {
model("codegen/box", targetBackend = TargetBackend.JVM)
}
testClass<AbstractLightAnalysisModeTest> {
model("codegen/box", targetBackend = TargetBackend.JVM, skipIgnored = true)
}
testClass<AbstractKapt3BuilderModeBytecodeShapeTest> {
model("codegen/kapt", targetBackend = TargetBackend.JVM)
}
testClass<AbstractIrBlackBoxCodegenTest>("IrOnlyBoxCodegenTestGenerated") {
model("ir/box", targetBackend = TargetBackend.JVM)
}
testClass<AbstractBlackBoxInlineCodegenTest> {
model("codegen/boxInline")
}
testClass<AbstractCompileKotlinAgainstInlineKotlinTest> {
model("codegen/boxInline")
}
testClass<AbstractBlackBoxAgainstJavaCodegenTest> {
model("codegen/boxAgainstJava")
}
testClass<AbstractScriptCodegenTest> {
model("codegen/script", extension = "kts")
}
testClass<AbstractBytecodeTextTest> {
model("codegen/bytecodeText")
}
testClass<AbstractIrTextTestCase> {
model("ir/irText")
}
testClass<AbstractIrCfgTestCase> {
model("ir/irCfg")
}
testClass<AbstractIrSourceRangesTestCase> {
model("ir/sourceRanges")
}
testClass<AbstractBytecodeListingTest> {
model("codegen/bytecodeListing")
}
testClass<AbstractTopLevelMembersInvocationTest> {
model("codegen/topLevelMemberInvocation", extension = null, recursive = false)
}
testClass<AbstractCheckLocalVariablesTableTest> {
model("checkLocalVariablesTable")
}
testClass<AbstractWriteFlagsTest> {
model("writeFlags")
}
testClass<AbstractDefaultArgumentsReflectionTest> {
model("codegen/defaultArguments/reflection")
}
testClass<AbstractDumpDeclarationsTest> {
model("codegen/dumpDeclarations")
}
testClass<AbstractLoadJavaTest> {
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<AbstractLoadJavaUsingJavacTest> {
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<AbstractLoadKotlinWithTypeTableTest> {
model("loadJava/compiledKotlin")
}
testClass<AbstractJvmRuntimeDescriptorLoaderTest> {
model("loadJava/compiledKotlin")
model("loadJava/compiledJava", extension = "java", excludeDirs = listOf("sam", "kotlinSignature/propagation"))
}
testClass<AbstractLoadJavaWithFastClassReadingTest> {
model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava")
}
testClass<AbstractCompileJavaAgainstKotlinTest> {
model("compileJavaAgainstKotlin", testClassName = "WithoutJavac", testMethod = "doTestWithoutJavac")
model("compileJavaAgainstKotlin", testClassName = "WithJavac", testMethod = "doTestWithJavac")
}
testClass<AbstractCompileKotlinAgainstJavaTest> {
model("compileKotlinAgainstJava")
}
testClass<AbstractCompileKotlinAgainstKotlinTest> {
model("compileKotlinAgainstKotlin")
}
testClass<AbstractDescriptorRendererTest> {
model("renderer")
}
testClass<AbstractFunctionDescriptorInExpressionRendererTest> {
model("renderFunctionDescriptorInExpression")
}
testClass<AbstractModuleXmlParserTest> {
model("modules.xml", extension = "xml")
}
testClass<AbstractWriteSignatureTest> {
model("writeSignature")
}
testClass<AbstractCliTest> {
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)
}
testClass<AbstractReplInterpreterTest> {
model("repl", extension = "repl")
}
testClass<AbstractAntTaskTest> {
model("integration/ant/jvm", extension = null, recursive = false, excludeParentDirs = true)
}
testClass<AbstractControlFlowTest> {
model("cfg")
model("cfgWithStdLib", testMethod = "doTestWithStdLib")
}
testClass<AbstractDataFlowTest> {
model("cfg-variables")
model("cfgVariablesWithStdLib", testMethod = "doTestWithStdLib")
}
testClass<AbstractPseudoValueTest> {
model("cfg")
model("cfgWithStdLib", testMethod = "doTestWithStdLib")
model("cfg-variables")
model("cfgVariablesWithStdLib", testMethod = "doTestWithStdLib")
}
testClass<AbstractAnnotationParameterTest> {
model("resolveAnnotations/parameters")
}
testClass<AbstractCompileTimeConstantEvaluatorTest> {
model("evaluate/constant", testMethod = "doConstantTest")
model("evaluate/isPure", testMethod = "doIsPureTest")
model("evaluate/usesVariableAsConstant", testMethod = "doUsesVariableAsConstantTest")
}
testClass<AbstractCompilerLightClassTest> {
model("asJava/lightClasses", excludeDirs = listOf("local", "ideRegression"), pattern = KT_OR_KTS_WITHOUT_DOTS_IN_NAME)
}
testClass<AbstractTypeBindingTest> {
model("type/binding")
}
testClass<AbstractLineNumberTest> {
model("lineNumber", recursive = false)
model("lineNumber/custom", testMethod = "doTestCustom")
}
testClass<AbstractLocalClassProtoTest> {
model("serialization/local")
}
testClass<AbstractKDocLexerTest> {
model("kdoc/lexer")
}
}
testGroup("compiler/tests-ir-jvm/tests", "compiler/testData") {
testClass<AbstractIrBlackBoxCodegenTest> {
model("codegen/box", targetBackend = TargetBackend.JVM)
@@ -1,6 +1,8 @@
apply { plugin("kotlin") }
jvmTarget = "1.6"
dependencies {
testCompile(project(":core:util.runtime"))
testCompile(projectTests(":compiler:tests-common"))
+1 -1
View File
@@ -57,9 +57,9 @@ dependencies {
testCompile(project(":idea:idea-test-framework")) { isTransitive = false }
testCompile(project(":plugins:lint")) { isTransitive = false }
testCompile(project(":idea:idea-jvm")) { isTransitive = false }
testCompile(project(":generators")) { isTransitive = false }
testCompile(projectTests(":compiler:tests-common"))
testCompile(projectTests(":idea"))
testCompile(projectTests(":generators:test-generator"))
testCompile(commonDep("junit:junit"))
testCompile(ideaUltimateSdkDeps("gson"))
testCompile(preloadedDeps("kotlinx-coroutines-core"))
@@ -16,7 +16,7 @@
package org.jetbrains.kotlin.tests
import org.jetbrains.kotlin.generators.tests.testGroup
import org.jetbrains.kotlin.generators.tests.generator.*
import org.jetbrains.kotlin.idea.spring.tests.findUsages.AbstractSpringFindUsagesTest
import org.jetbrains.kotlin.idea.spring.tests.generate.AbstractGenerateSpringDependencyActionTest
import org.jetbrains.kotlin.idea.spring.tests.gutter.AbstractSpringClassAnnotatorTest