21
21
#include " lldb/Protocol/MCP/Resource.h"
22
22
#include " lldb/Protocol/MCP/Server.h"
23
23
#include " lldb/Protocol/MCP/Tool.h"
24
+ #include " lldb/Protocol/MCP/Transport.h"
24
25
#include " llvm/ADT/StringRef.h"
25
26
#include " llvm/Support/Error.h"
26
27
#include " llvm/Support/JSON.h"
@@ -36,19 +37,6 @@ using namespace lldb_private;
36
37
using namespace lldb_protocol ::mcp;
37
38
38
39
namespace {
39
- class TestMCPTransport final : public MCPTransport {
40
- public:
41
- TestMCPTransport (lldb::IOObjectSP in, lldb::IOObjectSP out)
42
- : lldb_protocol::mcp::MCPTransport(in, out, " unittest" ) {}
43
-
44
- using MCPTransport::Write;
45
-
46
- void Log (llvm::StringRef message) override {
47
- log_messages.emplace_back (message);
48
- }
49
-
50
- std::vector<std::string> log_messages;
51
- };
52
40
53
41
class TestServer : public Server {
54
42
public:
@@ -134,7 +122,7 @@ class ProtocolServerMCPTest : public PipePairTest {
134
122
public:
135
123
SubsystemRAII<FileSystem, HostInfo, Socket> subsystems;
136
124
137
- std::unique_ptr<TestMCPTransport > transport_up;
125
+ std::unique_ptr<lldb_protocol::mcp::Transport > transport_up;
138
126
std::unique_ptr<TestServer> server_up;
139
127
MainLoop loop;
140
128
MockMessageHandler<Request, Response, Notification> message_handler;
@@ -163,7 +151,7 @@ class ProtocolServerMCPTest : public PipePairTest {
163
151
void SetUp () override {
164
152
PipePairTest::SetUp ();
165
153
166
- transport_up = std::make_unique<TestMCPTransport >(
154
+ transport_up = std::make_unique<lldb_protocol::mcp::Transport >(
167
155
std::make_shared<NativeFile>(input.GetReadFileDescriptor (),
168
156
File::eOpenOptionReadOnly,
169
157
NativeFile::Unowned),
@@ -173,7 +161,7 @@ class ProtocolServerMCPTest : public PipePairTest {
173
161
174
162
server_up = std::make_unique<TestServer>(
175
163
" lldb-mcp" , " 0.1.0" ,
176
- std::make_unique<TestMCPTransport >(
164
+ std::make_unique<lldb_protocol::mcp::Transport >(
177
165
std::make_shared<NativeFile>(output.GetReadFileDescriptor (),
178
166
File::eOpenOptionReadOnly,
179
167
NativeFile::Unowned),
0 commit comments