From e7371d2c1afc6b73b9a4ce845e363d5ce8d9c94f Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Tue, 1 Mar 2016 16:45:44 +0300 Subject: [PATCH] Minor, move boxAgainstJava logic to a separate test class --- .../AbstractBlackBoxAgainstJavaCodegenTest.kt | 46 ++++++++++++++++ .../codegen/AbstractBlackBoxCodegenTest.java | 34 +++--------- ...ackBoxAgainstJavaCodegenTestGenerated.java | 54 +++++++++---------- .../kotlin/generators/tests/GenerateTests.kt | 7 ++- 4 files changed, 86 insertions(+), 55 deletions(-) create mode 100644 compiler/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxAgainstJavaCodegenTest.kt diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxAgainstJavaCodegenTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxAgainstJavaCodegenTest.kt new file mode 100644 index 00000000000..0aee0ba4af2 --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxAgainstJavaCodegenTest.kt @@ -0,0 +1,46 @@ +/* + * Copyright 2010-2016 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.codegen + +import com.intellij.ide.highlighter.JavaFileType +import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles +import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment +import org.jetbrains.kotlin.test.ConfigurationKind +import org.jetbrains.kotlin.test.KotlinTestUtils +import org.jetbrains.kotlin.test.TestJdkKind +import java.io.File + +abstract class AbstractBlackBoxAgainstJavaCodegenTest : AbstractBlackBoxCodegenTest() { + override fun createEnvironment(jdkKind: TestJdkKind, javaSourceDir: File?) { + val javaOutputDir = javaSourceDir?.let { javaSourceDir -> + val javaSourceFilePaths = javaSourceDir.walk().mapNotNull { file -> + if (file.isFile && file.extension == JavaFileType.DEFAULT_EXTENSION) { + file.path + } + else null + }.toList() + + CodegenTestUtil.compileJava(javaSourceFilePaths, emptyList(), emptyList()) + } + + val configuration = KotlinTestUtils.compilerConfigurationForTests( + ConfigurationKind.ALL, jdkKind, KotlinTestUtils.getAnnotationsJar(), javaOutputDir + ) + + myEnvironment = KotlinCoreEnvironment.createForTests(testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES) + } +} diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxCodegenTest.java b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxCodegenTest.java index d00eb3376bc..ee43aaba2a3 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxCodegenTest.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractBlackBoxCodegenTest.java @@ -83,7 +83,7 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase { blackBoxFileByFullPath(filename); } - private void doTestMultiFile(@NotNull List files, @Nullable File javaSourceDir) throws Exception { + private void doTestMultiFile(@NotNull List files, @Nullable File javaSourceDir) { TestJdkKind jdkKind = TestJdkKind.MOCK_JDK; for (TestFile file : files) { if (isFullJdkDirectiveDefined(file.content)) { @@ -92,35 +92,17 @@ public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase { } } - File javaOutputDir; - if (javaSourceDir != null) { - final List javaSourceFilePaths = new ArrayList(); - FileUtil.processFilesRecursively(javaSourceDir, new Processor() { - @Override - public boolean process(File file) { - if (file.isFile() && file.getName().endsWith(".java")) { - javaSourceFilePaths.add(file.getPath()); - } - return true; - } - }); - - javaOutputDir = compileJava(javaSourceFilePaths, Collections.emptyList(), Collections.emptyList()); - } - else { - javaOutputDir = null; - } - - CompilerConfiguration configuration = - compilerConfigurationForTests(ConfigurationKind.ALL, jdkKind, getAnnotationsJar(), javaOutputDir); - - myEnvironment = - KotlinCoreEnvironment.createForTests(getTestRootDisposable(), configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES); - + createEnvironment(jdkKind, javaSourceDir); loadMultiFiles(files); blackBox(); } + protected void createEnvironment(@NotNull TestJdkKind jdkKind, @Nullable File javaSourceDir) { + CompilerConfiguration configuration = compilerConfigurationForTests(ConfigurationKind.ALL, jdkKind, getAnnotationsJar()); + myEnvironment = + KotlinCoreEnvironment.createForTests(getTestRootDisposable(), configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES); + } + // NOTE: tests under fullJdk/ are run with FULL_JDK instead of MOCK_JDK @NotNull private static TestJdkKind getTestJdkKind(@NotNull String sourcePath) { diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxAgainstJavaCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxAgainstJavaCodegenTestGenerated.java index 30a81608dbd..2c163e07c86 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxAgainstJavaCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxAgainstJavaCodegenTestGenerated.java @@ -30,7 +30,7 @@ import java.util.regex.Pattern; @TestMetadata("compiler/testData/codegen/boxAgainstJava") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) -public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCodegenTest { +public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInBoxAgainstJava() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -38,7 +38,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/annotations") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Annotations extends AbstractBlackBoxCodegenTest { + public static class Annotations extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInAnnotations() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/annotations"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -94,7 +94,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/annotations/kClassMapping") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class KClassMapping extends AbstractBlackBoxCodegenTest { + public static class KClassMapping extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInKClassMapping() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/annotations/kClassMapping"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -140,7 +140,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/callableReference") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class CallableReference extends AbstractBlackBoxCodegenTest { + public static class CallableReference extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInCallableReference() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/callableReference"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -173,7 +173,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/constructor") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Constructor extends AbstractBlackBoxCodegenTest { + public static class Constructor extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInConstructor() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/constructor"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -194,7 +194,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/delegation") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Delegation extends AbstractBlackBoxCodegenTest { + public static class Delegation extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInDelegation() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/delegation"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -209,7 +209,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/enum") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Enum extends AbstractBlackBoxCodegenTest { + public static class Enum extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInEnum() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/enum"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -254,7 +254,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/functions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Functions extends AbstractBlackBoxCodegenTest { + public static class Functions extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInFunctions() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/functions"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -293,7 +293,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/innerClass") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class InnerClass extends AbstractBlackBoxCodegenTest { + public static class InnerClass extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInInnerClass() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/innerClass"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -320,7 +320,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/interfaces") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Interfaces extends AbstractBlackBoxCodegenTest { + public static class Interfaces extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInInterfaces() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/interfaces"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -335,7 +335,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/notNullAssertions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class NotNullAssertions extends AbstractBlackBoxCodegenTest { + public static class NotNullAssertions extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInNotNullAssertions() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/notNullAssertions"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -356,7 +356,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/platformTypes") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class PlatformTypes extends AbstractBlackBoxCodegenTest { + public static class PlatformTypes extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInPlatformTypes() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/platformTypes"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -371,7 +371,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/property") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Property extends AbstractBlackBoxCodegenTest { + public static class Property extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInProperty() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/property"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -398,7 +398,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/reflection") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Reflection extends AbstractBlackBoxCodegenTest { + public static class Reflection extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInReflection() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/reflection"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -406,7 +406,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/reflection/classLiterals") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ClassLiterals extends AbstractBlackBoxCodegenTest { + public static class ClassLiterals extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInClassLiterals() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/reflection/classLiterals"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -421,7 +421,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/reflection/mapping") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Mapping extends AbstractBlackBoxCodegenTest { + public static class Mapping extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInMapping() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/reflection/mapping"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -454,7 +454,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/reflection/properties") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Properties extends AbstractBlackBoxCodegenTest { + public static class Properties extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInProperties() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/reflection/properties"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -470,7 +470,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/sam") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Sam extends AbstractBlackBoxCodegenTest { + public static class Sam extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInSam() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/sam"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -502,7 +502,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/sam/adapters") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Adapters extends AbstractBlackBoxCodegenTest { + public static class Adapters extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInAdapters() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/sam/adapters"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -678,7 +678,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/sam/adapters/operators") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Operators extends AbstractBlackBoxCodegenTest { + public static class Operators extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInOperators() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/sam/adapters/operators"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -755,7 +755,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/specialBuiltins") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class SpecialBuiltins extends AbstractBlackBoxCodegenTest { + public static class SpecialBuiltins extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInSpecialBuiltins() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/specialBuiltins"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -770,7 +770,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/staticFun") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class StaticFun extends AbstractBlackBoxCodegenTest { + public static class StaticFun extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInStaticFun() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/staticFun"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -785,7 +785,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/syntheticExtensions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class SyntheticExtensions extends AbstractBlackBoxCodegenTest { + public static class SyntheticExtensions extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInSyntheticExtensions() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/syntheticExtensions"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -854,7 +854,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/visibility") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Visibility extends AbstractBlackBoxCodegenTest { + public static class Visibility extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInVisibility() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/visibility"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -862,7 +862,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/visibility/package") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Package extends AbstractBlackBoxCodegenTest { + public static class Package extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInPackage() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/visibility/package"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -895,7 +895,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/visibility/protectedAndPackage") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ProtectedAndPackage extends AbstractBlackBoxCodegenTest { + public static class ProtectedAndPackage extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInProtectedAndPackage() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/visibility/protectedAndPackage"), Pattern.compile("^(.+)\\.kt$"), true); } @@ -928,7 +928,7 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxCod @TestMetadata("compiler/testData/codegen/boxAgainstJava/visibility/protectedStatic") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ProtectedStatic extends AbstractBlackBoxCodegenTest { + public static class ProtectedStatic extends AbstractBlackBoxAgainstJavaCodegenTest { public void testAllFilesPresentInProtectedStatic() throws Exception { KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/visibility/protectedStatic"), Pattern.compile("^(.+)\\.kt$"), true); } diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 8d920dcd37c..e3e5247d2ad 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -111,7 +111,10 @@ import org.jetbrains.kotlin.jps.build.* import org.jetbrains.kotlin.jps.build.android.AbstractAndroidJpsTestCase import org.jetbrains.kotlin.jps.incremental.AbstractProtoComparisonTest import org.jetbrains.kotlin.js.test.semantics.* -import org.jetbrains.kotlin.jvm.compiler.* +import org.jetbrains.kotlin.jvm.compiler.AbstractCompileJavaAgainstKotlinTest +import org.jetbrains.kotlin.jvm.compiler.AbstractLoadJavaTest +import org.jetbrains.kotlin.jvm.compiler.AbstractLoadKotlinWithTypeTableTest +import org.jetbrains.kotlin.jvm.compiler.AbstractWriteSignatureTest import org.jetbrains.kotlin.jvm.runtime.AbstractJvmRuntimeDescriptorLoaderTest import org.jetbrains.kotlin.lang.resolve.android.test.AbstractAndroidBoxTest import org.jetbrains.kotlin.lang.resolve.android.test.AbstractAndroidBytecodeShapeTest @@ -205,7 +208,7 @@ fun main(args: Array) { model("codegen/boxMultiFile") } - testClass("BlackBoxAgainstJavaCodegenTestGenerated") { + testClass() { model("codegen/boxAgainstJava") }