[PATCH] D82435: [DWARFYAML][debug_gnu_*] Add the missing context `IsGNUStyle`. NFC.
Xing GUO via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 25 01:57:02 PDT 2020
Higuoxing marked an inline comment as done.
Higuoxing added inline comments.
================
Comment at: llvm/unittests/ObjectYAML/DWARFYAMLTest.cpp:29-35
+ testing::internal::CaptureStderr();
+ auto SectionsOrErr = DWARFYAML::emitDebugSections(Yaml);
+ EXPECT_THAT_ERROR(SectionsOrErr.takeError(), Failed());
+ ASSERT_EQ(testing::internal::GetCapturedStderr(),
+ std::string("YAML:10:19: error: unknown key 'Descriptor'\n"
+ " Descriptor: 0x12\n"
+ " ^~~~\n"));
----------------
jhenderson wrote:
> Rather than capturing stderr, you could use: `EXPECT_THAT_EXPECTED(SectionsOrErr, FailedWithMessage("error message"));`
I think the simplest way to check the error message is capturing the stderr here because the error message is printed to the `errs()`. If we use `FailedWithMessage()` we will get `Invalid argument`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82435/new/
https://reviews.llvm.org/D82435
More information about the llvm-commits
mailing list