mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
logging all compiler messages in test mode
This commit is contained in:
@@ -263,6 +263,10 @@ public class CompileContextImpl extends UserDataHolderBase implements CompileCon
|
||||
}
|
||||
|
||||
public void addMessage(CompilerMessage msg) {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
LOG.info("addMessage: " + msg);
|
||||
}
|
||||
|
||||
Collection<CompilerMessage> messages = myMessages.get(msg.getCategory());
|
||||
if (messages == null) {
|
||||
messages = new LinkedHashSet<CompilerMessage>();
|
||||
|
||||
@@ -125,6 +125,9 @@ class BuildMessageDispatcher extends SimpleChannelHandler {
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
LOG.info("messageReceived: " + builderMessage);
|
||||
}
|
||||
handler.handleBuildMessage(ctx.getChannel(), sessionId, builderMessage);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -109,6 +109,9 @@ final class BuildSession implements Runnable, CanceledStatus {
|
||||
if (kind == BuildMessage.Kind.ERROR) {
|
||||
hasErrors.set(true);
|
||||
}
|
||||
if (Utils.IS_TEST_MODE) {
|
||||
LOG.info("Processing message: " + buildMessage);
|
||||
}
|
||||
response = CmdlineProtoUtil.createCompileMessage(
|
||||
kind, text, compilerMessage.getSourcePath(),
|
||||
compilerMessage.getProblemBeginOffset(), compilerMessage.getProblemEndOffset(),
|
||||
|
||||
+12
-12
@@ -207,26 +207,26 @@ public abstract class GroovyCompilerTest extends GroovyCompilerTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
void runTest() {
|
||||
def ideaLog = new File(TestLoggerFactory.testLogDir, "idea.log")
|
||||
def makeLog = new File(PathManager.systemPath, "compile-server/server.log")
|
||||
if (ideaLog.exists()) {
|
||||
FileUtil.delete(ideaLog)
|
||||
}
|
||||
if (makeLog.exists()) {
|
||||
FileUtil.delete(makeLog)
|
||||
}
|
||||
void runBare() {
|
||||
new File(TestLoggerFactory.testLogDir, "idea.log").delete()
|
||||
new File(PathManager.systemPath, "compile-server/server.log").delete()
|
||||
super.runBare()
|
||||
}
|
||||
|
||||
@Override
|
||||
void runTest() {
|
||||
try {
|
||||
super.runTest()
|
||||
}
|
||||
catch (Throwable e) {
|
||||
def ideaLog = new File(TestLoggerFactory.testLogDir, "idea.log")
|
||||
if (ideaLog.exists()) {
|
||||
//println "Idea Log:"
|
||||
//println ideaLog.text
|
||||
println "\n\nIdea Log:"
|
||||
println ideaLog.text
|
||||
}
|
||||
def makeLog = new File(PathManager.systemPath, "compile-server/server.log")
|
||||
if (makeLog.exists()) {
|
||||
println "Server Log:"
|
||||
println "\n\nServer Log:"
|
||||
println makeLog.text
|
||||
}
|
||||
throw e
|
||||
|
||||
Reference in New Issue
Block a user