diff options
| -rw-r--r-- | clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h b/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h index 642057b00d0..62f45bc1bee 100644 --- a/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h +++ b/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h @@ -76,8 +76,13 @@ runCheckOnCode(StringRef Code, std::vector<ClangTidyError> *Errors = nullptr, FileContent.second); } Invocation.setDiagnosticConsumer(&DiagConsumer); - if (!Invocation.run()) - return ""; + if (!Invocation.run()) { + std::string ErrorText; + for (const auto &Error:Context.getErrors()) { + ErrorText += Error.Message.Message + "\n"; + } + llvm::report_fatal_error(ErrorText); + } DiagConsumer.finish(); tooling::Replacements Fixes; |

