summaryrefslogtreecommitdiff
path: root/unittests/Support
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
commitd7122b8d3c48eab05d425c99fee53cde07feafe4 (patch)
tree5b9d726d9a118554ff8edc18cb4f0926b22ab5db /unittests/Support
parentd5cfc0172cd50b198484ef6bbdeee523f3d205bb (diff)
downloadllvm-d7122b8d3c48eab05d425c99fee53cde07feafe4.tar.gz
llvm-d7122b8d3c48eab05d425c99fee53cde07feafe4.tar.bz2
llvm-d7122b8d3c48eab05d425c99fee53cde07feafe4.tar.xz
Suppress stderr noise when test case runs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support')
-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 e88427ac09..480a5739f4 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;
}