8
8
9
9
10
10
class GdbRemoteLaunchTestCase (gdbremote_testcase .GdbRemoteTestCaseBase ):
11
+ def get_exe_path (self ):
12
+ exe_path = self .getBuildArtifact ("a.out" )
13
+ if lldb .remote_platform :
14
+ remote_path = lldbutil .append_to_process_working_directory (self , "a.out" )
15
+ err = lldb .remote_platform .Install (
16
+ lldb .SBFileSpec (exe_path , True ), lldb .SBFileSpec (remote_path , False )
17
+ )
18
+ if err .Fail ():
19
+ raise Exception (
20
+ "remote_platform.Install('%s', '%s') failed: %s"
21
+ % (exe_path , remote_path , err )
22
+ )
23
+ exe_path = remote_path
24
+ return exe_path
25
+
11
26
@skipIfWindows # No pty support to test any inferior output
12
27
@add_test_categories (["llgs" ])
13
28
def test_launch_via_A (self ):
14
29
self .build ()
15
- exe_path = self .getBuildArtifact ("a.out" )
16
- args = [exe_path , "stderr:arg1" , "stderr:arg2" , "stderr:arg3" ]
17
- hex_args = [seven .hexlify (x ) for x in args ]
18
-
19
30
server = self .connect_to_debug_monitor ()
20
31
self .assertIsNotNone (server )
21
32
self .do_handshake ()
33
+ exe_path = self .get_exe_path ()
34
+ args = [exe_path , "stderr:arg1" , "stderr:arg2" , "stderr:arg3" ]
35
+ hex_args = [seven .hexlify (x ) for x in args ]
36
+
22
37
# NB: strictly speaking we should use %x here but this packet
23
38
# is deprecated, so no point in changing lldb-server's expectations
24
39
self .test_sequence .add_log_lines (
@@ -38,13 +53,13 @@ def test_launch_via_A(self):
38
53
@add_test_categories (["llgs" ])
39
54
def test_launch_via_vRun (self ):
40
55
self .build ()
41
- exe_path = self .getBuildArtifact ("a.out" )
42
- args = [exe_path , "stderr:arg1" , "stderr:arg2" , "stderr:arg3" ]
43
- hex_args = [seven .hexlify (x ) for x in args ]
44
-
45
56
server = self .connect_to_debug_monitor ()
46
57
self .assertIsNotNone (server )
47
58
self .do_handshake ()
59
+ exe_path = self .get_exe_path ()
60
+ args = [exe_path , "stderr:arg1" , "stderr:arg2" , "stderr:arg3" ]
61
+ hex_args = [seven .hexlify (x ) for x in args ]
62
+
48
63
self .test_sequence .add_log_lines (
49
64
[
50
65
"read packet: $vRun;%s;%s;%s;%s#00" % tuple (hex_args ),
@@ -60,12 +75,12 @@ def test_launch_via_vRun(self):
60
75
@add_test_categories (["llgs" ])
61
76
def test_launch_via_vRun_no_args (self ):
62
77
self .build ()
63
- exe_path = self .getBuildArtifact ("a.out" )
64
- hex_path = seven .hexlify (exe_path )
65
-
66
78
server = self .connect_to_debug_monitor ()
67
79
self .assertIsNotNone (server )
68
80
self .do_handshake ()
81
+ exe_path = self .get_exe_path ()
82
+ hex_path = seven .hexlify (exe_path )
83
+
69
84
self .test_sequence .add_log_lines (
70
85
[
71
86
"read packet: $vRun;%s#00" % (hex_path ,),
@@ -78,6 +93,7 @@ def test_launch_via_vRun_no_args(self):
78
93
self .expect_gdbremote_sequence ()
79
94
80
95
@add_test_categories (["llgs" ])
96
+ @skipIfRemote
81
97
def test_launch_failure_via_vRun (self ):
82
98
self .build ()
83
99
exe_path = self .getBuildArtifact ("a.out" )
@@ -110,14 +126,13 @@ def test_launch_failure_via_vRun(self):
110
126
@add_test_categories (["llgs" ])
111
127
def test_QEnvironment (self ):
112
128
self .build ()
113
- exe_path = self .getBuildArtifact ("a.out" )
114
- env = {"FOO" : "test" , "BAR" : "a=z" }
115
- args = [exe_path , "print-env:FOO" , "print-env:BAR" ]
116
- hex_args = [seven .hexlify (x ) for x in args ]
117
-
118
129
server = self .connect_to_debug_monitor ()
119
130
self .assertIsNotNone (server )
120
131
self .do_handshake ()
132
+ exe_path = self .get_exe_path ()
133
+ env = {"FOO" : "test" , "BAR" : "a=z" }
134
+ args = [exe_path , "print-env:FOO" , "print-env:BAR" ]
135
+ hex_args = [seven .hexlify (x ) for x in args ]
121
136
122
137
for key , value in env .items ():
123
138
self .test_sequence .add_log_lines (
@@ -143,14 +158,13 @@ def test_QEnvironment(self):
143
158
@add_test_categories (["llgs" ])
144
159
def test_QEnvironmentHexEncoded (self ):
145
160
self .build ()
146
- exe_path = self .getBuildArtifact ("a.out" )
147
- env = {"FOO" : "test" , "BAR" : "a=z" , "BAZ" : "a*}#z" }
148
- args = [exe_path , "print-env:FOO" , "print-env:BAR" , "print-env:BAZ" ]
149
- hex_args = [seven .hexlify (x ) for x in args ]
150
-
151
161
server = self .connect_to_debug_monitor ()
152
162
self .assertIsNotNone (server )
153
163
self .do_handshake ()
164
+ exe_path = self .get_exe_path ()
165
+ env = {"FOO" : "test" , "BAR" : "a=z" , "BAZ" : "a*}#z" }
166
+ args = [exe_path , "print-env:FOO" , "print-env:BAR" , "print-env:BAZ" ]
167
+ hex_args = [seven .hexlify (x ) for x in args ]
154
168
155
169
for key , value in env .items ():
156
170
hex_enc = seven .hexlify ("%s=%s" % (key , value ))
0 commit comments