This is an archive of the discontinued LLVM Phabricator instance.

[ldb/Reproducers] Add YamlRecorder and MultiProvider
ClosedPublic

Authored by JDevlieghere on Jul 8 2020, 4:23 PM.

Details

Summary

This patch does several things that are all closely related:

  • It introduces a new YamlRecorder as a counterpart to the existing DataRecorder. As the name suggests the former serializes data as yaml while the latter uses raw texts or bytes.
  • It introduces a new MultiProvider base class which can be backed by either a DataRecorder or a YamlRecorder.
  • It reimplements the CommandProvider in terms of the new MultiProvider.
  • Finally, it adds unit testing coverage for the MultiProvider, a naive YamlProvider built on top of the new YamlRecorder and the existing MutliLoader.

This is the basis of a future patch that I'm working on which will implement a Provider through the YamlRecorder.

Diff Detail

Event Timeline

JDevlieghere created this revision.Jul 8 2020, 4:23 PM

Use ScopeExit to cleanup reproducer after test completes.

labath accepted this revision.Jul 10 2020, 3:52 AM

This seems fine. A bit more doxygen wouldn't hurt...

lldb/source/Utility/Reproducer.cpp
10

It doesn't look like this is actually needed.

lldb/unittests/Utility/ReproducerTest.cpp
64–65

superfluous semicolons

73–74

Are both of these needed? I would expect the first one to be enough...

238–240

EXPECT_THAT(data, testing::ElementsAre(data0, data1));

This revision is now accepted and ready to land.Jul 10 2020, 3:52 AM
This revision was automatically updated to reflect the committed changes.
JDevlieghere marked 5 inline comments as done.
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2020, 12:48 PM