This is an archive of the discontinued LLVM Phabricator instance.

Add NativeProcessProtocol unit tests
ClosedPublic

Authored by labath on Sep 16 2018, 12:02 PM.

Details

Summary

NativeProcessProtocol is an abstract class, but it still contains a
significant amount of code. Some of that code is tested via tests of
specific derived classes, but these tests don't run everywhere, as they
are OS and arch-specific. They are also relatively high-level, which
means some functionalities (particularly the failure cases) are
hard/impossible to test.

In this approach, I replace the abstract methods with mocks, which
allows me to inject failures into the lowest levels of breakpoint
setting code and test the class behavior in this situation.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

labath created this revision.Sep 16 2018, 12:02 PM
This revision was not accepted when it landed; it landed in state Needs Review.Sep 24 2018, 7:23 AM
This revision was automatically updated to reflect the committed changes.