use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testParseTargetError.
@Test
public void testParseTargetError() {
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
IssueOutput issue = blazeIssueParser.parseIssue("ERROR: invalid target format " + "'//javatests/com/google/devtools/aswb/testapps/aswbtestlib/...:alls': " + "invalid package name " + "'javatests/com/google/devtools/aswb/testapps/aswbtestlib/...': " + "package name component contains only '.' characters.");
assertThat(issue).isNotNull();
assertThat(issue.getCategory()).isEqualTo(IssueOutput.Category.ERROR);
}
use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testMultipleIssues.
@Test
public void testMultipleIssues() {
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
IssueOutput issue = blazeIssueParser.parseIssue("ERROR: /home/plumpy/whatever:char offsets 1222--1229: name 'grubber' is not defined");
assertThat(issue).isNotNull();
issue = blazeIssueParser.parseIssue("ERROR: /home/plumpy/whatever:char offsets 1222--1229: name 'grubber' is not defined");
assertThat(issue).isNotNull();
issue = blazeIssueParser.parseIssue("ERROR: /home/plumpy/whatever:char offsets 1222--1229: name 'grubber' is not defined");
assertThat(issue).isNotNull();
}
use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testParseCompileFatalErrorWithColumn.
@Test
public void testParseCompileFatalErrorWithColumn() {
// Clang also has a 'fatal error' category.
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
IssueOutput issue = blazeIssueParser.parseIssue("net/something/foo_bar.cc:29:10: fatal error: 'util/ptr_util2.h' file not found");
assertThat(issue).isNotNull();
assertThat(issue.getLine()).isEqualTo(29);
assertThat(issue.getColumn()).isEqualTo(10);
assertThat(issue.getMessage()).isEqualTo("'util/ptr_util2.h' file not found");
assertThat(issue.getCategory()).isEqualTo(IssueOutput.Category.ERROR);
assertThat(issue.getConsoleHyperlinkRange()).isEqualTo(TextRange.create(0, "net/something/foo_bar.cc:29:10".length()));
}
use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testParseCompileError.
@Test
public void testParseCompileError() {
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
IssueOutput issue = blazeIssueParser.parseIssue("java/com/google/android/samples/helloroot/math/DivideMath.java:17: error: " + "non-static variable this cannot be referenced from a static context");
assertThat(issue).isNotNull();
assertThat(issue.getFile().getPath()).isEqualTo("/root/java/com/google/android/samples/helloroot/math/DivideMath.java");
assertThat(issue.getLine()).isEqualTo(17);
assertThat(issue.getColumn()).isEqualTo(-1);
assertThat(issue.getMessage()).isEqualTo("non-static variable this cannot be referenced from a static context");
assertThat(issue.getCategory()).isEqualTo(IssueOutput.Category.ERROR);
assertThat(issue.getConsoleHyperlinkRange()).isEqualTo(TextRange.create(0, "java/com/google/android/samples/helloroot/math/DivideMath.java:17".length()));
}
use of com.google.idea.blaze.base.scope.output.IssueOutput in project intellij by bazelbuild.
the class BlazeIssueParserTest method testParseSkylarkError.
@Test
public void testParseSkylarkError() {
BlazeIssueParser blazeIssueParser = new BlazeIssueParser(parsers);
IssueOutput issue = blazeIssueParser.parseIssue("ERROR: /root/third_party/bazel/tools/ide/intellij_info_impl.bzl:42:12: " + "Variable artifact_location is read only");
assertThat(issue).isNotNull();
assertThat(issue.getFile().getPath()).isEqualTo("/root/third_party/bazel/tools/ide/intellij_info_impl.bzl");
assertThat(issue.getLine()).isEqualTo(42);
assertThat(issue.getColumn()).isEqualTo(12);
assertThat(issue.getMessage()).isEqualTo("Variable artifact_location is read only");
assertThat(issue.getCategory()).isEqualTo(IssueOutput.Category.ERROR);
assertThat(issue.getConsoleHyperlinkRange()).isEqualTo(TextRange.create("ERROR: ".length(), "ERROR: /root/third_party/bazel/tools/ide/intellij_info_impl.bzl:42:12".length()));
}
Aggregations