Support Unit Testing debugserver
authorChris Bieneman <beanz@apple.com>
Wed, 12 Apr 2017 21:56:29 +0000 (21:56 +0000)
committerChris Bieneman <beanz@apple.com>
Wed, 12 Apr 2017 21:56:29 +0000 (21:56 +0000)
commitefd065e6a0e3724660970efd63a095a313c7457a
tree8227205e05d81207fee05695a1d1ceb1e54b6b52
parent46afbbb210369c459ceafa76ae411b7f163b7ce1
Support Unit Testing debugserver

Summary:
This patch refactors the CMake build system's support for building debugserver to allow us to build the majority of debugserver's sources into the debugserverCommon library which can then be reused by unit tests.

The first unit test I've written tests debug server's ability to accept incoming connections from LLDB. The test forks the process, and one side creates a listening socket using debugserver's socket API, the other side creates a transmitting socket using LLDB's TCPSocket class.

I have no clue where to even start getting this connected into the LLDB Xcode project, so for now these tests are CMake-only.

Reviewers: zturner, labath, jasonmolenda

Subscribers: lldb-commits, mgorny

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

llvm-svn: 300111
lldb/tools/debugserver/source/CMakeLists.txt
lldb/tools/debugserver/source/MacOSX/CMakeLists.txt
lldb/unittests/CMakeLists.txt
lldb/unittests/debugserver/CMakeLists.txt [new file with mode: 0644]
lldb/unittests/debugserver/RNBSocketTest.cpp [new file with mode: 0644]
lldb/unittests/debugserver/debugserver_LogCallback.cpp [new file with mode: 0644]