File tree Expand file tree Collapse file tree 3 files changed +26
-10
lines changed
lldb/packages/Python/lldbsuite/test Expand file tree Collapse file tree 3 files changed +26
-10
lines changed Original file line number Diff line number Diff line change 117
117
lldb_platform_url = None
118
118
lldb_platform_working_dir = None
119
119
120
+ # Apple SDK
121
+ apple_sdk = None
122
+
120
123
# The base directory in which the tests are being built.
121
124
test_build_dir = None
122
125
Original file line number Diff line number Diff line change @@ -426,6 +426,8 @@ def parseOptionsAndInitTestdirs():
426
426
configuration .lldb_platform_url = args .lldb_platform_url
427
427
if args .lldb_platform_working_dir :
428
428
configuration .lldb_platform_working_dir = args .lldb_platform_working_dir
429
+ if args .apple_sdk :
430
+ configuration .apple_sdk = args .apple_sdk
429
431
if args .test_build_dir :
430
432
configuration .test_build_dir = args .test_build_dir
431
433
if args .lldb_module_cache_dir :
Original file line number Diff line number Diff line change @@ -129,17 +129,28 @@ def getDarwinOSTriples():
129
129
130
130
def getPlatform ():
131
131
"""Returns the target platform which the tests are running on."""
132
+ # Use the Apple SDK to determine the platform if set.
133
+ if configuration .apple_sdk :
134
+ platform = configuration .apple_sdk
135
+ dot = platform .find ('.' )
136
+ if dot != - 1 :
137
+ platform = platform [:dot ]
138
+ if platform == 'iphoneos' :
139
+ platform = 'ios'
140
+ return platform
141
+
142
+ # Use the triple to determine the platform if set.
132
143
triple = lldb .selected_platform .GetTriple ()
133
- if triple is None :
134
- # It might be an unconnected remote platform.
135
- return ''
136
-
137
- platform = triple . split ( '-' )[ 2 ]
138
- if platform . startswith ( 'freebsd' ):
139
- platform = 'freebsd'
140
- elif platform . startswith ( 'netbsd' ):
141
- platform = 'netbsd'
142
- return platform
144
+ if triple :
145
+ platform = triple . split ( '-' )[ 2 ]
146
+ if platform . startswith ( 'freebsd' ):
147
+ platform = 'freebsd'
148
+ elif platform . startswith ( 'netbsd' ):
149
+ platform = 'netbsd'
150
+ return platform
151
+
152
+ # It still might be an unconnected remote platform.
153
+ return ''
143
154
144
155
145
156
def platformIsDarwin ():
You can’t perform that action at this time.
0 commit comments