Skip to content

Commit

Permalink
[lldb/test] Fix TestAppleSimulatorOSType when multiple runtimes are i…
Browse files Browse the repository at this point in the history
…nstalled

One can have multiple simulator runtimes installed, supporting
various generations of OSs. The logic in TestAppleSimulatorOSType
might select a rnutime older than the one targeted by the current
tools, preventing the executable from running. This commit changes
the test to look for the most recent runtime available instead.
  • Loading branch information
fredriss committed May 29, 2020
1 parent 68c5070 commit 977f001
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def check_simulator_ostype(self, sdk, platform, arch='x86_64'):
sim_devices = json.loads(sim_devices_str)['devices']
# Find an available simulator for the requested platform
deviceUDID = None
deviceRuntime = None
for simulator in sim_devices:
if isinstance(simulator,dict):
runtime = simulator['name']
Expand All @@ -32,9 +33,11 @@ def check_simulator_ostype(self, sdk, platform, arch='x86_64'):
continue
if 'isAvailable' in device and device['isAvailable'] != True:
continue
if deviceRuntime and runtime < deviceRuntime:
continue
deviceUDID = device['udid']
break
if deviceUDID != None:
deviceRuntime = runtime
# Stop searching in this runtime
break

# Launch the process using simctl
Expand Down

0 comments on commit 977f001

Please sign in to comment.