X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=unittests%2FSupport%2FYAMLParserTest.cpp;h=480a5739f44464092d8901e536e4cf0ec8042fd4;hb=b21d9aebba7e45ddcbce61dd501000049cefb335;hp=e88427ac09d3eee87da3eae92eba93f37178d304;hpb=93210e847a1496b24cef881723e57c489082dcfe;p=oota-llvm.git diff --git a/unittests/Support/YAMLParserTest.cpp b/unittests/Support/YAMLParserTest.cpp index e88427ac09d..480a5739f44 100644 --- a/unittests/Support/YAMLParserTest.cpp +++ b/unittests/Support/YAMLParserTest.cpp @@ -16,11 +16,17 @@ namespace llvm { +static void SuppressDiagnosticsOutput(const SMDiagnostic &, void *) { + // Prevent SourceMgr from writing errors to stderr + // to reduce noise in unit test runs. +} + // Checks that the given input gives a parse error. Makes sure that an error // text is available and the parse fails. static void ExpectParseError(StringRef Message, StringRef Input) { SourceMgr SM; yaml::Stream Stream(Input, SM); + SM.setDiagHandler(SuppressDiagnosticsOutput); EXPECT_FALSE(Stream.validate()) << Message << ": " << Input; EXPECT_TRUE(Stream.failed()) << Message << ": " << Input; }