Add NativeProcessProtocol unit tests
authorPavel Labath <pavel@labath.sk>
Mon, 24 Sep 2018 12:11:04 +0000 (12:11 +0000)
committerPavel Labath <pavel@labath.sk>
Mon, 24 Sep 2018 12:11:04 +0000 (12:11 +0000)
commit27104981ad4a94b433e227c9af0c4a8cfad58261
tree62d6481774551b6ab00b262cfbf5dea425d31d18
parentd986ede313227a5f473f83c8ba52130255955514
Add NativeProcessProtocol unit tests

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.

Reviewers: zturner, teemperor

Subscribers: mgorny, lldb-commits

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

llvm-svn: 342875
lldb/unittests/Host/CMakeLists.txt
lldb/unittests/Host/NativeProcessProtocolTest.cpp [new file with mode: 0644]