aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/YAMLParserTest.cpp
diff options
context:
space:
mode:
authorNick Kledzik <kledzik@apple.com>2012-07-31 22:18:15 +0000
committerNick Kledzik <kledzik@apple.com>2012-07-31 22:18:15 +0000
commit204720bc71f69a07f111dc4ea35b959921d18bbf (patch)
treeb3d5f5a83370e2424f183e6345545fcb7868b371 /llvm/unittests/Support/YAMLParserTest.cpp
parentf4cc61d525ac0d537b0d3c72f15dfbe501d919de (diff)
downloadllvm-204720bc71f69a07f111dc4ea35b959921d18bbf.zip
llvm-204720bc71f69a07f111dc4ea35b959921d18bbf.tar.gz
llvm-204720bc71f69a07f111dc4ea35b959921d18bbf.tar.bz2
Suppress stderr noise when test case runs.
llvm-svn: 161085
Diffstat (limited to 'llvm/unittests/Support/YAMLParserTest.cpp')
-rw-r--r--llvm/unittests/Support/YAMLParserTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/unittests/Support/YAMLParserTest.cpp b/llvm/unittests/Support/YAMLParserTest.cpp
index e88427a..480a573 100644
--- a/llvm/unittests/Support/YAMLParserTest.cpp
+++ b/llvm/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;
}