Renamed CompilerSpecialMode to ConfigurationKind, gave enum constants more clear names.
This commit is contained in:
+2
-2
@@ -21,6 +21,7 @@ import com.intellij.openapi.util.io.FileUtil;
|
|||||||
import com.intellij.openapi.util.text.StringUtil;
|
import com.intellij.openapi.util.text.StringUtil;
|
||||||
import com.intellij.testFramework.UsefulTestCase;
|
import com.intellij.testFramework.UsefulTestCase;
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.CompileEnvironmentUtil;
|
import org.jetbrains.jet.cli.jvm.compiler.CompileEnvironmentUtil;
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||||
@@ -28,7 +29,6 @@ import org.jetbrains.jet.codegen.*;
|
|||||||
import org.jetbrains.jet.compiler.PathManager;
|
import org.jetbrains.jet.compiler.PathManager;
|
||||||
import org.jetbrains.jet.lang.psi.JetFile;
|
import org.jetbrains.jet.lang.psi.JetFile;
|
||||||
import org.jetbrains.jet.lang.psi.JetPsiFactory;
|
import org.jetbrains.jet.lang.psi.JetPsiFactory;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
import org.jetbrains.jet.test.generator.Printer;
|
import org.jetbrains.jet.test.generator.Printer;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -51,7 +51,7 @@ public class CodegenTestsOnAndroidGenerator extends UsefulTestCase {
|
|||||||
private final String baseTestClassName = "AbstractCodegenTestCaseOnAndroid";
|
private final String baseTestClassName = "AbstractCodegenTestCaseOnAndroid";
|
||||||
private final String generatorName = "CodegenTestsOnAndroidGenerator";
|
private final String generatorName = "CodegenTestsOnAndroidGenerator";
|
||||||
|
|
||||||
private JetCoreEnvironment environmentWithMockJdk = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.JDK_HEADERS);
|
private JetCoreEnvironment environmentWithMockJdk = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_ONLY);
|
||||||
private JetCoreEnvironment environmentWithFullJdk = JetTestUtils.createEnvironmentWithFullJdk(myTestRootDisposable);
|
private JetCoreEnvironment environmentWithFullJdk = JetTestUtils.createEnvironmentWithFullJdk(myTestRootDisposable);
|
||||||
|
|
||||||
private final Pattern packagePattern = Pattern.compile("package (.*)");
|
private final Pattern packagePattern = Pattern.compile("package (.*)");
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ package org.jetbrains.jet;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.cli.jvm.JVMConfigurationKeys;
|
import org.jetbrains.jet.cli.jvm.JVMConfigurationKeys;
|
||||||
import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileBuiltins;
|
import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileBuiltins;
|
||||||
import org.jetbrains.jet.codegen.forTestCompile.ForTestPackJdkAnnotations;
|
|
||||||
import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime;
|
import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime;
|
||||||
|
import org.jetbrains.jet.codegen.forTestCompile.ForTestPackJdkAnnotations;
|
||||||
import org.jetbrains.jet.config.CompilerConfiguration;
|
import org.jetbrains.jet.config.CompilerConfiguration;
|
||||||
import org.jetbrains.jet.utils.PathUtil;
|
import org.jetbrains.jet.utils.PathUtil;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -29,8 +29,8 @@ import java.io.File;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.jetbrains.jet.CompilerSpecialMode.REGULAR;
|
import static org.jetbrains.jet.ConfigurationKind.ALL;
|
||||||
import static org.jetbrains.jet.CompilerSpecialMode.STDLIB;
|
import static org.jetbrains.jet.ConfigurationKind.JDK_AND_ANNOTATIONS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Stepan Koltsov
|
* @author Stepan Koltsov
|
||||||
@@ -52,16 +52,15 @@ public class CompileCompilerDependenciesTest {
|
|||||||
ForTestCompileRuntime.runtimeJarForTests();
|
ForTestCompileRuntime.runtimeJarForTests();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CompilerConfiguration compilerConfigurationForTests(@NotNull CompilerSpecialMode compilerSpecialMode, boolean mockJdk) {
|
public static CompilerConfiguration compilerConfigurationForTests(@NotNull ConfigurationKind configurationKind, boolean mockJdk) {
|
||||||
List<File> classpath = new ArrayList<File>();
|
List<File> classpath = new ArrayList<File>();
|
||||||
if (includeJdk(compilerSpecialMode)) {
|
classpath.add(mockJdk ? JetTestUtils.findMockJdkRtJar() : PathUtil.findRtJar());
|
||||||
classpath.add(mockJdk ? JetTestUtils.findMockJdkRtJar() : PathUtil.findRtJar());
|
if (configurationKind == ALL) {
|
||||||
}
|
|
||||||
if (includeKotlinRuntime(compilerSpecialMode)) {
|
|
||||||
classpath.add(ForTestCompileRuntime.runtimeJarForTests());
|
classpath.add(ForTestCompileRuntime.runtimeJarForTests());
|
||||||
}
|
}
|
||||||
|
|
||||||
File[] annotationsPath = new File[0];
|
File[] annotationsPath = new File[0];
|
||||||
if (includeJdkAnnotations(compilerSpecialMode)) {
|
if (configurationKind == ALL || configurationKind == JDK_AND_ANNOTATIONS) {
|
||||||
annotationsPath = new File[]{ForTestPackJdkAnnotations.jdkAnnotationsForTests()};
|
annotationsPath = new File[]{ForTestPackJdkAnnotations.jdkAnnotationsForTests()};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,16 +69,4 @@ public class CompileCompilerDependenciesTest {
|
|||||||
configuration.putUserData(JVMConfigurationKeys.ANNOTATIONS_PATH_KEY, annotationsPath);
|
configuration.putUserData(JVMConfigurationKeys.ANNOTATIONS_PATH_KEY, annotationsPath);
|
||||||
return configuration;
|
return configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean includeJdkAnnotations(@NotNull CompilerSpecialMode mode) {
|
|
||||||
return mode == REGULAR || mode == STDLIB;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean includeKotlinRuntime(@NotNull CompilerSpecialMode mode) {
|
|
||||||
return mode == REGULAR;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean includeJdk(@NotNull CompilerSpecialMode mode) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-11
@@ -16,15 +16,8 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet;
|
package org.jetbrains.jet;
|
||||||
|
|
||||||
/**
|
public enum ConfigurationKind {
|
||||||
* @author Stepan Koltsov
|
JDK_ONLY,
|
||||||
*/
|
JDK_AND_ANNOTATIONS,
|
||||||
public enum CompilerSpecialMode {
|
ALL,
|
||||||
REGULAR,
|
|
||||||
BUILTINS,
|
|
||||||
JDK_HEADERS,
|
|
||||||
STDLIB,
|
|
||||||
IDEA,
|
|
||||||
JS,
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
@@ -70,11 +70,11 @@ public abstract class JetLiteFixture extends UsefulTestCase {
|
|||||||
myEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(getTestRootDisposable());
|
myEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(getTestRootDisposable());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createEnvironmentWithMockJdkAndIdeaAnnotations(@NotNull CompilerSpecialMode compilerSpecialMode) {
|
protected void createEnvironmentWithMockJdkAndIdeaAnnotations(@NotNull ConfigurationKind configurationKind) {
|
||||||
if (myEnvironment != null) {
|
if (myEnvironment != null) {
|
||||||
throw new IllegalStateException("must not set up myEnvironment twice");
|
throw new IllegalStateException("must not set up myEnvironment twice");
|
||||||
}
|
}
|
||||||
myEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(getTestRootDisposable(), compilerSpecialMode);
|
myEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(getTestRootDisposable(), configurationKind);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createEnvironmentWithFullJdk() {
|
protected void createEnvironmentWithFullJdk() {
|
||||||
|
|||||||
@@ -176,12 +176,12 @@ public class JetTestUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static JetCoreEnvironment createEnvironmentWithMockJdkAndIdeaAnnotations(Disposable disposable) {
|
public static JetCoreEnvironment createEnvironmentWithMockJdkAndIdeaAnnotations(Disposable disposable) {
|
||||||
return createEnvironmentWithMockJdkAndIdeaAnnotations(disposable, CompilerSpecialMode.REGULAR);
|
return createEnvironmentWithMockJdkAndIdeaAnnotations(disposable, ConfigurationKind.ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JetCoreEnvironment createEnvironmentWithMockJdkAndIdeaAnnotations(Disposable disposable, @NotNull CompilerSpecialMode compilerSpecialMode) {
|
public static JetCoreEnvironment createEnvironmentWithMockJdkAndIdeaAnnotations(Disposable disposable, @NotNull ConfigurationKind configurationKind) {
|
||||||
JetCoreEnvironment environment = new JetCoreEnvironment(disposable,
|
JetCoreEnvironment environment = new JetCoreEnvironment(disposable,
|
||||||
CompileCompilerDependenciesTest.compilerConfigurationForTests(compilerSpecialMode, true)
|
CompileCompilerDependenciesTest.compilerConfigurationForTests(configurationKind, true)
|
||||||
);
|
);
|
||||||
environment.addToClasspath(getAnnotationsJar());
|
environment.addToClasspath(getAnnotationsJar());
|
||||||
return environment;
|
return environment;
|
||||||
@@ -254,7 +254,7 @@ public class JetTestUtils {
|
|||||||
|
|
||||||
public static JetCoreEnvironment createEnvironmentWithFullJdk(Disposable disposable) {
|
public static JetCoreEnvironment createEnvironmentWithFullJdk(Disposable disposable) {
|
||||||
return new JetCoreEnvironment(disposable,
|
return new JetCoreEnvironment(disposable,
|
||||||
CompileCompilerDependenciesTest.compilerConfigurationForTests(CompilerSpecialMode.REGULAR, false)
|
CompileCompilerDependenciesTest.compilerConfigurationForTests(ConfigurationKind.ALL, false)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import com.intellij.openapi.util.text.StringUtil;
|
|||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.JetLiteFixture;
|
import org.jetbrains.jet.JetLiteFixture;
|
||||||
import org.jetbrains.jet.JetTestCaseBuilder;
|
import org.jetbrains.jet.JetTestCaseBuilder;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
@@ -33,7 +34,6 @@ import org.jetbrains.jet.lang.BuiltinsScopeExtensionMode;
|
|||||||
import org.jetbrains.jet.lang.cfg.pseudocode.*;
|
import org.jetbrains.jet.lang.cfg.pseudocode.*;
|
||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
@@ -57,7 +57,7 @@ public class JetControlFlowTest extends JetLiteFixture {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import com.intellij.psi.PsiFile;
|
|||||||
import com.intellij.psi.PsiFileFactory;
|
import com.intellij.psi.PsiFileFactory;
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.JetLiteFixture;
|
import org.jetbrains.jet.JetLiteFixture;
|
||||||
import org.jetbrains.jet.JetTestCaseBuilder;
|
import org.jetbrains.jet.JetTestCaseBuilder;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
@@ -36,7 +37,6 @@ import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter;
|
|||||||
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
|
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
import org.jetbrains.jet.utils.ExceptionUtils;
|
import org.jetbrains.jet.utils.ExceptionUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -60,7 +60,7 @@ public class JetDiagnosticsTest extends JetLiteFixture {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.STDLIB);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_AND_ANNOTATIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import jet.JetObject;
|
import jet.JetObject;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.*;
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
@@ -29,7 +29,7 @@ public class AnnotationGenTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPropField() throws NoSuchFieldException, NoSuchMethodException {
|
public void testPropField() throws NoSuchFieldException, NoSuchMethodException {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ public class ArrayGenTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt238 () throws Exception {
|
public void testKt238 () throws Exception {
|
||||||
|
|||||||
@@ -16,16 +16,16 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
public class BridgeMethodGenTest extends CodegenTestCase {
|
public class BridgeMethodGenTest extends CodegenTestCase {
|
||||||
public void testBridgeMethod () throws Exception {
|
public void testBridgeMethod () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("bridge.jet");
|
blackBoxFile("bridge.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1959() {
|
public void testKt1959() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1959.kt");
|
blackBoxFile("regressions/kt1959.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
@@ -35,7 +35,7 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPSVMClass() throws Exception {
|
public void testPSVMClass() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile("classes/simpleClass.jet");
|
loadFile("classes/simpleClass.jet");
|
||||||
|
|
||||||
final Class aClass = loadClass("SimpleClass", generateClassesInFile());
|
final Class aClass = loadClass("SimpleClass", generateClassesInFile());
|
||||||
@@ -46,7 +46,7 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testArrayListInheritance() throws Exception {
|
public void testArrayListInheritance() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile("classes/inheritingFromArrayList.jet");
|
loadFile("classes/inheritingFromArrayList.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Class aClass = loadClass("Foo", generateClassesInFile());
|
final Class aClass = loadClass("Foo", generateClassesInFile());
|
||||||
@@ -54,37 +54,37 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testInheritanceAndDelegation_DelegatingDefaultConstructorProperties() throws Exception {
|
public void testInheritanceAndDelegation_DelegatingDefaultConstructorProperties() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/inheritance.jet");
|
blackBoxFile("classes/inheritance.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInheritanceAndDelegation2() throws Exception {
|
public void testInheritanceAndDelegation2() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/delegation2.kt");
|
blackBoxFile("classes/delegation2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testFunDelegation() throws Exception {
|
public void testFunDelegation() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/funDelegation.jet");
|
blackBoxFile("classes/funDelegation.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPropertyDelegation() throws Exception {
|
public void testPropertyDelegation() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/propertyDelegation.jet");
|
blackBoxFile("classes/propertyDelegation.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDiamondInheritance() throws Exception {
|
public void testDiamondInheritance() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/diamondInheritance.jet");
|
blackBoxFile("classes/diamondInheritance.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testRightHandOverride() throws Exception {
|
public void testRightHandOverride() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/rightHandOverride.jet");
|
blackBoxFile("classes/rightHandOverride.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNewInstanceExplicitConstructor() throws Exception {
|
public void testNewInstanceExplicitConstructor() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile("classes/newInstanceDefaultConstructor.jet");
|
loadFile("classes/newInstanceDefaultConstructor.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method method = generateFunction("test");
|
final Method method = generateFunction("test");
|
||||||
@@ -93,22 +93,22 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testInnerClass() throws Exception {
|
public void testInnerClass() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/innerClass.jet");
|
blackBoxFile("classes/innerClass.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInheritedInnerClass() throws Exception {
|
public void testInheritedInnerClass() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/inheritedInnerClass.jet");
|
blackBoxFile("classes/inheritedInnerClass.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInitializerBlock() throws Exception {
|
public void testInitializerBlock() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/initializerBlock.jet");
|
blackBoxFile("classes/initializerBlock.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAbstractMethod() throws Exception {
|
public void testAbstractMethod() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("abstract class Foo { abstract fun x(): String; fun y(): Int = 0 }");
|
loadText("abstract class Foo { abstract fun x(): String; fun y(): Int = 0 }");
|
||||||
|
|
||||||
final ClassFileFactory codegens = generateClassesInFile();
|
final ClassFileFactory codegens = generateClassesInFile();
|
||||||
@@ -118,42 +118,42 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testInheritedMethod() throws Exception {
|
public void testInheritedMethod() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/inheritedMethod.jet");
|
blackBoxFile("classes/inheritedMethod.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInitializerBlockDImpl() throws Exception {
|
public void testInitializerBlockDImpl() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/initializerBlockDImpl.jet");
|
blackBoxFile("classes/initializerBlockDImpl.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPropertyInInitializer() throws Exception {
|
public void testPropertyInInitializer() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/propertyInInitializer.jet");
|
blackBoxFile("classes/propertyInInitializer.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOuterThis() throws Exception {
|
public void testOuterThis() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/outerThis.jet");
|
blackBoxFile("classes/outerThis.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSecondaryConstructors() throws Exception {
|
public void testSecondaryConstructors() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/secondaryConstructors.jet");
|
blackBoxFile("classes/secondaryConstructors.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testExceptionConstructor() throws Exception {
|
public void testExceptionConstructor() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/exceptionConstructor.jet");
|
blackBoxFile("classes/exceptionConstructor.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimpleBox() throws Exception {
|
public void testSimpleBox() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/simpleBox.jet");
|
blackBoxFile("classes/simpleBox.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAbstractClass() throws Exception {
|
public void testAbstractClass() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("abstract class SimpleClass() { }");
|
loadText("abstract class SimpleClass() { }");
|
||||||
|
|
||||||
final Class aClass = createClassLoader(generateClassesInFile()).loadClass("SimpleClass");
|
final Class aClass = createClassLoader(generateClassesInFile()).loadClass("SimpleClass");
|
||||||
@@ -161,18 +161,18 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testClassObject() throws Exception {
|
public void testClassObject() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/classObject.jet");
|
blackBoxFile("classes/classObject.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testClassObjectMethod() throws Exception {
|
public void testClassObjectMethod() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
// todo to be implemented after removal of type info
|
// todo to be implemented after removal of type info
|
||||||
// blackBoxFile("classes/classObjectMethod.jet");
|
// blackBoxFile("classes/classObjectMethod.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testClassObjectInterface() throws Exception {
|
public void testClassObjectInterface() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile("classes/classObjectInterface.jet");
|
loadFile("classes/classObjectInterface.jet");
|
||||||
final Method method = generateFunction();
|
final Method method = generateFunction();
|
||||||
Object result = method.invoke(null);
|
Object result = method.invoke(null);
|
||||||
@@ -180,32 +180,32 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadBinaryOperator() throws Exception {
|
public void testOverloadBinaryOperator() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/overloadBinaryOperator.jet");
|
blackBoxFile("classes/overloadBinaryOperator.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadUnaryOperator() throws Exception {
|
public void testOverloadUnaryOperator() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/overloadUnaryOperator.jet");
|
blackBoxFile("classes/overloadUnaryOperator.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadPlusAssign() throws Exception {
|
public void testOverloadPlusAssign() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/overloadPlusAssign.jet");
|
blackBoxFile("classes/overloadPlusAssign.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadPlusAssignReturn() throws Exception {
|
public void testOverloadPlusAssignReturn() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/overloadPlusAssignReturn.jet");
|
blackBoxFile("classes/overloadPlusAssignReturn.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadPlusToPlusAssign() throws Exception {
|
public void testOverloadPlusToPlusAssign() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/overloadPlusToPlusAssign.jet");
|
blackBoxFile("classes/overloadPlusToPlusAssign.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testEnumClass() throws Exception {
|
public void testEnumClass() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("enum class Direction { NORTH; SOUTH; EAST; WEST }");
|
loadText("enum class Direction { NORTH; SOUTH; EAST; WEST }");
|
||||||
final Class direction = createClassLoader(generateClassesInFile()).loadClass("Direction");
|
final Class direction = createClassLoader(generateClassesInFile()).loadClass("Direction");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
@@ -215,7 +215,7 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testEnumConstantConstructors() throws Exception {
|
public void testEnumConstantConstructors() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("enum class Color(val rgb: Int) { RED: Color(0xFF0000); GREEN: Color(0x00FF00); }");
|
loadText("enum class Color(val rgb: Int) { RED: Color(0xFF0000); GREEN: Color(0x00FF00); }");
|
||||||
final Class colorClass = createClassLoader(generateClassesInFile()).loadClass("Color");
|
final Class colorClass = createClassLoader(generateClassesInFile()).loadClass("Color");
|
||||||
final Field redField = colorClass.getField("RED");
|
final Field redField = colorClass.getField("RED");
|
||||||
@@ -225,35 +225,35 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testClassObjFields() throws Exception {
|
public void testClassObjFields() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("class A() { class object { val value = 10 } }\n" +
|
loadText("class A() { class object { val value = 10 } }\n" +
|
||||||
"fun box() = if(A.value == 10) \"OK\" else \"fail\"");
|
"fun box() = if(A.value == 10) \"OK\" else \"fail\"");
|
||||||
blackBox();
|
blackBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPrivateOuterProperty() throws Exception {
|
public void testPrivateOuterProperty() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/privateOuterProperty.kt");
|
blackBoxFile("classes/privateOuterProperty.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPrivateOuterFunctions() throws Exception {
|
public void testPrivateOuterFunctions() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/privateOuterFunctions.kt");
|
blackBoxFile("classes/privateOuterFunctions.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt249() throws Exception {
|
public void testKt249() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt249.jet");
|
blackBoxFile("regressions/kt249.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt48 () throws Exception {
|
public void testKt48 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt48.jet");
|
blackBoxFile("regressions/kt48.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt309 () throws Exception {
|
public void testKt309 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun box() = null");
|
loadText("fun box() = null");
|
||||||
final Method method = generateFunction("box");
|
final Method method = generateFunction("box");
|
||||||
assertEquals(method.getReturnType().getName(), "java.lang.Object");
|
assertEquals(method.getReturnType().getName(), "java.lang.Object");
|
||||||
@@ -261,73 +261,73 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt343 () throws Exception {
|
public void testKt343 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt343.jet");
|
blackBoxFile("regressions/kt343.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt508 () throws Exception {
|
public void testKt508 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile("regressions/kt508.jet");
|
loadFile("regressions/kt508.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
blackBox();
|
blackBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt504 () throws Exception {
|
public void testKt504 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile("regressions/kt504.jet");
|
loadFile("regressions/kt504.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
blackBox();
|
blackBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt501 () throws Exception {
|
public void testKt501 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt501.jet");
|
blackBoxFile("regressions/kt501.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt496 () throws Exception {
|
public void testKt496 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt496.jet");
|
blackBoxFile("regressions/kt496.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt500 () throws Exception {
|
public void testKt500 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt500.jet");
|
blackBoxFile("regressions/kt500.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt694 () throws Exception {
|
public void testKt694 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
// blackBoxFile("regressions/kt694.jet");
|
// blackBoxFile("regressions/kt694.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt285 () throws Exception {
|
public void testKt285 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
// blackBoxFile("regressions/kt285.jet");
|
// blackBoxFile("regressions/kt285.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt707 () throws Exception {
|
public void testKt707 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt707.jet");
|
blackBoxFile("regressions/kt707.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt857 () throws Exception {
|
public void testKt857 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
// blackBoxFile("regressions/kt857.jet");
|
// blackBoxFile("regressions/kt857.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt903 () throws Exception {
|
public void testKt903 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt903.jet");
|
blackBoxFile("regressions/kt903.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt940 () throws Exception {
|
public void testKt940 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt940.kt");
|
blackBoxFile("regressions/kt940.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1018 () throws Exception {
|
public void testKt1018 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1018.kt");
|
blackBoxFile("regressions/kt1018.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,17 +342,17 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1134() throws Exception {
|
public void testKt1134() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1134.kt");
|
blackBoxFile("regressions/kt1134.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1157() throws Exception {
|
public void testKt1157() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1157.kt");
|
blackBoxFile("regressions/kt1157.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt471() throws Exception {
|
public void testKt471() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt471.kt");
|
blackBoxFile("regressions/kt471.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,88 +362,88 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt723() throws Exception {
|
public void testKt723() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt723.kt");
|
blackBoxFile("regressions/kt723.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt725() throws Exception {
|
public void testKt725() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt725.kt");
|
blackBoxFile("regressions/kt725.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt633() throws Exception {
|
public void testKt633() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt633.kt");
|
blackBoxFile("regressions/kt633.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testKt1345() throws Exception {
|
public void testKt1345() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1345.kt");
|
blackBoxFile("regressions/kt1345.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1538() throws Exception {
|
public void testKt1538() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1538.kt");
|
blackBoxFile("regressions/kt1538.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1759() throws Exception {
|
public void testKt1759() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1759.kt");
|
blackBoxFile("regressions/kt1759.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testResolveOrder() {
|
public void testResolveOrder() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("classes/resolveOrder.jet");
|
blackBoxFile("classes/resolveOrder.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1918() {
|
public void testKt1918() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1918.kt");
|
blackBoxFile("regressions/kt1918.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1247() {
|
public void testKt1247() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1247.kt");
|
blackBoxFile("regressions/kt1247.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1980() {
|
public void testKt1980() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1980.kt");
|
blackBoxFile("regressions/kt1980.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1578() {
|
public void testKt1578() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1578.kt");
|
blackBoxFile("regressions/kt1578.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1726() {
|
public void testKt1726() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1726.kt");
|
blackBoxFile("regressions/kt1726.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1721() {
|
public void testKt1721() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1721.kt");
|
blackBoxFile("regressions/kt1721.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1976() {
|
public void testKt1976() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1976.kt");
|
blackBoxFile("regressions/kt1976.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1439() {
|
public void testKt1439() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1439.kt");
|
blackBoxFile("regressions/kt1439.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1611() {
|
public void testKt1611() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1611.kt");
|
blackBoxFile("regressions/kt1611.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1891() {
|
public void testKt1891() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1891.kt");
|
blackBoxFile("regressions/kt1891.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author max
|
* @author max
|
||||||
@@ -26,7 +26,7 @@ public class ClosuresGenTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimplestClosure() throws Exception {
|
public void testSimplestClosure() throws Exception {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.intellij.psi.PsiFile;
|
|||||||
import com.intellij.testFramework.UsefulTestCase;
|
import com.intellij.testFramework.UsefulTestCase;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.lang.BuiltinsScopeExtensionMode;
|
import org.jetbrains.jet.lang.BuiltinsScopeExtensionMode;
|
||||||
import org.jetbrains.jet.utils.ExceptionUtils;
|
import org.jetbrains.jet.utils.ExceptionUtils;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
@@ -31,7 +32,6 @@ import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
|||||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||||
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
|
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
|
||||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
import org.jetbrains.jet.parsing.JetParsingTest;
|
import org.jetbrains.jet.parsing.JetParsingTest;
|
||||||
import org.objectweb.asm.Type;
|
import org.objectweb.asm.Type;
|
||||||
|
|
||||||
@@ -65,11 +65,11 @@ public abstract class CodegenTestCase extends UsefulTestCase {
|
|||||||
myEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(getTestRootDisposable());
|
myEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(getTestRootDisposable());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createEnvironmentWithMockJdkAndIdeaAnnotations(@NotNull CompilerSpecialMode compilerSpecialMode) {
|
protected void createEnvironmentWithMockJdkAndIdeaAnnotations(@NotNull ConfigurationKind configurationKind) {
|
||||||
if (myEnvironment != null) {
|
if (myEnvironment != null) {
|
||||||
throw new IllegalStateException("must not set up myEnvironemnt twice");
|
throw new IllegalStateException("must not set up myEnvironemnt twice");
|
||||||
}
|
}
|
||||||
myEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(getTestRootDisposable(), compilerSpecialMode);
|
myEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(getTestRootDisposable(), configurationKind);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void createEnvironmentWithFullJdk() {
|
protected void createEnvironmentWithFullJdk() {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
@@ -33,7 +33,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIf() throws Exception {
|
public void testIf() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
|
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
@@ -43,7 +43,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testSingleBranchIf() throws Exception {
|
public void testSingleBranchIf() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
|
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
@@ -65,7 +65,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void factorialTest(final String name) throws IllegalAccessException, InvocationTargetException {
|
private void factorialTest(final String name) throws IllegalAccessException, InvocationTargetException {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile(name);
|
loadFile(name);
|
||||||
|
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
@@ -75,7 +75,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testContinue() throws Exception {
|
public void testContinue() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -84,7 +84,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIfNoElse() throws Exception {
|
public void testIfNoElse() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -93,7 +93,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testCondJumpOnStack() throws Exception {
|
public void testCondJumpOnStack() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("import java.lang.Boolean as jlBoolean; fun foo(a: String): Int = if (jlBoolean.parseBoolean(a)) 5 else 10");
|
loadText("import java.lang.Boolean as jlBoolean; fun foo(a: String): Int = if (jlBoolean.parseBoolean(a)) 5 else 10");
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
assertEquals(5, main.invoke(null, "true"));
|
assertEquals(5, main.invoke(null, "true"));
|
||||||
@@ -101,7 +101,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testFor() throws Exception {
|
public void testFor() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -110,7 +110,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIfBlock() throws Exception {
|
public void testIfBlock() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -121,7 +121,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testForInArray() throws Exception {
|
public void testForInArray() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -130,7 +130,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testForInRange() throws Exception {
|
public void testForInRange() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun foo(sb: StringBuilder) { for(x in 1..4) sb.append(x) }");
|
loadText("fun foo(sb: StringBuilder) { for(x in 1..4) sb.append(x) }");
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
StringBuilder stringBuilder = new StringBuilder();
|
StringBuilder stringBuilder = new StringBuilder();
|
||||||
@@ -139,7 +139,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testThrowCheckedException() throws Exception {
|
public void testThrowCheckedException() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun foo() { throw Exception(); }");
|
loadText("fun foo() { throw Exception(); }");
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
boolean caught = false;
|
boolean caught = false;
|
||||||
@@ -154,7 +154,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testTryCatch() throws Exception {
|
public void testTryCatch() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -163,7 +163,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testTryFinally() throws Exception {
|
public void testTryFinally() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -183,37 +183,37 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testForUserType() throws Exception {
|
public void testForUserType() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("controlStructures/forUserType.jet");
|
blackBoxFile("controlStructures/forUserType.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testForIntArray() throws Exception {
|
public void testForIntArray() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("controlStructures/forIntArray.jet");
|
blackBoxFile("controlStructures/forIntArray.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testForPrimitiveIntArray() throws Exception {
|
public void testForPrimitiveIntArray() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("controlStructures/forPrimitiveIntArray.jet");
|
blackBoxFile("controlStructures/forPrimitiveIntArray.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testForNullableIntArray() throws Exception {
|
public void testForNullableIntArray() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("controlStructures/forNullableIntArray.jet");
|
blackBoxFile("controlStructures/forNullableIntArray.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testForIntRange() {
|
public void testForIntRange() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("controlStructures/forIntRange.jet");
|
blackBoxFile("controlStructures/forIntRange.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt237() throws Exception {
|
public void testKt237() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt237.jet");
|
blackBoxFile("regressions/kt237.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCompareToNull() throws Exception {
|
public void testCompareToNull() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun foo(a: String?, b: String?): Boolean = a == null && b !== null && null == a && null !== b");
|
loadText("fun foo(a: String?, b: String?): Boolean = a == null && b !== null && null == a && null !== b");
|
||||||
String text = generateToText();
|
String text = generateToText();
|
||||||
assertTrue(!text.contains("java/lang/Object.equals"));
|
assertTrue(!text.contains("java/lang/Object.equals"));
|
||||||
@@ -224,7 +224,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testCompareToNonnullableEq() throws Exception {
|
public void testCompareToNonnullableEq() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun foo(a: String?, b: String): Boolean = a == b || b == a");
|
loadText("fun foo(a: String?, b: String): Boolean = a == b || b == a");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -233,7 +233,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testCompareToNonnullableNotEq() throws Exception {
|
public void testCompareToNonnullableNotEq() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun foo(a: String?, b: String): Boolean = a != b");
|
loadText("fun foo(a: String?, b: String): Boolean = a != b");
|
||||||
String text = generateToText();
|
String text = generateToText();
|
||||||
// System.out.println(text);
|
// System.out.println(text);
|
||||||
@@ -244,18 +244,18 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt299() throws Exception {
|
public void testKt299() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt299.jet");
|
blackBoxFile("regressions/kt299.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt416() throws Exception {
|
public void testKt416() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt416.jet");
|
blackBoxFile("regressions/kt416.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt513() throws Exception {
|
public void testKt513() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt513.jet");
|
blackBoxFile("regressions/kt513.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,37 +265,37 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt769() throws Exception {
|
public void testKt769() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt769.jet");
|
blackBoxFile("regressions/kt769.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt773() throws Exception {
|
public void testKt773() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt773.jet");
|
blackBoxFile("regressions/kt773.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt772() throws Exception {
|
public void testKt772() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt772.jet");
|
blackBoxFile("regressions/kt772.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt870() throws Exception {
|
public void testKt870() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt870.jet");
|
blackBoxFile("regressions/kt870.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt958() throws Exception {
|
public void testKt958() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt958.jet");
|
blackBoxFile("regressions/kt958.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testQuicksort() throws Exception {
|
public void testQuicksort() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("controlStructures/quicksort.jet");
|
blackBoxFile("controlStructures/quicksort.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
@@ -313,52 +313,52 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1076() throws Exception {
|
public void testKt1076() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1076.kt");
|
blackBoxFile("regressions/kt1076.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt998() throws Exception {
|
public void testKt998() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt998.kt");
|
blackBoxFile("regressions/kt998.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt628() throws Exception {
|
public void testKt628() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt628.kt");
|
blackBoxFile("regressions/kt628.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1441() throws Exception {
|
public void testKt1441() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1441.kt");
|
blackBoxFile("regressions/kt1441.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt2147() throws Exception {
|
public void testKt2147() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt2147.kt");
|
blackBoxFile("regressions/kt2147.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testIfDummy() {
|
public void testIfDummy() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1899.kt");
|
blackBoxFile("regressions/kt1899.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1742() {
|
public void testKt1742() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1742.kt");
|
blackBoxFile("regressions/kt1742.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt2062() {
|
public void testKt2062() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt2062.kt");
|
blackBoxFile("regressions/kt2062.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt910() {
|
public void testKt910() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt910.kt");
|
blackBoxFile("regressions/kt910.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1688() {
|
public void testKt1688() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1688.kt");
|
blackBoxFile("regressions/kt1688.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Stepan Koltsov
|
* @author Stepan Koltsov
|
||||||
@@ -26,7 +26,7 @@ public class EnumGenTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
final Method foo = generateFunction("foo");
|
final Method foo = generateFunction("foo");
|
||||||
final Character c = (Character) foo.invoke(null);
|
final Character c = (Character) foo.invoke(null);
|
||||||
@@ -39,7 +39,7 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testWhenFail() throws Exception {
|
public void testWhenFail() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
Method foo = generateFunction("foo");
|
Method foo = generateFunction("foo");
|
||||||
@@ -47,18 +47,18 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testVirtual() throws Exception {
|
public void testVirtual() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("extensionFunctions/virtual.jet");
|
blackBoxFile("extensionFunctions/virtual.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testShared() throws Exception {
|
public void testShared() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("extensionFunctions/shared.kt");
|
blackBoxFile("extensionFunctions/shared.kt");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt475() throws Exception {
|
public void testKt475() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt475.jet");
|
blackBoxFile("regressions/kt475.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,37 +73,37 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKtNested2() throws Exception {
|
public void testKtNested2() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("extensionFunctions/nested2.kt");
|
blackBoxFile("extensionFunctions/nested2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt606() throws Exception {
|
public void testKt606() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt606.kt");
|
blackBoxFile("regressions/kt606.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1061() throws Exception {
|
public void testKt1061() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1061.kt");
|
blackBoxFile("regressions/kt1061.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1249() throws Exception {
|
public void testKt1249() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1249.kt");
|
blackBoxFile("regressions/kt1249.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1290() throws Exception {
|
public void testKt1290() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1290.kt");
|
blackBoxFile("regressions/kt1290.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1953() throws Exception {
|
public void testKt1953() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1953.kt");
|
blackBoxFile("regressions/kt1953.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1953Class() throws Exception {
|
public void testKt1953Class() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1953_class.kt");
|
blackBoxFile("regressions/kt1953_class.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ package org.jetbrains.jet.codegen;
|
|||||||
|
|
||||||
import com.intellij.openapi.util.io.FileUtil;
|
import com.intellij.openapi.util.io.FileUtil;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@@ -32,7 +32,7 @@ public class FunctionGenTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDefaultArgs() throws Exception {
|
public void testDefaultArgs() throws Exception {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test correct code is generated for descriptors loaded as alt jdk headers
|
* Test correct code is generated for descriptors loaded as alt jdk headers
|
||||||
@@ -28,7 +28,7 @@ public class JdkHeadersTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.STDLIB);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_AND_ANNOTATIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testArrayList() {
|
public void testArrayList() {
|
||||||
|
|||||||
@@ -16,13 +16,13 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
public class MultiFileGenTest extends CodegenTestCase {
|
public class MultiFileGenTest extends CodegenTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimple() {
|
public void testSimple() {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package org.jetbrains.jet.codegen;
|
|||||||
import jet.IntRange;
|
import jet.IntRange;
|
||||||
import jet.Tuple2;
|
import jet.Tuple2;
|
||||||
import jet.Tuple4;
|
import jet.Tuple4;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@@ -35,7 +35,7 @@ public class NamespaceGenTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPSVM() throws Exception {
|
public void testPSVM() throws Exception {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author yole
|
* @author yole
|
||||||
@@ -26,7 +26,7 @@ public class ObjectGenTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimpleObject() {
|
public void testSimpleObject() {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import jet.Tuple2;
|
import jet.Tuple2;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ public class PatternMatchingTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ public class PrimitiveTypesTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPlus() throws Exception {
|
public void testPlus() throws Exception {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
@@ -33,7 +33,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPrivateVal() throws Exception {
|
public void testPrivateVal() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVal");
|
final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVal");
|
||||||
final Field[] fields = aClass.getDeclaredFields();
|
final Field[] fields = aClass.getDeclaredFields();
|
||||||
@@ -43,7 +43,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPrivateVar() throws Exception {
|
public void testPrivateVar() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVar");
|
final Class aClass = loadImplementationClass(generateClassesInFile(), "PrivateVar");
|
||||||
final Object instance = aClass.newInstance();
|
final Object instance = aClass.newInstance();
|
||||||
@@ -54,7 +54,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPublicVar() throws Exception {
|
public void testPublicVar() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("class PublicVar() { public var foo : Int = 0; }");
|
loadText("class PublicVar() { public var foo : Int = 0; }");
|
||||||
final Class aClass = loadImplementationClass(generateClassesInFile(), "PublicVar");
|
final Class aClass = loadImplementationClass(generateClassesInFile(), "PublicVar");
|
||||||
final Object instance = aClass.newInstance();
|
final Object instance = aClass.newInstance();
|
||||||
@@ -65,7 +65,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testAccessorsInInterface() {
|
public void testAccessorsInInterface() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("class AccessorsInInterface() { public var foo : Int = 0; }");
|
loadText("class AccessorsInInterface() { public var foo : Int = 0; }");
|
||||||
final Class aClass = loadClass("AccessorsInInterface", generateClassesInFile());
|
final Class aClass = loadClass("AccessorsInInterface", generateClassesInFile());
|
||||||
assertNotNull(findMethodByName(aClass, "getFoo"));
|
assertNotNull(findMethodByName(aClass, "getFoo"));
|
||||||
@@ -73,7 +73,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPrivatePropertyInNamespace() throws Exception {
|
public void testPrivatePropertyInNamespace() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("private val x = 239");
|
loadText("private val x = 239");
|
||||||
final Class nsClass = generateNamespaceClass();
|
final Class nsClass = generateNamespaceClass();
|
||||||
final Field[] fields = nsClass.getDeclaredFields();
|
final Field[] fields = nsClass.getDeclaredFields();
|
||||||
@@ -86,7 +86,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testFieldPropertyAccess() throws Exception {
|
public void testFieldPropertyAccess() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile("properties/fieldPropertyAccess.jet");
|
loadFile("properties/fieldPropertyAccess.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method method = generateFunction("increment");
|
final Method method = generateFunction("increment");
|
||||||
@@ -95,14 +95,14 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testFieldGetter() throws Exception {
|
public void testFieldGetter() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("val now: Long get() = System.currentTimeMillis(); fun foo() = now");
|
loadText("val now: Long get() = System.currentTimeMillis(); fun foo() = now");
|
||||||
final Method method = generateFunction("foo");
|
final Method method = generateFunction("foo");
|
||||||
assertIsCurrentTime((Long) method.invoke(null));
|
assertIsCurrentTime((Long) method.invoke(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testFieldSetter() throws Exception {
|
public void testFieldSetter() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
final Method method = generateFunction("append");
|
final Method method = generateFunction("append");
|
||||||
method.invoke(null, "IntelliJ ");
|
method.invoke(null, "IntelliJ ");
|
||||||
@@ -114,7 +114,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testFieldSetterPlusEq() throws Exception {
|
public void testFieldSetterPlusEq() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
final Method method = generateFunction("append");
|
final Method method = generateFunction("append");
|
||||||
method.invoke(null, "IntelliJ ");
|
method.invoke(null, "IntelliJ ");
|
||||||
@@ -123,7 +123,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testAccessorsWithoutBody() throws Exception {
|
public void testAccessorsWithoutBody() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("class AccessorsWithoutBody() { protected var foo: Int = 349\n get\n private set\n fun setter() { foo = 610; } } ");
|
loadText("class AccessorsWithoutBody() { protected var foo: Int = 349\n get\n private set\n fun setter() { foo = 610; } } ");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Class aClass = loadImplementationClass(generateClassesInFile(), "AccessorsWithoutBody");
|
final Class aClass = loadImplementationClass(generateClassesInFile(), "AccessorsWithoutBody");
|
||||||
@@ -141,7 +141,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testInitializersForNamespaceProperties() throws Exception {
|
public void testInitializersForNamespaceProperties() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("val x = System.currentTimeMillis()");
|
loadText("val x = System.currentTimeMillis()");
|
||||||
final Method method = generateFunction("getX");
|
final Method method = generateFunction("getX");
|
||||||
method.setAccessible(true);
|
method.setAccessible(true);
|
||||||
@@ -149,7 +149,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPropertyReceiverOnStack() throws Exception {
|
public void testPropertyReceiverOnStack() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadFile();
|
loadFile();
|
||||||
final Class aClass = loadImplementationClass(generateClassesInFile(), "Evaluator");
|
final Class aClass = loadImplementationClass(generateClassesInFile(), "Evaluator");
|
||||||
final Constructor constructor = aClass.getConstructor(StringBuilder.class);
|
final Constructor constructor = aClass.getConstructor(StringBuilder.class);
|
||||||
@@ -161,7 +161,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testAbstractVal() throws Exception {
|
public void testAbstractVal() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("abstract class Foo { public abstract val x: String }");
|
loadText("abstract class Foo { public abstract val x: String }");
|
||||||
final ClassFileFactory codegens = generateClassesInFile();
|
final ClassFileFactory codegens = generateClassesInFile();
|
||||||
final Class aClass = loadClass("Foo", codegens);
|
final Class aClass = loadClass("Foo", codegens);
|
||||||
@@ -169,7 +169,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testVolatileProperty() throws Exception {
|
public void testVolatileProperty() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("abstract class Foo { public volatile var x: String = \"\"; }");
|
loadText("abstract class Foo { public volatile var x: String = \"\"; }");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final ClassFileFactory codegens = generateClassesInFile();
|
final ClassFileFactory codegens = generateClassesInFile();
|
||||||
@@ -179,18 +179,18 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt257 () throws Exception {
|
public void testKt257 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt257.jet");
|
blackBoxFile("regressions/kt257.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt613 () throws Exception {
|
public void testKt613 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt613.jet");
|
blackBoxFile("regressions/kt613.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt160() throws Exception {
|
public void testKt160() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("internal val s = java.lang.Double.toString(1.0)");
|
loadText("internal val s = java.lang.Double.toString(1.0)");
|
||||||
final Method method = generateFunction("getS");
|
final Method method = generateFunction("getS");
|
||||||
method.setAccessible(true);
|
method.setAccessible(true);
|
||||||
@@ -198,12 +198,12 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1165() throws Exception {
|
public void testKt1165() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1165.kt");
|
blackBoxFile("regressions/kt1165.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1168() throws Exception {
|
public void testKt1168() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1168.kt");
|
blackBoxFile("regressions/kt1168.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,17 +213,17 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1159() throws Exception {
|
public void testKt1159() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1159.kt");
|
blackBoxFile("regressions/kt1159.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1417() throws Exception {
|
public void testKt1417() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1417.kt");
|
blackBoxFile("regressions/kt1417.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1398() throws Exception {
|
public void testKt1398() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1398.kt");
|
blackBoxFile("regressions/kt1398.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,13 +16,13 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
public class SafeRefTest extends CodegenTestCase {
|
public class SafeRefTest extends CodegenTestCase {
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void test247 () throws Exception {
|
public void test247 () throws Exception {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ public class ScriptGenTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testHelloWorld() {
|
public void testHelloWorld() {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
@@ -30,7 +30,7 @@ public class StringsTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAnyToString () throws InvocationTargetException, IllegalAccessException {
|
public void testAnyToString () throws InvocationTargetException, IllegalAccessException {
|
||||||
|
|||||||
@@ -16,14 +16,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
public class SuperGenTest extends CodegenTestCase {
|
public class SuperGenTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testBasicProperty () {
|
public void testBasicProperty () {
|
||||||
|
|||||||
@@ -16,14 +16,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
public class TraitsTest extends CodegenTestCase {
|
public class TraitsTest extends CodegenTestCase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -16,11 +16,11 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
public class TupleGenTest extends CodegenTestCase {
|
public class TupleGenTest extends CodegenTestCase {
|
||||||
public void testBasic() {
|
public void testBasic() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("/tuples/basic.jet");
|
blackBoxFile("/tuples/basic.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ public class TypeInfoTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.codegen;
|
package org.jetbrains.jet.codegen;
|
||||||
|
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
|
|
||||||
import java.lang.reflect.Array;
|
import java.lang.reflect.Array;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@@ -27,7 +27,7 @@ import java.lang.reflect.Method;
|
|||||||
*/
|
*/
|
||||||
public class VarArgTest extends CodegenTestCase {
|
public class VarArgTest extends CodegenTestCase {
|
||||||
public void testStringArray () throws InvocationTargetException, IllegalAccessException {
|
public void testStringArray () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun test(vararg ts: String) = ts");
|
loadText("fun test(vararg ts: String) = ts");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -36,7 +36,7 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIntArray () throws InvocationTargetException, IllegalAccessException {
|
public void testIntArray () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun test(vararg ts: Int) = ts");
|
loadText("fun test(vararg ts: Int) = ts");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction();
|
final Method main = generateFunction();
|
||||||
@@ -45,7 +45,7 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIntArrayKotlinNoArgs () throws InvocationTargetException, IllegalAccessException {
|
public void testIntArrayKotlinNoArgs () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun test() = testf(); fun testf(vararg ts: Int) = ts");
|
loadText("fun test() = testf(); fun testf(vararg ts: Int) = ts");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -54,7 +54,7 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIntArrayKotlin () throws InvocationTargetException, IllegalAccessException {
|
public void testIntArrayKotlin () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun test() = testf(239, 7); fun testf(vararg ts: Int) = ts");
|
loadText("fun test() = testf(239, 7); fun testf(vararg ts: Int) = ts");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -65,7 +65,7 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testNullableIntArrayKotlin () throws InvocationTargetException, IllegalAccessException {
|
public void testNullableIntArrayKotlin () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun test() = testf(239.toByte(), 7.toByte()); fun testf(vararg ts: Byte?) = ts");
|
loadText("fun test() = testf(239.toByte(), 7.toByte()); fun testf(vararg ts: Byte?) = ts");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -76,7 +76,7 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIntArrayKotlinObj () throws InvocationTargetException, IllegalAccessException {
|
public void testIntArrayKotlinObj () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun test() = testf(\"239\"); fun testf(vararg ts: String) = ts");
|
loadText("fun test() = testf(\"239\"); fun testf(vararg ts: String) = ts");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -86,7 +86,7 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testArrayT () throws InvocationTargetException, IllegalAccessException {
|
public void testArrayT () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("fun test() = _array(2, 4); fun <T> _array(vararg elements : T) = elements");
|
loadText("fun test() = _array(2, 4); fun <T> _array(vararg elements : T) = elements");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -102,12 +102,12 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt797() {
|
public void testKt797() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt796_797.jet");
|
blackBoxFile("regressions/kt796_797.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testArrayAsVararg () throws InvocationTargetException, IllegalAccessException {
|
public void testArrayAsVararg () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("private fun asList(vararg elems: String) = elems; fun test(ts: Array<String>) = asList(*ts); ");
|
loadText("private fun asList(vararg elems: String) = elems; fun test(ts: Array<String>) = asList(*ts); ");
|
||||||
//System.out.println(generateToText());
|
//System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -116,7 +116,7 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testArrayAsVararg2 () throws InvocationTargetException, IllegalAccessException {
|
public void testArrayAsVararg2 () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
loadText("private fun asList(vararg elems: String) = elems; fun test(ts1: Array<String>, ts2: String) = asList(*ts1, ts2); ");
|
loadText("private fun asList(vararg elems: String) = elems; fun test(ts1: Array<String>, ts2: String) = asList(*ts1, ts2); ");
|
||||||
System.out.println(generateToText());
|
System.out.println(generateToText());
|
||||||
final Method main = generateFunction("test");
|
final Method main = generateFunction("test");
|
||||||
@@ -128,7 +128,7 @@ public class VarArgTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1978() {
|
public void testKt1978() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
blackBoxFile("regressions/kt1978.kt");
|
blackBoxFile("regressions/kt1978.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package org.jetbrains.jet.jvm.compiler;
|
package org.jetbrains.jet.jvm.compiler;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||||
import org.jetbrains.jet.di.InjectorForJavaSemanticServices;
|
import org.jetbrains.jet.di.InjectorForJavaSemanticServices;
|
||||||
@@ -24,7 +25,6 @@ import org.jetbrains.jet.lang.BuiltinsScopeExtensionMode;
|
|||||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||||
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
|
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
|
||||||
import org.jetbrains.jet.lang.descriptors.VariableDescriptor;
|
import org.jetbrains.jet.lang.descriptors.VariableDescriptor;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.DescriptorSearchRule;
|
import org.jetbrains.jet.lang.resolve.java.DescriptorSearchRule;
|
||||||
import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver;
|
import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
@@ -70,7 +70,7 @@ public class JavaDescriptorResolverTest extends TestCaseWithTmpdir {
|
|||||||
JetTestUtils.compileJavaFile(new File("compiler/testData/javaDescriptorResolver/" + fileRelativePath), tmpdir);
|
JetTestUtils.compileJavaFile(new File("compiler/testData/javaDescriptorResolver/" + fileRelativePath), tmpdir);
|
||||||
|
|
||||||
JetCoreEnvironment jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(
|
JetCoreEnvironment jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(
|
||||||
myTestRootDisposable, CompilerSpecialMode.JDK_HEADERS);
|
myTestRootDisposable, ConfigurationKind.JDK_ONLY);
|
||||||
jetCoreEnvironment.addToClasspath(tmpdir);
|
jetCoreEnvironment.addToClasspath(tmpdir);
|
||||||
|
|
||||||
InjectorForJavaSemanticServices injector = new InjectorForJavaSemanticServices(BuiltinsScopeExtensionMode.ALL,
|
InjectorForJavaSemanticServices injector = new InjectorForJavaSemanticServices(BuiltinsScopeExtensionMode.ALL,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.intellij.psi.impl.PsiFileFactoryImpl;
|
|||||||
import com.intellij.testFramework.LightVirtualFile;
|
import com.intellij.testFramework.LightVirtualFile;
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.JetTestCaseBuilder;
|
import org.jetbrains.jet.JetTestCaseBuilder;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||||
@@ -34,7 +35,6 @@ import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter;
|
|||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.DescriptorSearchRule;
|
import org.jetbrains.jet.lang.resolve.java.DescriptorSearchRule;
|
||||||
import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver;
|
import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver;
|
||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||||
@@ -81,7 +81,7 @@ public class ReadJavaBinaryClassTest extends TestCaseWithTmpdir {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private NamespaceDescriptor compileKotlin() throws Exception {
|
private NamespaceDescriptor compileKotlin() throws Exception {
|
||||||
JetCoreEnvironment jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.JDK_HEADERS);
|
JetCoreEnvironment jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_ONLY);
|
||||||
|
|
||||||
String text = FileUtil.loadFile(ktFile);
|
String text = FileUtil.loadFile(ktFile);
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ public class ReadJavaBinaryClassTest extends TestCaseWithTmpdir {
|
|||||||
fileManager.close();
|
fileManager.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
JetCoreEnvironment jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.JDK_HEADERS);
|
JetCoreEnvironment jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_ONLY);
|
||||||
|
|
||||||
jetCoreEnvironment.addToClasspath(tmpdir);
|
jetCoreEnvironment.addToClasspath(tmpdir);
|
||||||
jetCoreEnvironment.addToClasspath(new File("out/production/runtime"));
|
jetCoreEnvironment.addToClasspath(new File("out/production/runtime"));
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import com.intellij.testFramework.LightVirtualFile;
|
|||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.JetTestCaseBuilder;
|
import org.jetbrains.jet.JetTestCaseBuilder;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.CompileEnvironmentUtil;
|
import org.jetbrains.jet.cli.jvm.compiler.CompileEnvironmentUtil;
|
||||||
@@ -37,7 +38,6 @@ import org.jetbrains.jet.lang.BuiltinsScopeExtensionMode;
|
|||||||
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
|
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
|
||||||
import org.jetbrains.jet.lang.psi.JetFile;
|
import org.jetbrains.jet.lang.psi.JetFile;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.DescriptorSearchRule;
|
import org.jetbrains.jet.lang.resolve.java.DescriptorSearchRule;
|
||||||
import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver;
|
import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
@@ -67,7 +67,7 @@ public class ReadKotlinBinaryClassTest extends TestCaseWithTmpdir {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runTest() throws Exception {
|
public void runTest() throws Exception {
|
||||||
jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.JDK_HEADERS);
|
jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_ONLY);
|
||||||
|
|
||||||
String text = FileUtil.loadFile(testFile);
|
String text = FileUtil.loadFile(testFile);
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ public class ReadKotlinBinaryClassTest extends TestCaseWithTmpdir {
|
|||||||
Disposer.dispose(myTestRootDisposable);
|
Disposer.dispose(myTestRootDisposable);
|
||||||
|
|
||||||
|
|
||||||
jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.JDK_HEADERS);
|
jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, ConfigurationKind.JDK_ONLY);
|
||||||
|
|
||||||
jetCoreEnvironment.addToClasspath(tmpdir);
|
jetCoreEnvironment.addToClasspath(tmpdir);
|
||||||
jetCoreEnvironment.addToClasspath(new File("out/production/runtime"));
|
jetCoreEnvironment.addToClasspath(new File("out/production/runtime"));
|
||||||
|
|||||||
+3
-3
@@ -27,6 +27,7 @@ import org.apache.commons.httpclient.params.HttpMethodParams;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
import org.jetbrains.jet.TimeUtils;
|
import org.jetbrains.jet.TimeUtils;
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||||
@@ -34,7 +35,6 @@ import org.jetbrains.jet.config.CompilerConfiguration;
|
|||||||
import org.jetbrains.jet.di.InjectorForJavaSemanticServices;
|
import org.jetbrains.jet.di.InjectorForJavaSemanticServices;
|
||||||
import org.jetbrains.jet.lang.BuiltinsScopeExtensionMode;
|
import org.jetbrains.jet.lang.BuiltinsScopeExtensionMode;
|
||||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.DescriptorSearchRule;
|
import org.jetbrains.jet.lang.resolve.java.DescriptorSearchRule;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
import org.jetbrains.jet.utils.PathUtil;
|
import org.jetbrains.jet.utils.PathUtil;
|
||||||
@@ -146,12 +146,12 @@ public class ResolveDescriptorsFromExternalLibraries {
|
|||||||
|
|
||||||
JetCoreEnvironment jetCoreEnvironment;
|
JetCoreEnvironment jetCoreEnvironment;
|
||||||
if (jar != null) {
|
if (jar != null) {
|
||||||
jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(junk, CompilerSpecialMode.STDLIB);
|
jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(junk, ConfigurationKind.JDK_AND_ANNOTATIONS);
|
||||||
jetCoreEnvironment.addToClasspath(jar);
|
jetCoreEnvironment.addToClasspath(jar);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CompilerConfiguration configuration =
|
CompilerConfiguration configuration =
|
||||||
CompileCompilerDependenciesTest.compilerConfigurationForTests(CompilerSpecialMode.STDLIB, false);
|
CompileCompilerDependenciesTest.compilerConfigurationForTests(ConfigurationKind.JDK_AND_ANNOTATIONS, false);
|
||||||
jetCoreEnvironment = JetCoreEnvironment.createCoreEnvironmentForJVM(junk, configuration);
|
jetCoreEnvironment = JetCoreEnvironment.createCoreEnvironmentForJVM(junk, configuration);
|
||||||
if (!PathUtil.findRtJar().equals(jar)) {
|
if (!PathUtil.findRtJar().equals(jar)) {
|
||||||
throw new RuntimeException("rt.jar mismatch: " + jar + ", " + PathUtil.findRtJar());
|
throw new RuntimeException("rt.jar mismatch: " + jar + ", " + PathUtil.findRtJar());
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import com.intellij.openapi.project.Project;
|
|||||||
import com.intellij.openapi.util.Disposer;
|
import com.intellij.openapi.util.Disposer;
|
||||||
import com.intellij.psi.PsiFile;
|
import com.intellij.psi.PsiFile;
|
||||||
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
||||||
import org.jetbrains.jet.di.InjectorForTopDownAnalyzerForJvm;
|
import org.jetbrains.jet.di.InjectorForTopDownAnalyzerForJvm;
|
||||||
import org.jetbrains.jet.lang.BuiltinsScopeExtensionMode;
|
import org.jetbrains.jet.lang.BuiltinsScopeExtensionMode;
|
||||||
@@ -30,7 +31,6 @@ import org.jetbrains.jet.lang.psi.JetPsiFactory;
|
|||||||
import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter;
|
import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingTraceContext;
|
import org.jetbrains.jet.lang.resolve.BindingTraceContext;
|
||||||
import org.jetbrains.jet.lang.resolve.TopDownAnalysisParameters;
|
import org.jetbrains.jet.lang.resolve.TopDownAnalysisParameters;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
@@ -48,7 +48,7 @@ public abstract class AbstractLazyResolveTest {
|
|||||||
};
|
};
|
||||||
|
|
||||||
protected final JetCoreEnvironment jetCoreEnvironment = new JetCoreEnvironment(rootDisposable,
|
protected final JetCoreEnvironment jetCoreEnvironment = new JetCoreEnvironment(rootDisposable,
|
||||||
CompileCompilerDependenciesTest.compilerConfigurationForTests(CompilerSpecialMode.JDK_HEADERS, true)
|
CompileCompilerDependenciesTest.compilerConfigurationForTests(ConfigurationKind.JDK_ONLY, true)
|
||||||
);
|
);
|
||||||
protected final Project project = jetCoreEnvironment.getProject();
|
protected final Project project = jetCoreEnvironment.getProject();
|
||||||
|
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ import com.intellij.openapi.util.text.StringUtil;
|
|||||||
import com.intellij.util.ArrayUtil;
|
import com.intellij.util.ArrayUtil;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
import org.jetbrains.jet.CompileCompilerDependenciesTest;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.cli.jvm.JVMConfigurationKeys;
|
import org.jetbrains.jet.cli.jvm.JVMConfigurationKeys;
|
||||||
import org.jetbrains.jet.cli.jvm.repl.ReplInterpreter;
|
import org.jetbrains.jet.cli.jvm.repl.ReplInterpreter;
|
||||||
import org.jetbrains.jet.config.CompilerConfiguration;
|
import org.jetbrains.jet.config.CompilerConfiguration;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@@ -54,7 +54,7 @@ public class ReplInterpreterTest {
|
|||||||
|
|
||||||
private void testFile(@NotNull String relativePath) {
|
private void testFile(@NotNull String relativePath) {
|
||||||
CompilerConfiguration configuration =
|
CompilerConfiguration configuration =
|
||||||
CompileCompilerDependenciesTest.compilerConfigurationForTests(CompilerSpecialMode.JDK_HEADERS, false);
|
CompileCompilerDependenciesTest.compilerConfigurationForTests(ConfigurationKind.JDK_ONLY, false);
|
||||||
File[] classpath = configuration.getUserData(JVMConfigurationKeys.CLASSPATH_KEY);
|
File[] classpath = configuration.getUserData(JVMConfigurationKeys.CLASSPATH_KEY);
|
||||||
assert classpath != null;
|
assert classpath != null;
|
||||||
configuration.putUserData(JVMConfigurationKeys.CLASSPATH_KEY, ArrayUtil.append(classpath, new File("out/production/runtime")));
|
configuration.putUserData(JVMConfigurationKeys.CLASSPATH_KEY, ArrayUtil.append(classpath, new File("out/production/runtime")));
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ package org.jetbrains.jet.resolve;
|
|||||||
|
|
||||||
import com.intellij.openapi.editor.Document;
|
import com.intellij.openapi.editor.Document;
|
||||||
import com.intellij.openapi.editor.impl.DocumentImpl;
|
import com.intellij.openapi.editor.impl.DocumentImpl;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.JetLiteFixture;
|
import org.jetbrains.jet.JetLiteFixture;
|
||||||
import org.jetbrains.jet.JetTestCaseBuilder;
|
import org.jetbrains.jet.JetTestCaseBuilder;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
@@ -30,7 +31,6 @@ import org.jetbrains.jet.lang.psi.JetVisitorVoid;
|
|||||||
import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter;
|
import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -46,7 +46,7 @@ public class DescriptorRendererTest extends JetLiteFixture {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,10 +17,10 @@
|
|||||||
package org.jetbrains.jet.resolve;
|
package org.jetbrains.jet.resolve;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NonNls;
|
import org.jetbrains.annotations.NonNls;
|
||||||
|
import org.jetbrains.jet.ConfigurationKind;
|
||||||
import org.jetbrains.jet.JetLiteFixture;
|
import org.jetbrains.jet.JetLiteFixture;
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
import org.jetbrains.jet.JetTestUtils;
|
||||||
import org.jetbrains.jet.lang.psi.JetFile;
|
import org.jetbrains.jet.lang.psi.JetFile;
|
||||||
import org.jetbrains.jet.CompilerSpecialMode;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ public abstract class ExtensibleResolveTestCase extends JetLiteFixture {
|
|||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.STDLIB);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_AND_ANNOTATIONS);
|
||||||
|
|
||||||
expectedResolveData = getExpectedResolveData();
|
expectedResolveData = getExpectedResolveData();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user