Generate black box codegen tests

This commit is contained in:
Alexander Udalov
2013-01-25 17:02:54 +04:00
committed by Alexander Udalov
parent 5313cf3bf0
commit f7e0b06c2f
4 changed files with 3294 additions and 18 deletions
@@ -1,5 +1,5 @@
/* /*
* Copyright 2010-2012 JetBrains s.r.o. * Copyright 2010-2013 JetBrains s.r.o.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -19,17 +19,10 @@ package org.jetbrains.jet.codegen.generated;
import org.jetbrains.jet.ConfigurationKind; import org.jetbrains.jet.ConfigurationKind;
import org.jetbrains.jet.codegen.CodegenTestCase; import org.jetbrains.jet.codegen.CodegenTestCase;
import java.io.IOException; public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase {
public abstract class AbstractCodegenTest extends CodegenTestCase {
@Override @Override
public void setUp() throws Exception { public void setUp() throws Exception {
super.setUp(); super.setUp();
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY); createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
} }
protected void doTest(String path) throws IOException {
blackBoxFileByFullPath(path);
}
} }
@@ -24,12 +24,12 @@ import org.jetbrains.jet.JetTestUtils;
import org.jetbrains.jet.test.InnerTestClasses; import org.jetbrains.jet.test.InnerTestClasses;
import org.jetbrains.jet.test.TestMetadata; import org.jetbrains.jet.test.TestMetadata;
import org.jetbrains.jet.codegen.generated.AbstractCodegenTest; import org.jetbrains.jet.codegen.generated.AbstractBlackBoxCodegenTest;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */ /** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all") @SuppressWarnings("all")
@TestMetadata("compiler/testData/codegen/visibility/withJava/protected_static") @TestMetadata("compiler/testData/codegen/visibility/withJava/protected_static")
public class VisibilityGenWithJavaTestGenerated extends AbstractCodegenTest { public class VisibilityGenWithJavaTestGenerated extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInProtected_static() throws Exception { public void testAllFilesPresentInProtected_static() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/visibility/withJava/protected_static"), "kt", true); JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/visibility/withJava/protected_static"), "kt", true);
} }
@@ -24,12 +24,8 @@ import org.jetbrains.jet.codegen.AbstractCheckLocalVariablesTableTest;
import org.jetbrains.jet.codegen.AbstractDataClassCodegenTest; import org.jetbrains.jet.codegen.AbstractDataClassCodegenTest;
import org.jetbrains.jet.codegen.defaultConstructor.AbstractDefaultConstructorCodegenTest; import org.jetbrains.jet.codegen.defaultConstructor.AbstractDefaultConstructorCodegenTest;
import org.jetbrains.jet.codegen.flags.AbstractWriteFlagsTest; import org.jetbrains.jet.codegen.flags.AbstractWriteFlagsTest;
import org.jetbrains.jet.codegen.generated.AbstractCodegenTest; import org.jetbrains.jet.codegen.generated.AbstractBlackBoxCodegenTest;
import org.jetbrains.jet.jvm.compiler.AbstractCompileJavaAgainstKotlinTest; import org.jetbrains.jet.jvm.compiler.*;
import org.jetbrains.jet.jvm.compiler.AbstractCompileKotlinAgainstKotlinTest;
import org.jetbrains.jet.jvm.compiler.AbstractCompileKotlinAgainstCustomJavaTest;
import org.jetbrains.jet.jvm.compiler.AbstractLoadCompiledKotlinTest;
import org.jetbrains.jet.jvm.compiler.AbstractLoadJavaTest;
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveDescriptorRendererTest; import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveDescriptorRendererTest;
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveNamespaceComparingTest; import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveNamespaceComparingTest;
import org.jetbrains.jet.plugin.highlighter.AbstractDeprecatedHighlightingTest; import org.jetbrains.jet.plugin.highlighter.AbstractDeprecatedHighlightingTest;
@@ -67,6 +63,13 @@ public class GenerateTests {
testModel("compiler/testData/diagnostics/tests/script", true, "ktscript", "doTest") testModel("compiler/testData/diagnostics/tests/script", true, "ktscript", "doTest")
); );
generateTest(
"compiler/tests/",
"BlackBoxCodegenTestGenerated",
AbstractBlackBoxCodegenTest.class,
testModel("compiler/testData/codegen/box", "blackBoxFileByFullPath")
);
generateTest( generateTest(
"compiler/tests/", "compiler/tests/",
"DataClassCodegenTestGenerated", "DataClassCodegenTestGenerated",
@@ -84,7 +87,7 @@ public class GenerateTests {
generateTest( generateTest(
"compiler/tests/", "compiler/tests/",
"VisibilityGenWithJavaTestGenerated", "VisibilityGenWithJavaTestGenerated",
AbstractCodegenTest.class, AbstractBlackBoxCodegenTest.class,
testModel("compiler/testData/codegen/visibility/withJava/protected_static", "blackBoxFileWithJavaByFullPath") testModel("compiler/testData/codegen/visibility/withJava/protected_static", "blackBoxFileWithJavaByFullPath")
); );