@Test
public void testMultilineCmakeErrorInFileWithLineNumber() {

  String prefix = "CMake Error: Error in cmake code at\n";
  int lineNumber = 13;
  String filePath = sourceFile.getAbsolutePath();
  String fileAndLineNumber =
    String.format(Locale.getDefault(), "%s:%d:\n", filePath, lineNumber);
  String warning = "CMake Warning: warning message\n";
  String err = warning + prefix + fileAndLineNumber;
  BuildOutputInstantReader reader = new TestBuildOutputInstantReader(err);
  ArgumentCaptor<BuildEvent> captor = ArgumentCaptor.forClass(BuildEvent.class);
  assertThat(parser.parse(reader.readLine(), reader, messageConsumer)).isTrue();
  assertThat(parser.parse(reader.readLine(), reader, messageConsumer)).isTrue();
  verify(messageConsumer, times(2)).accept(captor.capture());
  assertThat(captor.getAllValues()).hasSize(2);
  verifyMessageEvent(captor.getAllValues().get(0), MessageEvent.Kind.WARNING, "CMake warnings");
  verifyFileMessageEvent(captor.getAllValues().get(1), filePath, "CMake errors", MessageEvent.Kind.ERROR, lineNumber, 0);
}