diff --git a/test_helpers/src/main/java/com/google/errorprone/CompilationTestHelper.java b/test_helpers/src/main/java/com/google/errorprone/CompilationTestHelper.java index 6c58b493562d..5e406f00ee4a 100644 --- a/test_helpers/src/main/java/com/google/errorprone/CompilationTestHelper.java +++ b/test_helpers/src/main/java/com/google/errorprone/CompilationTestHelper.java @@ -313,6 +313,11 @@ public void doTest() { fail(diagnostic.getMessage(Locale.ENGLISH)); } } + String stringifiedOutput = outputStream.toString(UTF_8); + assertWithMessage("ErrorProne suffered an internal crash: %s", stringifiedOutput) + .that(stringifiedOutput) + .doesNotContain("An exception has occurred in the compiler"); + if (expectNoDiagnostics) { List> diagnostics = diagnosticHelper.getDiagnostics(); assertWithMessage(