Better error reporting from the compiler to the IDE

This commit is contained in:
Andrey Breslav
2012-02-29 15:11:34 +04:00
parent 461c8d773d
commit 200b6fbd91
10 changed files with 395 additions and 180 deletions
+1
View File
@@ -13,6 +13,7 @@
<orderEntry type="module" module-name="stdlib" />
<orderEntry type="module" module-name="cli" />
<orderEntry type="library" name="idea-full" level="project" />
<orderEntry type="library" name="asm" level="project" />
</component>
</module>
@@ -99,7 +99,7 @@ public class ForTestCompileStdlib {
private static void compileKotlinPartOfStdlib(File destdir) throws IOException {
// lame
KotlinCompiler.exec("-output", destdir.getPath(), "-src", "./stdlib/ktSrc", "-stdlib", destdir.getAbsolutePath());
KotlinCompiler.exec(System.err, "-output", destdir.getPath(), "-src", "./stdlib/ktSrc", "-stdlib", destdir.getAbsolutePath());
}
private static List<File> javaFilesInDir(File dir) {
@@ -22,6 +22,7 @@ import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.jetbrains.jet.compiler.CompileSession;
import org.jetbrains.jet.compiler.MessageRenderer;
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
import org.jetbrains.jet.lang.psi.JetClass;
import org.jetbrains.jet.lang.psi.JetDeclaration;
@@ -84,7 +85,7 @@ public class TestlibTest extends CodegenTestCase {
session.addSources(localFileSystem.findFileByPath(JetParsingTest.getTestDataDir() + "/../../testlib/test"));
session.addSources(localFileSystem.findFileByPath(JetParsingTest.getTestDataDir() + "/../../kunit/src"));
if (!session.analyze(System.err)) {
if (!session.analyze(System.err, MessageRenderer.PLAIN)) {
throw new RuntimeException("There were compilation errors");
}