80 lines
2.0 KiB
Java
80 lines
2.0 KiB
Java
package org.jetbrains.jet.codegen;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
import org.jetbrains.jet.compiler.CompileEnvironment;
|
|
import org.jetbrains.jet.compiler.CompileSession;
|
|
|
|
/**
|
|
* @author alex.tkachman
|
|
*/
|
|
public class StdlibTest extends CodegenTestCase {
|
|
@Override
|
|
protected void setUp() throws Exception {
|
|
super.setUp();
|
|
createEnvironmentWithFullJdk();
|
|
}
|
|
|
|
protected String generateToText() {
|
|
CompileSession session = new CompileSession(myEnvironment);
|
|
|
|
session.addSources(myFile.getVirtualFile());
|
|
try {
|
|
session.addStdLibSources(true);
|
|
} catch (Throwable e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
|
|
if (!session.analyze(System.out)) {
|
|
return null;
|
|
}
|
|
|
|
return session.generateText();
|
|
}
|
|
|
|
@NotNull
|
|
protected ClassFileFactory generateClassesInFile() {
|
|
try {
|
|
CompileSession session = new CompileSession(myEnvironment);
|
|
CompileEnvironment.initializeKotlinRuntime(myEnvironment);
|
|
session.addSources(myFile.getVirtualFile());
|
|
session.addStdLibSources(true);
|
|
|
|
if (!session.analyze(System.out)) {
|
|
throw new RuntimeException();
|
|
}
|
|
|
|
return session.generate();
|
|
} catch (RuntimeException e) {
|
|
System.out.println(generateToText());
|
|
throw e;
|
|
} catch (Throwable e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
|
|
public void testKt533 () {
|
|
blackBoxFile("regressions/kt533.kt");
|
|
}
|
|
|
|
public void testKt529 () {
|
|
blackBoxFile("regressions/kt529.kt");
|
|
}
|
|
|
|
public void testKt528 () {
|
|
blackBoxFile("regressions/kt528.kt");
|
|
}
|
|
|
|
public void testKt789 () {
|
|
// blackBoxFile("regressions/kt789.jet");
|
|
}
|
|
|
|
public void testKt828 () {
|
|
blackBoxFile("regressions/kt828.kt");
|
|
}
|
|
|
|
public void testKt715 () {
|
|
blackBoxFile("regressions/kt715.kt");
|
|
}
|
|
}
|