This revision was automatically updated to reflect the committed changes.
Closed by commit rGc46587bb8323: [lldb][Test] Propagate llvm::yaml error
message in TestFile::fromYaml (authored by Michael137).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D140112/new/
https://reviews.llvm.org/D140112
Files:
lldb/unittests/TestingSupport/TestUtilities.cpp
Index: lldb/unittests/TestingSupport/TestUtilities.cpp
===================================================================
--- lldb/unittests/TestingSupport/TestUtilities.cpp
+++ lldb/unittests/TestingSupport/TestUtilities.cpp
@@ -30,9 +30,11 @@
std::string Buffer;
llvm::raw_string_ostream OS(Buffer);
llvm::yaml::Input YIn(Yaml);
- if (!llvm::yaml::convertYAML(YIn, OS, [](const llvm::Twine &Msg) {}))
- return llvm::createStringError(llvm::inconvertibleErrorCode(),
- "convertYAML() failed");
+ std::string ErrorMsg("convertYAML() failed: ");
+ if (!llvm::yaml::convertYAML(YIn, OS, [&ErrorMsg](const llvm::Twine &Msg) {
+ ErrorMsg += Msg.str();
+ }))
+ return llvm::createStringError(llvm::inconvertibleErrorCode(), ErrorMsg);
return TestFile(std::move(Buffer));
}
Index: lldb/unittests/TestingSupport/TestUtilities.cpp
===================================================================
--- lldb/unittests/TestingSupport/TestUtilities.cpp
+++ lldb/unittests/TestingSupport/TestUtilities.cpp
@@ -30,9 +30,11 @@
std::string Buffer;
llvm::raw_string_ostream OS(Buffer);
llvm::yaml::Input YIn(Yaml);
- if (!llvm::yaml::convertYAML(YIn, OS, [](const llvm::Twine &Msg) {}))
- return llvm::createStringError(llvm::inconvertibleErrorCode(),
- "convertYAML() failed");
+ std::string ErrorMsg("convertYAML() failed: ");
+ if (!llvm::yaml::convertYAML(YIn, OS, [&ErrorMsg](const llvm::Twine &Msg) {
+ ErrorMsg += Msg.str();
+ }))
+ return llvm::createStringError(llvm::inconvertibleErrorCode(), ErrorMsg);
return TestFile(std::move(Buffer));
}
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits