Search in sources :

Example 1 with IssueOutput

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);
}
Also used : IssueOutput(com.google.idea.blaze.base.scope.output.IssueOutput) Test(org.junit.Test)

Example 2 with IssueOutput

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();
}
Also used : IssueOutput(com.google.idea.blaze.base.scope.output.IssueOutput) Test(org.junit.Test)

Example 3 with IssueOutput

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()));
}
Also used : IssueOutput(com.google.idea.blaze.base.scope.output.IssueOutput) Test(org.junit.Test)

Example 4 with IssueOutput

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()));
}
Also used : IssueOutput(com.google.idea.blaze.base.scope.output.IssueOutput) Test(org.junit.Test)

Example 5 with IssueOutput

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()));
}
Also used : IssueOutput(com.google.idea.blaze.base.scope.output.IssueOutput) Test(org.junit.Test)

Aggregations

IssueOutput (com.google.idea.blaze.base.scope.output.IssueOutput)27 Test (org.junit.Test)19 Nullable (javax.annotation.Nullable)4 ProjectViewSet (com.google.idea.blaze.base.projectview.ProjectViewSet)3 File (java.io.File)3 List (java.util.List)3 WorkspacePath (com.google.idea.blaze.base.model.primitives.WorkspacePath)2 WorkspaceRoot (com.google.idea.blaze.base.model.primitives.WorkspaceRoot)2 ProjectViewFile (com.google.idea.blaze.base.projectview.ProjectViewSet.ProjectViewFile)2 ProjectViewParser (com.google.idea.blaze.base.projectview.parser.ProjectViewParser)2 DirectoryEntry (com.google.idea.blaze.base.projectview.section.sections.DirectoryEntry)2 Scope (com.google.idea.blaze.base.scope.Scope)2 BuildSystem (com.google.idea.blaze.base.settings.Blaze.BuildSystem)2 WorkspacePathResolver (com.google.idea.blaze.base.sync.workspace.WorkspacePathResolver)2 BlazeValidationError (com.google.idea.blaze.base.ui.BlazeValidationError)2 BlazeValidationResult (com.google.idea.blaze.base.ui.BlazeValidationResult)2 UiUtil (com.google.idea.blaze.base.ui.UiUtil)2 ProjectDataDirectoryValidator (com.google.idea.blaze.base.wizard2.ProjectDataDirectoryValidator)2 Disposable (com.intellij.openapi.Disposable)2 Logger (com.intellij.openapi.diagnostic.Logger)2