summaryrefslogtreecommitdiff
path: root/unittests/Support/YAMLParserTest.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-08-15 19:34:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-08-15 19:34:23 +0000
commit58b69754af0cbff56b1cfce9be9392e4451f6628 (patch)
treeeacfc83d988e4b9d11114387ae7dc41243f2a363 /unittests/Support/YAMLParserTest.cpp
parent0378662f5bd3dbe8305a485b0282bceb8b52f465 (diff)
Diffstat (limited to 'unittests/Support/YAMLParserTest.cpp')
-rw-r--r--unittests/Support/YAMLParserTest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/Support/YAMLParserTest.cpp b/unittests/Support/YAMLParserTest.cpp
index e88427ac09d3..480a5739f444 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;
}