[llvm-commits] [llvm] r161085 - /llvm/trunk/unittests/Support/YAMLParserTest.cpp

Nick Kledzik kledzik at apple.com
Tue Jul 31 15:18:15 PDT 2012


Author: kledzik
Date: Tue Jul 31 17:18:15 2012
New Revision: 161085

URL: http://llvm.org/viewvc/llvm-project?rev=161085&view=rev
Log:
Suppress stderr noise when test case runs.

Modified:
    llvm/trunk/unittests/Support/YAMLParserTest.cpp

Modified: llvm/trunk/unittests/Support/YAMLParserTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/YAMLParserTest.cpp?rev=161085&r1=161084&r2=161085&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/YAMLParserTest.cpp (original)
+++ llvm/trunk/unittests/Support/YAMLParserTest.cpp Tue Jul 31 17:18:15 2012
@@ -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;
 }





More information about the llvm-commits mailing list