Fixing test data to account for new logging
This commit is contained in:
@@ -2,8 +2,10 @@ OUT Buildfile: build.xml
|
|||||||
OUT
|
OUT
|
||||||
OUT build:
|
OUT build:
|
||||||
OUT [kotlinc] Compiling [[TestData]/hello.kt] => [[Temp]/hello.jar]
|
OUT [kotlinc] Compiling [[TestData]/hello.kt] => [[Temp]/hello.jar]
|
||||||
OUT [kotlinc] LOGGING: Emitting: Hello/namespace.class
|
OUT [kotlinc] OUTPUT: Output:
|
||||||
OUT [kotlinc] LOGGING: For source: [TestData]/hello.kt
|
OUT [kotlinc] Hello/namespace.class
|
||||||
|
OUT [kotlinc] Sources:
|
||||||
|
OUT [kotlinc] [TestData]/hello.kt
|
||||||
OUT
|
OUT
|
||||||
OUT BUILD SUCCESSFUL
|
OUT BUILD SUCCESSFUL
|
||||||
OUT Total time: [time]
|
OUT Total time: [time]
|
||||||
|
|||||||
@@ -73,5 +73,6 @@ public final class JetCompilerMessagingTest extends IDECompilerMessagingTest {
|
|||||||
checker.expect(Message.info().textStartsWith("Using kotlinHome="));
|
checker.expect(Message.info().textStartsWith("Using kotlinHome="));
|
||||||
checker.expect(Message.info().textStartsWith("Invoking in-process compiler"));
|
checker.expect(Message.info().textStartsWith("Invoking in-process compiler"));
|
||||||
checker.expect(Message.info().textStartsWith("Kotlin Compiler version"));
|
checker.expect(Message.info().textStartsWith("Kotlin Compiler version"));
|
||||||
|
checker.expect(Message.stats().text("Configuring the compilation environment"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import org.jetbrains.jet.plugin.compiler.K2JSCompiler;
|
|||||||
import org.jetbrains.jet.plugin.project.K2JSModuleComponent;
|
import org.jetbrains.jet.plugin.project.K2JSModuleComponent;
|
||||||
|
|
||||||
import static org.jetbrains.jet.plugin.compilerMessages.Message.error;
|
import static org.jetbrains.jet.plugin.compilerMessages.Message.error;
|
||||||
|
import static org.jetbrains.jet.plugin.compilerMessages.Message.stats;
|
||||||
import static org.jetbrains.jet.plugin.compilerMessages.Message.warning;
|
import static org.jetbrains.jet.plugin.compilerMessages.Message.warning;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,5 +85,6 @@ public final class K2JSCompilerMessagingTest extends IDECompilerMessagingTest {
|
|||||||
@Override
|
@Override
|
||||||
protected void checkHeader(@NotNull MessageChecker checker) {
|
protected void checkHeader(@NotNull MessageChecker checker) {
|
||||||
checker.expect(Message.info().textStartsWith("Kotlin Compiler version"));
|
checker.expect(Message.info().textStartsWith("Kotlin Compiler version"));
|
||||||
|
checker.expect(stats().textMatchesRegexp("Compiling source files: .*/src/test.kt"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,11 @@ public final class Message {
|
|||||||
return new Message(CompilerMessageCategory.INFORMATION);
|
return new Message(CompilerMessageCategory.INFORMATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static Message stats() {
|
||||||
|
return new Message(CompilerMessageCategory.STATISTICS);
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public CompilerMessageCategory category;
|
public CompilerMessageCategory category;
|
||||||
@Nullable
|
@Nullable
|
||||||
@@ -50,6 +55,8 @@ public final class Message {
|
|||||||
public String message = null;
|
public String message = null;
|
||||||
@Nullable
|
@Nullable
|
||||||
public String textStartsWith = null;
|
public String textStartsWith = null;
|
||||||
|
@Nullable
|
||||||
|
private String textMatchesRegexp = null;
|
||||||
public int column = -1;
|
public int column = -1;
|
||||||
public int line = -1;
|
public int line = -1;
|
||||||
|
|
||||||
@@ -80,6 +87,11 @@ public final class Message {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Message textMatchesRegexp(String regexp) {
|
||||||
|
this.textMatchesRegexp = regexp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public void check(@NotNull Message other) {
|
public void check(@NotNull Message other) {
|
||||||
checkMessages(other);
|
checkMessages(other);
|
||||||
Assert.assertEquals(other.category, this.category);
|
Assert.assertEquals(other.category, this.category);
|
||||||
@@ -96,6 +108,11 @@ public final class Message {
|
|||||||
other.message.startsWith(textStartsWith));
|
other.message.startsWith(textStartsWith));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (textMatchesRegexp != null) {
|
||||||
|
Assert.assertTrue("Message should match regexp:\n" + textMatchesRegexp + "\nBut it is:\n" + other.message,
|
||||||
|
other.message.matches(textMatchesRegexp));
|
||||||
|
return;
|
||||||
|
}
|
||||||
Assert.assertEquals(other.message, this.message);
|
Assert.assertEquals(other.message, this.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public final class MessageChecker {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public MessageChecker expect(@NotNull Message message) {
|
public MessageChecker expect(@NotNull Message message) {
|
||||||
assertTrue("More messages expected:\n" + message.message, iterator.hasNext());
|
assertTrue("Expected message not present:\n" + message, iterator.hasNext());
|
||||||
message.check(iterator.next());
|
message.check(iterator.next());
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user