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,223 +0,0 @@
/*
* 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 com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.LineSeparator;
import com.intellij.util.containers.ContainerUtil;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class GenerateRangesCodegenTestData {
private static final File TEST_DATA_DIR = new File("compiler/testData/codegen/box/ranges");
private static final File AS_LITERAL_DIR = new File(TEST_DATA_DIR, "literal");
private static final File AS_EXPRESSION_DIR = new File(TEST_DATA_DIR, "expression");
private static final File[] SOURCE_TEST_FILES = {
new File("libraries/stdlib/test/ranges/RangeIterationTest.kt"),
new File("libraries/stdlib/test/ranges/RangeIterationJVMTest.kt")
};
private static final Pattern TEST_FUN_PATTERN = Pattern.compile("@Test fun (\\w+)\\(\\) \\{.+?}", Pattern.DOTALL);
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";
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 Map<String, String> ELEMENT_TYPE_KNOWN_SUBSTRINGS = new ContainerUtil.ImmutableMapBuilder<String, String>()
.put("'", "Char")
.put("\"", "Char")
.put("Float.NaN", "Float")
.put("Double.NaN", "Double")
.put("MaxL", "Long")
.put("MinL", "Long")
.put("MaxC", "Char")
.put("MinC", "Char")
.build();
private static String detectElementType(String rangeExpression) {
Matcher matcher = Pattern.compile("\\.to(\\w+)").matcher(rangeExpression);
if (matcher.find()) {
String elementType = matcher.group(1);
return elementType.equals("Byte") || elementType.equals("Short") ? "Int" : elementType;
}
if (Pattern.compile("\\d\\.\\d").matcher(rangeExpression).find()) {
return "Double";
}
for (String substring : ELEMENT_TYPE_KNOWN_SUBSTRINGS.keySet()) {
if (rangeExpression.contains(substring)) {
return ELEMENT_TYPE_KNOWN_SUBSTRINGS.get(substring);
}
}
return "Int";
}
private static String renderTemplate(String template, int number, String elementType, String rangeExpression, String expectedListElements) {
return template
.replace("$RANGE_EXPR_ESCAPED", StringUtil.escapeStringCharacters(rangeExpression))
.replace("$RANGE_EXPR", rangeExpression)
.replace("$LIST_ELEMENTS", expectedListElements)
.replace("$LIST", "list" + number)
.replace("$RANGE", "range" + number)
.replace("$TYPE", elementType)
.replace("\n", LineSeparator.getSystemLineSeparator().getSeparatorString());
}
private static final List<String> INTEGER_PRIMITIVES = Arrays.asList("Integer", "Byte", "Short", "Long", "Character");
private static final List<String> IGNORED_FOR_JS_BACKEND = Arrays.asList(
"inexactDownToMinValue.kt",
"inexactToMaxValue.kt",
"maxValueMinusTwoToMaxValue.kt",
"maxValueToMaxValue.kt",
"maxValueToMinValue.kt",
"progressionDownToMinValue.kt",
"progressionMaxValueMinusTwoToMaxValue.kt",
"progressionMaxValueToMaxValue.kt",
"progressionMaxValueToMinValue.kt",
"progressionMinValueToMinValue.kt");
private static final List<String> IGNORED_FOR_NATIVE_BACKEND = Arrays.asList(
"inexactDownToMinValue.kt",
"inexactToMaxValue.kt",
"maxValueMinusTwoToMaxValue.kt",
"maxValueToMaxValue.kt",
"maxValueToMinValue.kt",
"progressionDownToMinValue.kt",
"progressionMaxValueMinusTwoToMaxValue.kt",
"progressionMaxValueToMaxValue.kt",
"progressionMaxValueToMinValue.kt",
"progressionMinValueToMinValue.kt"
);
private static void writeIgnoreBackendDirective(PrintWriter out, String backendName) {
out.printf("// TODO: muted automatically, investigate should it be ran for %s or not%n", backendName);
out.printf("// IGNORE_BACKEND: %s%n%n", backendName);
}
private static void writeToFile(File file, String generatedBody) {
PrintWriter out;
try {
//noinspection IOResourceOpenedButNotSafelyClosed
out = new PrintWriter(file);
}
catch (FileNotFoundException e) {
throw new AssertionError(e);
}
if (IGNORED_FOR_JS_BACKEND.contains(file.getName())) {
writeIgnoreBackendDirective(out, "JS");
}
if (IGNORED_FOR_NATIVE_BACKEND.contains(file.getName())) {
writeIgnoreBackendDirective(out, "NATIVE");
}
out.println("// Auto-generated by " + GenerateRangesCodegenTestData.class.getName() + ". DO NOT EDIT!");
out.println("// WITH_RUNTIME");
out.println();
if (generatedBody.contains("Max") || generatedBody.contains("Min")) {
// Import min/max values, but only in case when the generated test case actually uses them (not to clutter tests which don't)
out.println();
for (String primitive : INTEGER_PRIMITIVES) {
out.println("import java.lang." + primitive + ".MAX_VALUE as Max" + primitive.charAt(0));
out.println("import java.lang." + primitive + ".MIN_VALUE as Min" + primitive.charAt(0));
}
}
out.println();
out.println("fun box(): String {");
out.print(generatedBody);
out.println(" return \"OK\"");
out.println("}");
out.close();
}
public static void main(String[] args) {
try {
FileUtil.delete(AS_LITERAL_DIR);
FileUtil.delete(AS_EXPRESSION_DIR);
//noinspection ResultOfMethodCallIgnored
AS_LITERAL_DIR.mkdirs();
//noinspection ResultOfMethodCallIgnored
AS_EXPRESSION_DIR.mkdirs();
for (File file : SOURCE_TEST_FILES) {
String sourceContent = FileUtil.loadFile(file);
Matcher testFunMatcher = TEST_FUN_PATTERN.matcher(sourceContent);
while (testFunMatcher.find()) {
String testFunName = testFunMatcher.group(1);
if (testFunName.equals("emptyConstant")) {
continue;
}
String testFunText = testFunMatcher.group();
StringBuilder asLiteralBody = new StringBuilder();
StringBuilder asExpressionBody = new StringBuilder();
int index = 0;
Matcher matcher = SUBTEST_INVOCATION_PATTERN.matcher(testFunText);
while (matcher.find()) {
index++;
String rangeExpression = matcher.group(1);
String expectedListElements = matcher.group(2);
String elementType = detectElementType(rangeExpression);
asLiteralBody.append(renderTemplate(LITERAL_TEMPLATE, index, elementType, rangeExpression, expectedListElements));
asExpressionBody.append(renderTemplate(EXPRESSION_TEMPLATE, index, elementType, rangeExpression, expectedListElements));
}
String fileName = testFunName + ".kt";
writeToFile(new File(AS_LITERAL_DIR, fileName), asLiteralBody.toString());
writeToFile(new File(AS_EXPRESSION_DIR, fileName), asExpressionBody.toString());
}
}
}
catch (IOException e) {
throw new RuntimeException(e);
}
}
private GenerateRangesCodegenTestData() {
}
}
@@ -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"))