Reverted all changes related to renaming jdkHeaders to altHeaders.
This commit is contained in:
@@ -350,7 +350,7 @@
|
|||||||
<arg value="-output"/>
|
<arg value="-output"/>
|
||||||
<arg value="${output}/classes/jdk-headers"/>
|
<arg value="${output}/classes/jdk-headers"/>
|
||||||
<arg value="-mode"/>
|
<arg value="-mode"/>
|
||||||
<arg value="altHeaders"/>
|
<arg value="jdkHeaders"/>
|
||||||
</java>
|
</java>
|
||||||
|
|
||||||
<jar destfile="${kotlin-home}/lib/alt/kotlin-jdk-headers.jar">
|
<jar destfile="${kotlin-home}/lib/alt/kotlin-jdk-headers.jar">
|
||||||
|
|||||||
@@ -20,9 +20,6 @@ import com.google.common.base.Splitter;
|
|||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.intellij.openapi.Disposable;
|
import com.intellij.openapi.Disposable;
|
||||||
import com.intellij.util.ArrayUtil;
|
|
||||||
import com.intellij.util.Function;
|
|
||||||
import com.intellij.util.containers.ContainerUtil;
|
|
||||||
import jet.modules.Module;
|
import jet.modules.Module;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.cli.common.CLICompiler;
|
import org.jetbrains.jet.cli.common.CLICompiler;
|
||||||
@@ -59,26 +56,17 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments, K2JVMComp
|
|||||||
protected ExitCode doExecute(K2JVMCompilerArguments arguments, PrintingMessageCollector messageCollector, Disposable rootDisposable) {
|
protected ExitCode doExecute(K2JVMCompilerArguments arguments, PrintingMessageCollector messageCollector, Disposable rootDisposable) {
|
||||||
|
|
||||||
CompilerSpecialMode mode = parseCompilerSpecialMode(arguments);
|
CompilerSpecialMode mode = parseCompilerSpecialMode(arguments);
|
||||||
File[] altHeadersClasspath;
|
File jdkHeadersJar;
|
||||||
if (mode.includeAltHeaders()) {
|
if (mode.includeJdkHeaders()) {
|
||||||
File path = PathUtil.getAltHeadersPath();
|
if (arguments.jdkHeaders != null) {
|
||||||
File[] defaultAltHeadersPathArray;
|
jdkHeadersJar = new File(arguments.jdkHeaders);
|
||||||
if (path != null) {
|
|
||||||
defaultAltHeadersPathArray = new File[] {path};
|
|
||||||
} else {
|
|
||||||
// TODO should we throw an exception here instead?
|
|
||||||
defaultAltHeadersPathArray = new File[0];
|
|
||||||
}
|
|
||||||
if (arguments.altHeaders != null) {
|
|
||||||
File[] files = pathsToFiles(arguments.altHeaders);
|
|
||||||
altHeadersClasspath = ArrayUtil.mergeArrays(files, defaultAltHeadersPathArray);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
altHeadersClasspath = defaultAltHeadersPathArray;
|
jdkHeadersJar = PathUtil.getAltHeadersPath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
altHeadersClasspath = new File[0];
|
jdkHeadersJar = null;
|
||||||
}
|
}
|
||||||
File runtimeJar;
|
File runtimeJar;
|
||||||
|
|
||||||
@@ -94,7 +82,7 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments, K2JVMComp
|
|||||||
runtimeJar = null;
|
runtimeJar = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompilerDependencies dependencies = new CompilerDependencies(mode, CompilerDependencies.findRtJar(), altHeadersClasspath, runtimeJar);
|
CompilerDependencies dependencies = new CompilerDependencies(mode, CompilerDependencies.findRtJar(), jdkHeadersJar, runtimeJar);
|
||||||
JetCoreEnvironment environment = JetCoreEnvironment.getCoreEnvironmentForJVM(rootDisposable, dependencies);
|
JetCoreEnvironment environment = JetCoreEnvironment.getCoreEnvironmentForJVM(rootDisposable, dependencies);
|
||||||
K2JVMCompileEnvironmentConfiguration configuration =
|
K2JVMCompileEnvironmentConfiguration configuration =
|
||||||
new K2JVMCompileEnvironmentConfiguration(environment, messageCollector);
|
new K2JVMCompileEnvironmentConfiguration(environment, messageCollector);
|
||||||
@@ -153,7 +141,7 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments, K2JVMComp
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (CompilerSpecialMode variant : CompilerSpecialMode.values()) {
|
for (CompilerSpecialMode variant : CompilerSpecialMode.values()) {
|
||||||
if (arguments.mode.equalsIgnoreCase(variant.name().replace("_", ""))) {
|
if (arguments.mode.equalsIgnoreCase(variant.name().replaceAll("_", ""))) {
|
||||||
return variant;
|
return variant;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,14 +184,4 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments, K2JVMComp
|
|||||||
CompileEnvironmentUtil.addToClasspath(configuration.getEnvironment(), Iterables.toArray(classpath, String.class));
|
CompileEnvironmentUtil.addToClasspath(configuration.getEnvironment(), Iterables.toArray(classpath, String.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static File[] pathsToFiles(String paths) {
|
|
||||||
return ContainerUtil.map(Iterables.toArray(Splitter.on(File.pathSeparatorChar).split(paths), String.class),
|
|
||||||
new Function<String, File>() {
|
|
||||||
@Override
|
|
||||||
public File fun(String s) {
|
|
||||||
return new File(s);
|
|
||||||
}
|
|
||||||
}, new File[0]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,10 +54,10 @@ public class K2JVMCompilerArguments extends CompilerArguments {
|
|||||||
@Argument(value = "stdlib", description = "Path to the stdlib.jar")
|
@Argument(value = "stdlib", description = "Path to the stdlib.jar")
|
||||||
public String stdlib;
|
public String stdlib;
|
||||||
|
|
||||||
@Argument(value = "altHeaders", description = "Path to the alternative library headers paths")
|
@Argument(value = "jdkHeaders", description = "Path to the kotlin-jdk-headers.jar")
|
||||||
public String altHeaders;
|
public String jdkHeaders;
|
||||||
|
|
||||||
@Argument(value = "mode", description = "Special compiler modes: stubs or altHeaders")
|
@Argument(value = "mode", description = "Special compiler modes: stubs or jdkHeaders")
|
||||||
public String mode;
|
public String mode;
|
||||||
|
|
||||||
@Argument(value = "output", description = "output directory")
|
@Argument(value = "output", description = "output directory")
|
||||||
|
|||||||
@@ -86,8 +86,8 @@ public class JetCoreEnvironment extends JavaCoreEnvironment {
|
|||||||
addToClasspath(compilerDependencies.getJdkJar());
|
addToClasspath(compilerDependencies.getJdkJar());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compilerSpecialMode.includeAltHeaders()) {
|
if (compilerSpecialMode.includeJdkHeaders()) {
|
||||||
for (VirtualFile root : compilerDependencies.getAltHeaderRoots()) {
|
for (VirtualFile root : compilerDependencies.getJdkHeaderRoots()) {
|
||||||
addLibraryRoot(root);
|
addLibraryRoot(root);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-40
@@ -16,11 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.resolve.java;
|
package org.jetbrains.jet.lang.resolve.java;
|
||||||
|
|
||||||
import com.intellij.openapi.util.io.FileUtil;
|
|
||||||
import com.intellij.openapi.vfs.VirtualFile;
|
import com.intellij.openapi.vfs.VirtualFile;
|
||||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
|
||||||
import com.intellij.util.Function;
|
|
||||||
import com.intellij.util.containers.ContainerUtil;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.utils.PathUtil;
|
import org.jetbrains.jet.utils.PathUtil;
|
||||||
@@ -38,15 +34,15 @@ public class CompilerDependencies {
|
|||||||
private final CompilerSpecialMode compilerSpecialMode;
|
private final CompilerSpecialMode compilerSpecialMode;
|
||||||
@Nullable
|
@Nullable
|
||||||
private final File jdkJar;
|
private final File jdkJar;
|
||||||
@NotNull
|
@Nullable
|
||||||
private final File[] altHeadersClasspath;
|
private final File jdkHeadersJar;
|
||||||
@Nullable
|
@Nullable
|
||||||
private final File runtimeJar;
|
private final File runtimeJar;
|
||||||
|
|
||||||
public CompilerDependencies(@NotNull CompilerSpecialMode compilerSpecialMode, @Nullable File jdkJar, @NotNull File[] altHeadersClasspath, @Nullable File runtimeJar) {
|
public CompilerDependencies(@NotNull CompilerSpecialMode compilerSpecialMode, @Nullable File jdkJar, @Nullable File jdkHeadersJar, @Nullable File runtimeJar) {
|
||||||
this.compilerSpecialMode = compilerSpecialMode;
|
this.compilerSpecialMode = compilerSpecialMode;
|
||||||
this.jdkJar = jdkJar;
|
this.jdkJar = jdkJar;
|
||||||
this.altHeadersClasspath = altHeadersClasspath;
|
this.jdkHeadersJar = jdkHeadersJar;
|
||||||
this.runtimeJar = runtimeJar;
|
this.runtimeJar = runtimeJar;
|
||||||
|
|
||||||
if (compilerSpecialMode.includeJdk()) {
|
if (compilerSpecialMode.includeJdk()) {
|
||||||
@@ -54,15 +50,9 @@ public class CompilerDependencies {
|
|||||||
throw new IllegalArgumentException("jdk must be included for mode " + compilerSpecialMode);
|
throw new IllegalArgumentException("jdk must be included for mode " + compilerSpecialMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (compilerSpecialMode.includeAltHeaders()) {
|
if (compilerSpecialMode.includeJdkHeaders()) {
|
||||||
if (altHeadersClasspath.length == 0) {
|
if (jdkHeadersJar == null) {
|
||||||
throw new IllegalArgumentException("altHeaders must be included for mode " + compilerSpecialMode);
|
throw new IllegalArgumentException("jdkHeaders must be included for mode " + compilerSpecialMode);
|
||||||
}
|
|
||||||
for (int i = 0; i < altHeadersClasspath.length; i++) {
|
|
||||||
File file = altHeadersClasspath[i];
|
|
||||||
if (file == null) {
|
|
||||||
throw new IllegalArgumentException("altHeaders file " + i + " must not be null for included for mode " + compilerSpecialMode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (compilerSpecialMode.includeKotlinRuntime()) {
|
if (compilerSpecialMode.includeKotlinRuntime()) {
|
||||||
@@ -82,9 +72,9 @@ public class CompilerDependencies {
|
|||||||
return jdkJar;
|
return jdkJar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@Nullable
|
||||||
public File[] getAltHeadersClassPath() {
|
public File getJdkHeadersJar() {
|
||||||
return altHeadersClasspath;
|
return jdkHeadersJar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -93,25 +83,9 @@ public class CompilerDependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public List<VirtualFile> getAltHeaderRoots() {
|
public List<VirtualFile> getJdkHeaderRoots() {
|
||||||
if (compilerSpecialMode.includeAltHeaders()) {
|
if (compilerSpecialMode.includeJdkHeaders()) {
|
||||||
return ContainerUtil.map2List(altHeadersClasspath, new Function<File, VirtualFile>() {
|
return Collections.singletonList(PathUtil.jarFileToVirtualFile(jdkHeadersJar));
|
||||||
@Override
|
|
||||||
public VirtualFile fun(File file) {
|
|
||||||
if (file.exists()) {
|
|
||||||
if (file.isDirectory()) {
|
|
||||||
return VirtualFileManager.getInstance()
|
|
||||||
.findFileByUrl("file://" + FileUtil.toSystemIndependentName(file.getAbsolutePath()));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return PathUtil.jarFileToVirtualFile(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw new IllegalStateException("Path " + file + " does not exist.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
@@ -133,7 +107,7 @@ public class CompilerDependencies {
|
|||||||
return new CompilerDependencies(
|
return new CompilerDependencies(
|
||||||
compilerSpecialMode,
|
compilerSpecialMode,
|
||||||
compilerSpecialMode.includeJdk() ? findRtJar() : null,
|
compilerSpecialMode.includeJdk() ? findRtJar() : null,
|
||||||
compilerSpecialMode.includeAltHeaders() ? new File[]{PathUtil.getAltHeadersPath()} : new File[0],
|
compilerSpecialMode.includeJdkHeaders() ? PathUtil.getAltHeadersPath() : null,
|
||||||
compilerSpecialMode.includeKotlinRuntime() ? PathUtil.getDefaultRuntimePath() : null);
|
compilerSpecialMode.includeKotlinRuntime() ? PathUtil.getDefaultRuntimePath() : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -22,13 +22,13 @@ package org.jetbrains.jet.lang.resolve.java;
|
|||||||
public enum CompilerSpecialMode {
|
public enum CompilerSpecialMode {
|
||||||
REGULAR,
|
REGULAR,
|
||||||
BUILTINS,
|
BUILTINS,
|
||||||
ALT_HEADERS,
|
JDK_HEADERS,
|
||||||
STDLIB,
|
STDLIB,
|
||||||
IDEA,
|
IDEA,
|
||||||
JS,
|
JS,
|
||||||
;
|
;
|
||||||
|
|
||||||
public boolean includeAltHeaders() {
|
public boolean includeJdkHeaders() {
|
||||||
return this == REGULAR || this == STDLIB || this == IDEA;
|
return this == REGULAR || this == STDLIB || this == IDEA;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,6 +41,6 @@ public enum CompilerSpecialMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isStubs() {
|
public boolean isStubs() {
|
||||||
return this == BUILTINS || this == ALT_HEADERS;
|
return this == BUILTINS || this == JDK_HEADERS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@ public class PsiClassFinderForJvm implements PsiClassFinder {
|
|||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
this.altClassFinder = new AltClassFinder(project, compilerDependencies.getAltHeaderRoots());
|
this.altClassFinder = new AltClassFinder(project, compilerDependencies.getJdkHeaderRoots());
|
||||||
this.javaSearchScope = new DelegatingGlobalSearchScope(GlobalSearchScope.allScope(project)) {
|
this.javaSearchScope = new DelegatingGlobalSearchScope(GlobalSearchScope.allScope(project)) {
|
||||||
@Override
|
@Override
|
||||||
public boolean contains(VirtualFile file) {
|
public boolean contains(VirtualFile file) {
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ OUT -src [String] source file or directory
|
|||||||
OUT -classpath [String] classpath to use when compiling
|
OUT -classpath [String] classpath to use when compiling
|
||||||
OUT -includeRuntime [flag]
|
OUT -includeRuntime [flag]
|
||||||
OUT -stdlib [String] Path to the stdlib.jar
|
OUT -stdlib [String] Path to the stdlib.jar
|
||||||
OUT -altHeaders [String] Path to the alternative library headers paths
|
OUT -jdkHeaders [String] Path to the kotlin-jdk-headers.jar
|
||||||
OUT -mode [String] Special compiler modes: stubs or altHeaders
|
OUT -mode [String] Special compiler modes: stubs or jdkHeaders
|
||||||
OUT -output [String] output directory
|
OUT -output [String] output directory
|
||||||
OUT -module [String] module to compile
|
OUT -module [String] module to compile
|
||||||
OUT -script [flag]
|
OUT -script [flag]
|
||||||
|
|||||||
@@ -22,10 +22,9 @@ import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileJdkHeaders;
|
|||||||
import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime;
|
import org.jetbrains.jet.codegen.forTestCompile.ForTestCompileRuntime;
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerDependencies;
|
import org.jetbrains.jet.lang.resolve.java.CompilerDependencies;
|
||||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
||||||
|
import org.jetbrains.jet.utils.PathUtil;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Stepan Koltsov
|
* @author Stepan Koltsov
|
||||||
*/
|
*/
|
||||||
@@ -54,7 +53,7 @@ public class CompileCompilerDependenciesTest {
|
|||||||
return new CompilerDependencies(
|
return new CompilerDependencies(
|
||||||
compilerSpecialMode,
|
compilerSpecialMode,
|
||||||
compilerSpecialMode.includeJdk() ? (mockJdk ? JetTestUtils.findMockJdkRtJar() : CompilerDependencies.findRtJar()) : null,
|
compilerSpecialMode.includeJdk() ? (mockJdk ? JetTestUtils.findMockJdkRtJar() : CompilerDependencies.findRtJar()) : null,
|
||||||
compilerSpecialMode.includeAltHeaders() ? new File[]{ForTestCompileJdkHeaders.jdkHeadersForTests()} : new File[0],
|
compilerSpecialMode.includeJdkHeaders() ? ForTestCompileJdkHeaders.jdkHeadersForTests() : null,
|
||||||
compilerSpecialMode.includeKotlinRuntime() ? ForTestCompileRuntime.runtimeJarForTests() : null);
|
compilerSpecialMode.includeKotlinRuntime() ? ForTestCompileRuntime.runtimeJarForTests() : null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class CompileEnvironmentTest extends TestCase {
|
|||||||
"-module", JetParsingTest.getTestDataDir() + "/compiler/smoke/Smoke.kts",
|
"-module", JetParsingTest.getTestDataDir() + "/compiler/smoke/Smoke.kts",
|
||||||
"-jar", resultJar.getAbsolutePath(),
|
"-jar", resultJar.getAbsolutePath(),
|
||||||
"-stdlib", stdlib.getAbsolutePath(),
|
"-stdlib", stdlib.getAbsolutePath(),
|
||||||
"-altHeaders", jdkHeaders.getAbsolutePath());
|
"-jdkHeaders", jdkHeaders.getAbsolutePath());
|
||||||
Assert.assertEquals("compilation completed with non-zero code", ExitCode.OK, rv);
|
Assert.assertEquals("compilation completed with non-zero code", ExitCode.OK, rv);
|
||||||
FileInputStream fileInputStream = new FileInputStream(resultJar);
|
FileInputStream fileInputStream = new FileInputStream(resultJar);
|
||||||
try {
|
try {
|
||||||
@@ -81,7 +81,7 @@ public class CompileEnvironmentTest extends TestCase {
|
|||||||
File jdkHeaders = ForTestCompileJdkHeaders.jdkHeadersForTests();
|
File jdkHeaders = ForTestCompileJdkHeaders.jdkHeadersForTests();
|
||||||
ExitCode exitCode = new K2JVMCompiler()
|
ExitCode exitCode = new K2JVMCompiler()
|
||||||
.exec(System.out, "-src", JetParsingTest.getTestDataDir() + "/compiler/smoke/Smoke.kt", "-output",
|
.exec(System.out, "-src", JetParsingTest.getTestDataDir() + "/compiler/smoke/Smoke.kt", "-output",
|
||||||
out.getAbsolutePath(), "-stdlib", stdlib.getAbsolutePath(), "-altHeaders", jdkHeaders.getAbsolutePath());
|
out.getAbsolutePath(), "-stdlib", stdlib.getAbsolutePath(), "-jdkHeaders", jdkHeaders.getAbsolutePath());
|
||||||
Assert.assertEquals(ExitCode.OK, exitCode);
|
Assert.assertEquals(ExitCode.OK, exitCode);
|
||||||
assertEquals(1, out.listFiles().length);
|
assertEquals(1, out.listFiles().length);
|
||||||
assertEquals(1, out.listFiles()[0].listFiles().length);
|
assertEquals(1, out.listFiles()[0].listFiles().length);
|
||||||
|
|||||||
@@ -66,7 +66,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.ALT_HEADERS);
|
myTestRootDisposable, CompilerSpecialMode.JDK_HEADERS);
|
||||||
jetCoreEnvironment.addToClasspath(tmpdir);
|
jetCoreEnvironment.addToClasspath(tmpdir);
|
||||||
|
|
||||||
InjectorForJavaSemanticServices injector = new InjectorForJavaSemanticServices(
|
InjectorForJavaSemanticServices injector = new InjectorForJavaSemanticServices(
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class ReadJavaBinaryClassTest extends TestCaseWithTmpdir {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private NamespaceDescriptor compileKotlin() throws Exception {
|
private NamespaceDescriptor compileKotlin() throws Exception {
|
||||||
JetCoreEnvironment jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.ALT_HEADERS);
|
JetCoreEnvironment jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.JDK_HEADERS);
|
||||||
|
|
||||||
String text = FileUtil.loadFile(ktFile);
|
String text = FileUtil.loadFile(ktFile);
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ public class ReadJavaBinaryClassTest extends TestCaseWithTmpdir {
|
|||||||
fileManager.close();
|
fileManager.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
JetCoreEnvironment jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.ALT_HEADERS);
|
JetCoreEnvironment jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.JDK_HEADERS);
|
||||||
|
|
||||||
jetCoreEnvironment.addToClasspath(tmpdir);
|
jetCoreEnvironment.addToClasspath(tmpdir);
|
||||||
jetCoreEnvironment.addToClasspath(new File("out/production/runtime"));
|
jetCoreEnvironment.addToClasspath(new File("out/production/runtime"));
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class ReadKotlinBinaryClassTest extends TestCaseWithTmpdir {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void runTest() throws Exception {
|
public void runTest() throws Exception {
|
||||||
jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.ALT_HEADERS);
|
jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.JDK_HEADERS);
|
||||||
|
|
||||||
String text = FileUtil.loadFile(testFile);
|
String text = FileUtil.loadFile(testFile);
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ public class ReadKotlinBinaryClassTest extends TestCaseWithTmpdir {
|
|||||||
virtualFile.setCharset(CharsetToolkit.UTF8_CHARSET);
|
virtualFile.setCharset(CharsetToolkit.UTF8_CHARSET);
|
||||||
JetFile psiFile = (JetFile) ((PsiFileFactoryImpl) PsiFileFactory.getInstance(jetCoreEnvironment.getProject())).trySetupPsiForFile(virtualFile, JetLanguage.INSTANCE, true, false);
|
JetFile psiFile = (JetFile) ((PsiFileFactoryImpl) PsiFileFactory.getInstance(jetCoreEnvironment.getProject())).trySetupPsiForFile(virtualFile, JetLanguage.INSTANCE, true, false);
|
||||||
|
|
||||||
GenerationState state = GenerationUtils.compileFileGetGenerationStateForTest(psiFile, CompilerSpecialMode.ALT_HEADERS);
|
GenerationState state = GenerationUtils.compileFileGetGenerationStateForTest(psiFile, CompilerSpecialMode.JDK_HEADERS);
|
||||||
|
|
||||||
ClassFileFactory classFileFactory = state.getFactory();
|
ClassFileFactory classFileFactory = state.getFactory();
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ public class ReadKotlinBinaryClassTest extends TestCaseWithTmpdir {
|
|||||||
Disposer.dispose(myTestRootDisposable);
|
Disposer.dispose(myTestRootDisposable);
|
||||||
|
|
||||||
|
|
||||||
jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.ALT_HEADERS);
|
jetCoreEnvironment = JetTestUtils.createEnvironmentWithMockJdkAndIdeaAnnotations(myTestRootDisposable, CompilerSpecialMode.JDK_HEADERS);
|
||||||
|
|
||||||
jetCoreEnvironment.addToClasspath(tmpdir);
|
jetCoreEnvironment.addToClasspath(tmpdir);
|
||||||
jetCoreEnvironment.addToClasspath(new File("out/production/runtime"));
|
jetCoreEnvironment.addToClasspath(new File("out/production/runtime"));
|
||||||
|
|||||||
@@ -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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPropField() throws NoSuchFieldException, NoSuchMethodException {
|
public void testPropField() throws NoSuchFieldException, NoSuchMethodException {
|
||||||
|
|||||||
@@ -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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt238 () throws Exception {
|
public void testKt238 () throws Exception {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|||||||
|
|
||||||
public class BridgeMethodGenTest extends CodegenTestCase {
|
public class BridgeMethodGenTest extends CodegenTestCase {
|
||||||
public void testBridgeMethod () throws Exception {
|
public void testBridgeMethod () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("bridge.jet");
|
blackBoxFile("bridge.jet");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPSVMClass() throws Exception {
|
public void testPSVMClass() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/inheritance.jet");
|
blackBoxFile("classes/inheritance.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInheritanceAndDelegation2() throws Exception {
|
public void testInheritanceAndDelegation2() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/delegation2.kt");
|
blackBoxFile("classes/delegation2.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testFunDelegation() throws Exception {
|
public void testFunDelegation() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/funDelegation.jet");
|
blackBoxFile("classes/funDelegation.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPropertyDelegation() throws Exception {
|
public void testPropertyDelegation() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/propertyDelegation.jet");
|
blackBoxFile("classes/propertyDelegation.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDiamondInheritance() throws Exception {
|
public void testDiamondInheritance() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/diamondInheritance.jet");
|
blackBoxFile("classes/diamondInheritance.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testRightHandOverride() throws Exception {
|
public void testRightHandOverride() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/rightHandOverride.jet");
|
blackBoxFile("classes/rightHandOverride.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testNewInstanceExplicitConstructor() throws Exception {
|
public void testNewInstanceExplicitConstructor() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/innerClass.jet");
|
blackBoxFile("classes/innerClass.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInheritedInnerClass() throws Exception {
|
public void testInheritedInnerClass() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/inheritedInnerClass.jet");
|
blackBoxFile("classes/inheritedInnerClass.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInitializerBlock() throws Exception {
|
public void testInitializerBlock() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/initializerBlock.jet");
|
blackBoxFile("classes/initializerBlock.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAbstractMethod() throws Exception {
|
public void testAbstractMethod() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/inheritedMethod.jet");
|
blackBoxFile("classes/inheritedMethod.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testInitializerBlockDImpl() throws Exception {
|
public void testInitializerBlockDImpl() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/initializerBlockDImpl.jet");
|
blackBoxFile("classes/initializerBlockDImpl.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPropertyInInitializer() throws Exception {
|
public void testPropertyInInitializer() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/propertyInInitializer.jet");
|
blackBoxFile("classes/propertyInInitializer.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOuterThis() throws Exception {
|
public void testOuterThis() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/outerThis.jet");
|
blackBoxFile("classes/outerThis.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSecondaryConstructors() throws Exception {
|
public void testSecondaryConstructors() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/secondaryConstructors.jet");
|
blackBoxFile("classes/secondaryConstructors.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testExceptionConstructor() throws Exception {
|
public void testExceptionConstructor() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/exceptionConstructor.jet");
|
blackBoxFile("classes/exceptionConstructor.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimpleBox() throws Exception {
|
public void testSimpleBox() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/simpleBox.jet");
|
blackBoxFile("classes/simpleBox.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAbstractClass() throws Exception {
|
public void testAbstractClass() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/classObject.jet");
|
blackBoxFile("classes/classObject.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testClassObjectMethod() throws Exception {
|
public void testClassObjectMethod() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
// 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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/overloadBinaryOperator.jet");
|
blackBoxFile("classes/overloadBinaryOperator.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadUnaryOperator() throws Exception {
|
public void testOverloadUnaryOperator() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/overloadUnaryOperator.jet");
|
blackBoxFile("classes/overloadUnaryOperator.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadPlusAssign() throws Exception {
|
public void testOverloadPlusAssign() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/overloadPlusAssign.jet");
|
blackBoxFile("classes/overloadPlusAssign.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadPlusAssignReturn() throws Exception {
|
public void testOverloadPlusAssignReturn() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/overloadPlusAssignReturn.jet");
|
blackBoxFile("classes/overloadPlusAssignReturn.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testOverloadPlusToPlusAssign() throws Exception {
|
public void testOverloadPlusToPlusAssign() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/overloadPlusToPlusAssign.jet");
|
blackBoxFile("classes/overloadPlusToPlusAssign.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testEnumClass() throws Exception {
|
public void testEnumClass() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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,25 +225,25 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testClassObjFields() throws Exception {
|
public void testClassObjFields() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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 testKt249() throws Exception {
|
public void testKt249() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt249.jet");
|
blackBoxFile("regressions/kt249.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt48 () throws Exception {
|
public void testKt48 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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");
|
||||||
@@ -251,73 +251,73 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt343 () throws Exception {
|
public void testKt343 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt501.jet");
|
blackBoxFile("regressions/kt501.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt496 () throws Exception {
|
public void testKt496 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt500.jet");
|
blackBoxFile("regressions/kt500.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt694 () throws Exception {
|
public void testKt694 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
// blackBoxFile("regressions/kt694.jet");
|
// blackBoxFile("regressions/kt694.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt285 () throws Exception {
|
public void testKt285 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
// blackBoxFile("regressions/kt285.jet");
|
// blackBoxFile("regressions/kt285.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt707 () throws Exception {
|
public void testKt707 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt707.jet");
|
blackBoxFile("regressions/kt707.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt857 () throws Exception {
|
public void testKt857 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
// blackBoxFile("regressions/kt857.jet");
|
// blackBoxFile("regressions/kt857.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt903 () throws Exception {
|
public void testKt903 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt903.jet");
|
blackBoxFile("regressions/kt903.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt940 () throws Exception {
|
public void testKt940 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt940.kt");
|
blackBoxFile("regressions/kt940.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1018 () throws Exception {
|
public void testKt1018 () throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1018.kt");
|
blackBoxFile("regressions/kt1018.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,17 +332,17 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1134() throws Exception {
|
public void testKt1134() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1134.kt");
|
blackBoxFile("regressions/kt1134.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1157() throws Exception {
|
public void testKt1157() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1157.kt");
|
blackBoxFile("regressions/kt1157.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt471() throws Exception {
|
public void testKt471() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt471.kt");
|
blackBoxFile("regressions/kt471.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,38 +352,38 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt723() throws Exception {
|
public void testKt723() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt723.kt");
|
blackBoxFile("regressions/kt723.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt725() throws Exception {
|
public void testKt725() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt725.kt");
|
blackBoxFile("regressions/kt725.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt633() throws Exception {
|
public void testKt633() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt633.kt");
|
blackBoxFile("regressions/kt633.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testKt1345() throws Exception {
|
public void testKt1345() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1345.kt");
|
blackBoxFile("regressions/kt1345.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1538() throws Exception {
|
public void testKt1538() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1538.kt");
|
blackBoxFile("regressions/kt1538.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1759() throws Exception {
|
public void testKt1759() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1759.kt");
|
blackBoxFile("regressions/kt1759.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testResolveOrder() throws Exception {
|
public void testResolveOrder() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("classes/resolveOrder.jet");
|
blackBoxFile("classes/resolveOrder.jet");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimplestClosure() throws Exception {
|
public void testSimplestClosure() throws Exception {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testIf() throws Exception {
|
public void testIf() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("controlStructures/forUserType.jet");
|
blackBoxFile("controlStructures/forUserType.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testForIntArray() throws Exception {
|
public void testForIntArray() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("controlStructures/forIntArray.jet");
|
blackBoxFile("controlStructures/forIntArray.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testForPrimitiveIntArray() throws Exception {
|
public void testForPrimitiveIntArray() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("controlStructures/forPrimitiveIntArray.jet");
|
blackBoxFile("controlStructures/forPrimitiveIntArray.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testForNullableIntArray() throws Exception {
|
public void testForNullableIntArray() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("controlStructures/forNullableIntArray.jet");
|
blackBoxFile("controlStructures/forNullableIntArray.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testForIntRange() {
|
public void testForIntRange() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("controlStructures/forIntRange.jet");
|
blackBoxFile("controlStructures/forIntRange.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt237() throws Exception {
|
public void testKt237() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt237.jet");
|
blackBoxFile("regressions/kt237.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCompareToNull() throws Exception {
|
public void testCompareToNull() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt299.jet");
|
blackBoxFile("regressions/kt299.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt416() throws Exception {
|
public void testKt416() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("controlStructures/quicksort.jet");
|
blackBoxFile("controlStructures/quicksort.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
@@ -313,22 +313,22 @@ public class ControlStructuresTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1076() throws Exception {
|
public void testKt1076() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1076.kt");
|
blackBoxFile("regressions/kt1076.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt998() throws Exception {
|
public void testKt998() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt998.kt");
|
blackBoxFile("regressions/kt998.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt628() throws Exception {
|
public void testKt628() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt628.kt");
|
blackBoxFile("regressions/kt628.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1441() throws Exception {
|
public void testKt1441() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1441.kt");
|
blackBoxFile("regressions/kt1441.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class ExtensionFunctionsTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("extensionFunctions/virtual.jet");
|
blackBoxFile("extensionFunctions/virtual.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testShared() throws Exception {
|
public void testShared() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt475.jet");
|
blackBoxFile("regressions/kt475.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testDefaultArgs() throws Exception {
|
public void testDefaultArgs() throws Exception {
|
||||||
|
|||||||
@@ -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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPSVM() throws Exception {
|
public void testPSVM() throws Exception {
|
||||||
|
|||||||
@@ -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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimpleObject() throws Exception {
|
public void testSimpleObject() throws Exception {
|
||||||
|
|||||||
@@ -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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testPlus() throws Exception {
|
public void testPlus() throws Exception {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testPrivateVal() throws Exception {
|
public void testPrivateVal() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
loadFile("properties/fieldPropertyAccess.jet");
|
loadFile("properties/fieldPropertyAccess.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
final Method method = generateFunction();
|
final Method method = generateFunction();
|
||||||
@@ -95,14 +95,14 @@ public class PropertyGenTest extends CodegenTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testFieldGetter() throws Exception {
|
public void testFieldGetter() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt613.jet");
|
blackBoxFile("regressions/kt613.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt160() throws Exception {
|
public void testKt160() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1165.kt");
|
blackBoxFile("regressions/kt1165.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1168() throws Exception {
|
public void testKt1168() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1159.kt");
|
blackBoxFile("regressions/kt1159.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1417() throws Exception {
|
public void testKt1417() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1417.kt");
|
blackBoxFile("regressions/kt1417.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testKt1398() throws Exception {
|
public void testKt1398() throws Exception {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt1398.kt");
|
blackBoxFile("regressions/kt1398.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class SafeRefTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void test247 () throws Exception {
|
public void test247 () throws Exception {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class ScriptGenTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testHelloWorld() {
|
public void testHelloWorld() {
|
||||||
|
|||||||
@@ -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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testAnyToString () throws InvocationTargetException, IllegalAccessException {
|
public void testAnyToString () throws InvocationTargetException, IllegalAccessException {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class SuperGenTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testBasicProperty () {
|
public void testBasicProperty () {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class TraitsTest extends CodegenTestCase {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
|||||||
|
|
||||||
public class TupleGenTest extends CodegenTestCase {
|
public class TupleGenTest extends CodegenTestCase {
|
||||||
public void testBasic() {
|
public void testBasic() {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("/tuples/basic.jet");
|
blackBoxFile("/tuples/basic.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
blackBoxFile("regressions/kt796_797.jet");
|
blackBoxFile("regressions/kt796_797.jet");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testArrayAsVararg () throws InvocationTargetException, IllegalAccessException {
|
public void testArrayAsVararg () throws InvocationTargetException, IllegalAccessException {
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
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");
|
||||||
|
|||||||
+1
-1
@@ -39,7 +39,7 @@ public class ForTestCompileJdkHeaders {
|
|||||||
@Override
|
@Override
|
||||||
protected void doCompile(@NotNull File classesDir) throws Exception {
|
protected void doCompile(@NotNull File classesDir) throws Exception {
|
||||||
ExitCode exitCode = new K2JVMCompiler().exec(
|
ExitCode exitCode = new K2JVMCompiler().exec(
|
||||||
System.err, "-output", classesDir.getPath(), "-src", "./jdk-headers/src", "-mode", "altHeaders");
|
System.err, "-output", classesDir.getPath(), "-src", "./jdk-headers/src", "-mode", "jdkHeaders");
|
||||||
if (exitCode != ExitCode.OK) {
|
if (exitCode != ExitCode.OK) {
|
||||||
throw new IllegalStateException("jdk headers compilation failed: " + exitCode);
|
throw new IllegalStateException("jdk headers compilation failed: " + exitCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class DescriptorRendererTest extends JetLiteFixture {
|
|||||||
@Override
|
@Override
|
||||||
protected void setUp() throws Exception {
|
protected void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.ALT_HEADERS);
|
createEnvironmentWithMockJdkAndIdeaAnnotations(CompilerSpecialMode.JDK_HEADERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
package org.jetbrains.jet.utils;
|
package org.jetbrains.jet.utils;
|
||||||
|
|
||||||
import com.intellij.openapi.application.PathManager;
|
import com.intellij.openapi.application.PathManager;
|
||||||
import com.intellij.openapi.util.io.FileUtil;
|
|
||||||
import com.intellij.openapi.vfs.VirtualFile;
|
import com.intellij.openapi.vfs.VirtualFile;
|
||||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -123,6 +122,6 @@ public class PathUtil {
|
|||||||
if (!file.exists() || !file.isFile()) {
|
if (!file.exists() || !file.isFile()) {
|
||||||
throw new IllegalStateException("file must exist and be regular to be converted to virtual file: " + file);
|
throw new IllegalStateException("file must exist and be regular to be converted to virtual file: " + file);
|
||||||
}
|
}
|
||||||
return VirtualFileManager.getInstance().findFileByUrl("jar://" + FileUtil.toSystemIndependentName(file.getAbsolutePath()) + "!/");
|
return VirtualFileManager.getInstance().findFileByUrl("jar://" + file.getPath() + "!/");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<!-- altHeaders -->
|
<!-- jdkHeaders -->
|
||||||
<directory>${kotlin-sdk}/lib/alt</directory>
|
<directory>${kotlin-sdk}/lib/alt</directory>
|
||||||
<filtering>false</filtering>
|
<filtering>false</filtering>
|
||||||
</resource>
|
</resource>
|
||||||
|
|||||||
Reference in New Issue
Block a user