1
-
2
-
3
1
import gdbremote_testcase
4
2
import lldbgdbserverutils
5
3
from lldbsuite .test .decorators import *
6
4
from lldbsuite .test .lldbtest import *
7
5
from lldbsuite .test import lldbutil
8
6
9
7
import json
8
+ import platform
10
9
11
10
@skipIfReproducer
12
11
class TestAppleSimulatorOSType (gdbremote_testcase .GdbRemoteTestCaseBase ):
@@ -16,7 +15,7 @@ class TestAppleSimulatorOSType(gdbremote_testcase.GdbRemoteTestCaseBase):
16
15
# Number of stderr lines to read from the simctl output.
17
16
READ_LINES = 10
18
17
19
- def check_simulator_ostype (self , sdk , platform , arch = 'x86_64' ):
18
+ def check_simulator_ostype (self , sdk , platform_name ):
20
19
cmd = ['xcrun' , 'simctl' , 'list' , '-j' , 'devices' ]
21
20
self .trace (' ' .join (cmd ))
22
21
sim_devices_str = subprocess .check_output (cmd ).decode ("utf-8" )
@@ -31,7 +30,7 @@ def check_simulator_ostype(self, sdk, platform, arch='x86_64'):
31
30
else :
32
31
runtime = simulator
33
32
devices = sim_devices [simulator ]
34
- if not platform in runtime .lower ():
33
+ if not platform_name in runtime .lower ():
35
34
continue
36
35
for device in devices :
37
36
if 'availability' in device and device ['availability' ] != '(available)' :
@@ -47,10 +46,10 @@ def check_simulator_ostype(self, sdk, platform, arch='x86_64'):
47
46
48
47
# Launch the process using simctl
49
48
self .assertIsNotNone (deviceUDID )
50
- exe_name = 'test_simulator_platform_{}' .format (platform )
49
+ exe_name = 'test_simulator_platform_{}' .format (platform_name )
51
50
sdkroot = lldbutil .get_xcode_sdk_root (sdk )
52
51
self .build (dictionary = { 'EXE' : exe_name , 'SDKROOT' : sdkroot .strip (),
53
- 'ARCH' : arch })
52
+ 'ARCH' : platform . machine () })
54
53
exe_path = self .getBuildArtifact (exe_name )
55
54
cmd = [
56
55
'xcrun' , 'simctl' , 'spawn' , '-s' , deviceUDID , exe_path ,
@@ -96,7 +95,7 @@ def check_simulator_ostype(self, sdk, platform, arch='x86_64'):
96
95
self .assertIsNotNone (process_info )
97
96
98
97
# Check that ostype is correct
99
- self .assertEquals (process_info ['ostype' ], platform + 'simulator' )
98
+ self .assertEquals (process_info ['ostype' ], platform_name + 'simulator' )
100
99
101
100
# Now for dylibs
102
101
dylib_info_raw = context .get ("dylib_info_raw" )
@@ -111,26 +110,26 @@ def check_simulator_ostype(self, sdk, platform, arch='x86_64'):
111
110
break
112
111
113
112
self .assertIsNotNone (image_info )
114
- self .assertEquals (image ['min_version_os_name' ], platform + 'simulator' )
113
+ self .assertEquals (image ['min_version_os_name' ], platform_name + 'simulator' )
115
114
116
115
117
116
@apple_simulator_test ('iphone' )
118
117
@debugserver_test
119
118
@skipIfRemote
120
119
def test_simulator_ostype_ios (self ):
121
120
self .check_simulator_ostype (sdk = 'iphonesimulator' ,
122
- platform = 'ios' )
121
+ platform_name = 'ios' )
123
122
124
123
@apple_simulator_test ('appletv' )
125
124
@debugserver_test
126
125
@skipIfRemote
127
126
def test_simulator_ostype_tvos (self ):
128
127
self .check_simulator_ostype (sdk = 'appletvsimulator' ,
129
- platform = 'tvos' )
128
+ platform_name = 'tvos' )
130
129
131
130
@apple_simulator_test ('watch' )
132
131
@debugserver_test
133
132
@skipIfRemote
134
133
def test_simulator_ostype_watchos (self ):
135
134
self .check_simulator_ostype (sdk = 'watchsimulator' ,
136
- platform = 'watchos' , arch = 'i386 ' )
135
+ platform_name = 'watchos' )
0 commit comments