This is an archive of the discontinued LLVM Phabricator instance.

[lldb][Test] Propagate llvm::yaml error message in TestFile::fromYaml
ClosedPublic

Authored by Michael137 on Dec 15 2022, 8:31 AM.

Details

Summary

Currently the test-suite would swallow the error message
on llvm::yaml::convertYAML failures.

This patch simply propagates the error string up to the caller.

Before patch:

[ RUN      ] DWARFASTParserClangTests.TestDefaultTemplateParamParsing
/Users/michaelbuch/Git/llvm-worktrees/playground/lldb/unittests/TestingSupport/Symbol/YAMLModuleTester.cpp:19: Failure
Value of: llvm::detail::TakeExpected(File)
Expected: succeeded
  Actual: failed  (convertYAML() failed: )
Assertion failed: (!HasError && "Cannot get value when an error exists!"), function getStorage, file Error.h, line 671.

After patch:

[ RUN      ] DWARFASTParserClangTests.TestDefaultTemplateParamParsing
/Users/michaelbuch/Git/llvm-worktrees/playground/lldb/unittests/TestingSupport/Symbol/YAMLModuleTester.cpp:19: Failure
Value of: llvm::detail::TakeExpected(File)
Expected: succeeded
  Actual: failed  (convertYAML() failed: wrote too much data somewhere, section offsets don't line up)
Assertion failed: (!HasError && "Cannot get value when an error exists!"), function getStorage, file Error.h, line 671.

Diff Detail

Event Timeline

Michael137 created this revision.Dec 15 2022, 8:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2022, 8:31 AM
Michael137 requested review of this revision.Dec 15 2022, 8:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2022, 8:31 AM
labath accepted this revision.Dec 15 2022, 10:50 AM
This revision is now accepted and ready to land.Dec 15 2022, 10:50 AM