mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 17:24:48 +00:00
Suppress stderr noise when test case runs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161085 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -16,11 +16,17 @@
|
|||||||
|
|
||||||
namespace llvm {
|
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
|
// Checks that the given input gives a parse error. Makes sure that an error
|
||||||
// text is available and the parse fails.
|
// text is available and the parse fails.
|
||||||
static void ExpectParseError(StringRef Message, StringRef Input) {
|
static void ExpectParseError(StringRef Message, StringRef Input) {
|
||||||
SourceMgr SM;
|
SourceMgr SM;
|
||||||
yaml::Stream Stream(Input, SM);
|
yaml::Stream Stream(Input, SM);
|
||||||
|
SM.setDiagHandler(SuppressDiagnosticsOutput);
|
||||||
EXPECT_FALSE(Stream.validate()) << Message << ": " << Input;
|
EXPECT_FALSE(Stream.validate()) << Message << ": " << Input;
|
||||||
EXPECT_TRUE(Stream.failed()) << Message << ": " << Input;
|
EXPECT_TRUE(Stream.failed()) << Message << ": " << Input;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user