enhance tests (mostly codegen)
* drop dependency on stdlib/alt-headers in the most tests * assign to myEnvironment at most once in JetLiteFixture * more tests do not compile runtime
This commit is contained in:
@@ -24,6 +24,7 @@ import org.jetbrains.jet.analyzer.AnalyzeExhaust;
|
||||
import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
|
||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerSpecialMode;
|
||||
import org.jetbrains.jet.parsing.JetParsingTest;
|
||||
@@ -127,8 +128,9 @@ public abstract class CodegenTestCase extends JetLiteFixture {
|
||||
private GenerationState generateCommon(ClassBuilderFactory classBuilderFactory) {
|
||||
final AnalyzeExhaust analyzeExhaust = AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegrationAndCheckForErrors(
|
||||
myFile, JetControlFlowDataTraceFactory.EMPTY,
|
||||
CompileCompilerDependenciesTest.compilerDependenciesForTests(CompilerSpecialMode.REGULAR, false));
|
||||
myEnvironment.getCompilerDependencies());
|
||||
analyzeExhaust.throwIfError();
|
||||
AnalyzingUtils.throwExceptionOnErrors(analyzeExhaust.getBindingContext());
|
||||
GenerationState state = new GenerationState(getProject(), classBuilderFactory, analyzeExhaust, Collections.singletonList(myFile));
|
||||
state.compileCorrectFiles(CompilationErrorHandler.THROW_EXCEPTION);
|
||||
return state;
|
||||
@@ -194,8 +196,7 @@ public abstract class CodegenTestCase extends JetLiteFixture {
|
||||
|
||||
r = method;
|
||||
}
|
||||
if (r == null)
|
||||
throw new AssertionError();
|
||||
if (r == null) { throw new AssertionError(); }
|
||||
return r;
|
||||
} catch (Error e) {
|
||||
System.out.println(generateToText());
|
||||
|
||||
Reference in New Issue
Block a user