8
8
class TestSimulatorPlatformLaunching (TestBase ):
9
9
NO_DEBUG_INFO_TESTCASE = True
10
10
11
- def check_load_commands (self , expected_load_command ):
12
- """sanity check the built binary for the expected number of load commands"""
13
- load_cmds = subprocess .check_output (
14
- ["otool" , "-l" , self .getBuildArtifact ()]
15
- ).decode ("utf-8" )
16
- found = 0
17
- for line in load_cmds .split ("\n " ):
18
- if expected_load_command in line :
19
- found += 1
20
- self .assertEqual (
21
- found ,
22
- 1 ,
23
- "wrong number of load commands for {}" .format (expected_load_command ),
24
- )
25
-
26
11
def check_debugserver (self , log , expected_platform , expected_version ):
27
12
"""scan the debugserver packet log"""
28
13
process_info = lldbutil .packetlog_get_process_info (log )
@@ -39,8 +24,7 @@ def check_debugserver(self, log, expected_platform, expected_version):
39
24
if expected_version :
40
25
self .assertEqual (aout_info ["min_version_os_sdk" ], expected_version )
41
26
42
- @skipIf (bugnumber = "rdar://76995109" )
43
- def run_with (self , arch , os , vers , env , expected_load_command ):
27
+ def run_with (self , arch , os , vers , env ):
44
28
env_list = [env ] if env else []
45
29
triple = "-" .join ([arch , "apple" , os + vers ] + env_list )
46
30
sdk = lldbutil .get_xcode_sdk (os , env )
@@ -61,11 +45,11 @@ def run_with(self, arch, os, vers, env, expected_load_command):
61
45
"ARCH" : arch ,
62
46
"ARCH_CFLAGS" : "-target {} {}" .format (triple , version_min ),
63
47
"SDKROOT" : sdk_root ,
48
+ "USE_SYSTEM_STDLIB" : 1 ,
64
49
},
65
50
compiler = clang ,
66
51
)
67
52
68
- self .check_load_commands (expected_load_command )
69
53
log = self .getBuildArtifact ("packets.log" )
70
54
self .expect ("log enable gdb-remote packets -f " + log )
71
55
lldbutil .run_to_source_breakpoint (
@@ -86,183 +70,60 @@ def test_ios(self):
86
70
os = "ios" ,
87
71
vers = "" ,
88
72
env = "simulator" ,
89
- expected_load_command = "LC_BUILD_VERSION" ,
90
73
)
91
74
92
75
@skipIfAsan
93
76
@skipUnlessDarwin
94
77
@skipIfDarwinEmbedded
95
78
@apple_simulator_test ("appletv" )
96
79
def test_tvos (self ):
97
- """Test running an tvOS simulator binary"""
80
+ """Test running a tvOS simulator binary"""
98
81
self .run_with (
99
82
arch = self .getArchitecture (),
100
83
os = "tvos" ,
101
84
vers = "" ,
102
85
env = "simulator" ,
103
- expected_load_command = "LC_BUILD_VERSION" ,
104
86
)
105
87
106
88
@skipIfAsan
107
89
@skipUnlessDarwin
108
90
@skipIfDarwinEmbedded
109
- @apple_simulator_test ("watch" )
110
- @skipIfDarwin # rdar://problem/64552748
111
- @skipIf (archs = ["arm64" , "arm64e" ])
112
- def test_watchos_i386 (self ):
113
- """Test running a 32-bit watchOS simulator binary"""
91
+ @apple_simulator_test ("appletv" )
92
+ def test_watchos (self ):
93
+ """Test running a watchOS simulator binary"""
114
94
self .run_with (
115
- arch = "i386" ,
95
+ arch = self . getArchitecture () ,
116
96
os = "watchos" ,
117
97
vers = "" ,
118
98
env = "simulator" ,
119
- expected_load_command = "LC_BUILD_VERSION" ,
120
99
)
121
100
122
101
@skipIfAsan
123
102
@skipUnlessDarwin
124
103
@skipIfDarwinEmbedded
125
104
@apple_simulator_test ("watch" )
126
105
@skipIfDarwin # rdar://problem/64552748
127
- @skipIf (archs = ["i386" , "x86_64" ])
128
- def test_watchos_armv7k (self ):
129
- """Test running a 32-bit watchOS simulator binary"""
130
- self .run_with (
131
- arch = "armv7k" ,
132
- os = "watchos" ,
133
- vers = "" ,
134
- env = "simulator" ,
135
- expected_load_command = "LC_BUILD_VERSION" ,
136
- )
137
-
138
- #
139
- # Back-deployment tests.
140
- #
141
- # Older Mach-O versions used less expressive load commands, such
142
- # as LC_VERSION_MIN_IPHONEOS that wouldn't distinguish between ios
143
- # and ios-simulator. When targeting a simulator on Apple Silicon
144
- # macOS, however, these legacy load commands are never generated.
145
- #
146
-
147
- @skipUnlessDarwin
148
- @skipIfDarwinEmbedded
149
- def test_lc_version_min_macosx (self ):
150
- """Test running a back-deploying non-simulator MacOS X binary"""
151
- self .run_with (
152
- arch = self .getArchitecture (),
153
- os = "macosx" ,
154
- vers = "10.9" ,
155
- env = "" ,
156
- expected_load_command = "LC_VERSION_MIN_MACOSX" ,
157
- )
158
-
159
- @skipIfAsan
160
- @skipUnlessDarwin
161
- @skipIfDarwinEmbedded
162
- @apple_simulator_test ("iphone" )
163
- @skipIf (archs = ["arm64" , "arm64e" ])
164
- def test_lc_version_min_iphoneos (self ):
165
- """Test running a back-deploying iOS simulator binary
166
- with a legacy iOS load command"""
167
- self .run_with (
168
- arch = self .getArchitecture (),
169
- os = "ios" ,
170
- vers = "11.0" ,
171
- env = "simulator" ,
172
- expected_load_command = "LC_VERSION_MIN_IPHONEOS" ,
173
- )
174
-
175
- @skipIfAsan
176
- @skipUnlessDarwin
177
- @skipIfDarwinEmbedded
178
- @apple_simulator_test ("iphone" )
179
106
@skipIf (archs = ["arm64" , "arm64e" ])
180
- def test_ios_backdeploy_x86 (self ):
181
- """Test running a back-deploying iOS simulator binary
182
- with a legacy iOS load command"""
183
- self .run_with (
184
- arch = self .getArchitecture (),
185
- os = "ios" ,
186
- vers = "13.0" ,
187
- env = "simulator" ,
188
- expected_load_command = "LC_BUILD_VERSION" ,
189
- )
190
-
191
- @skipIfAsan
192
- @skipUnlessDarwin
193
- @skipIfDarwinEmbedded
194
- @apple_simulator_test ("iphone" )
195
- @skipIf (archs = ["i386" , "x86_64" ])
196
- def test_ios_backdeploy_apple_silicon (self ):
197
- """Test running a back-deploying iOS simulator binary"""
198
- self .run_with (
199
- arch = self .getArchitecture (),
200
- os = "ios" ,
201
- vers = "11.0" ,
202
- env = "simulator" ,
203
- expected_load_command = "LC_BUILD_VERSION" ,
204
- )
205
-
206
- @skipIfAsan
207
- @skipUnlessDarwin
208
- @skipIfDarwinEmbedded
209
- @apple_simulator_test ("appletv" )
210
- @skipIf (archs = ["arm64" , "arm64e" ])
211
- def test_lc_version_min_tvos (self ):
212
- """Test running a back-deploying tvOS simulator binary
213
- with a legacy tvOS load command"""
214
- self .run_with (
215
- arch = self .getArchitecture (),
216
- os = "tvos" ,
217
- vers = "11.0" ,
218
- env = "simulator" ,
219
- expected_load_command = "LC_VERSION_MIN_TVOS" ,
220
- )
221
-
222
- @skipIfAsan
223
- @skipUnlessDarwin
224
- @skipIfDarwinEmbedded
225
- @apple_simulator_test ("appletv" )
226
- @skipIf (archs = ["i386" , "x86_64" ])
227
- def test_tvos_backdeploy_apple_silicon (self ):
228
- """Test running a back-deploying tvOS simulator binary"""
229
- self .run_with (
230
- arch = self .getArchitecture (),
231
- os = "tvos" ,
232
- vers = "11.0" ,
233
- env = "simulator" ,
234
- expected_load_command = "LC_BUILD_VERSION" ,
235
- )
236
-
237
- @skipIfAsan
238
- @skipUnlessDarwin
239
- @skipIfDarwinEmbedded
240
- @apple_simulator_test ("watch" )
241
- @skipIf (archs = ["arm64" , "arm64e" ])
242
- @skipIfDarwin # rdar://problem/64552748
243
- def test_lc_version_min_watchos (self ):
244
- """Test running a back-deploying watchOS simulator binary
245
- with a legacy watchOS load command"""
107
+ def test_watchos_i386 (self ):
108
+ """Test running a 32-bit watchOS simulator binary"""
246
109
self .run_with (
247
110
arch = "i386" ,
248
111
os = "watchos" ,
249
- vers = "4.0 " ,
112
+ vers = "" ,
250
113
env = "simulator" ,
251
- expected_load_command = "LC_VERSION_MIN_WATCHOS" ,
252
114
)
253
115
254
116
@skipIfAsan
255
117
@skipUnlessDarwin
256
118
@skipIfDarwinEmbedded
257
119
@apple_simulator_test ("watch" )
258
- @skipIf (archs = ["arm64" , "arm64e" ])
259
120
@skipIfDarwin # rdar://problem/64552748
260
- def test_watchos_backdeploy_apple_silicon (self ):
261
- """Test running a back-deploying watchOS simulator binary"""
121
+ @skipIf (archs = ["i386" , "x86_64" ])
122
+ def test_watchos_armv7k (self ):
123
+ """Test running a 32-bit watchOS simulator binary"""
262
124
self .run_with (
263
125
arch = "armv7k" ,
264
126
os = "watchos" ,
265
- vers = "4.0 " ,
127
+ vers = "" ,
266
128
env = "simulator" ,
267
- expected_load_command = "LC_BUILD_VERSION" ,
268
129
)
0 commit comments