[C++20] [Modules] Fix may-be incorrect ADL for module local entities (#123931)
[llvm-project.git] / lldb / test / API / tools / lldb-server / TestGdbRemoteCompletion.py
blob58373d2f85bb99c767b11ee24c8533b57b16e14d
1 import tempfile
2 import gdbremote_testcase
3 from lldbsuite.test.lldbtest import *
4 from lldbsuite.test.decorators import *
5 from lldbgdbserverutils import *
8 class GdbRemoteCompletionTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
9 def init_lldb_server(self):
10 self.debug_monitor_exe = get_lldb_server_exe()
11 if not self.debug_monitor_exe:
12 self.skipTest("lldb-server exe not found")
13 port_file = tempfile.NamedTemporaryFile().name
14 commandline_args = ["platform", "--listen", "*:0", "--socket-file", port_file]
15 server = self.spawnSubprocess(
16 get_lldb_server_exe(), commandline_args, install_remote=False
18 self.assertIsNotNone(server)
19 self.stub_hostname = "localhost"
20 self.port = int(lldbutil.wait_for_file_on_target(self, port_file))
21 self.sock = self.create_socket()
22 self._server = Server(self.sock, server)
24 self.do_handshake()
26 def generate_hex_path(self, target):
27 return str(os.path.join(self.getBuildDir(), target)).encode().hex()
29 @skipIfRemote
30 @add_test_categories(["llgs"])
31 def test_autocomplete_path(self):
32 self.build()
33 self.init_lldb_server()
35 # Test file-included completion when flag is set to 0.
36 self.test_sequence.add_log_lines(
38 "read packet: $qPathComplete:0,{}#00".format(
39 self.generate_hex_path("main")
41 "send packet: $M{},{}#00".format(
42 self.generate_hex_path("main.d"), self.generate_hex_path("main.o")
45 True,
48 # Test directory-only completion when flag is set to 1.
49 os.makedirs(os.path.join(self.getBuildDir(), "test"))
50 self.test_sequence.add_log_lines(
52 "read packet: $qPathComplete:1,{}#00".format(
53 self.generate_hex_path("tes")
55 "send packet: $M{}{}#00".format(
56 self.generate_hex_path("test"), os.path.sep.encode().hex()
57 ), # "test/" or "test\".
59 True,
62 self.expect_gdbremote_sequence()