[all-commits] [llvm/llvm-project] c46587: [lldb][Test] Propagate llvm::yaml error message in...

Michael137 via All-commits all-commits at lists.llvm.org
Thu Dec 15 14:46:18 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c46587bb83232bd639c1e6ba6bce2f290941675d
      https://github.com/llvm/llvm-project/commit/c46587bb83232bd639c1e6ba6bce2f290941675d
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2022-12-15 (Thu, 15 Dec 2022)

  Changed paths:
    M lldb/unittests/TestingSupport/TestUtilities.cpp

  Log Message:
  -----------
  [lldb][Test] Propagate llvm::yaml error message in TestFile::fromYaml

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.
```

Differential Revision: https://reviews.llvm.org/D140112




More information about the All-commits mailing list