From: Fred Riss Date: Fri, 29 May 2020 15:29:11 +0000 (-0700) Subject: [lldb/test] Fix TestAppleSimulatorOSType when multiple runtimes are installed X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=977f00123a6d94c634d22356cae1da2a22f0e3df;p=android-x86%2Fexternal-llvm-project.git [lldb/test] Fix TestAppleSimulatorOSType when multiple runtimes are installed 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. --- diff --git a/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py b/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py index 86b54dd3e8e..a259ef66832 100644 --- a/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py +++ b/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py @@ -18,6 +18,7 @@ class TestAppleSimulatorOSType(gdbremote_testcase.GdbRemoteTestCaseBase): 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'] @@ -32,9 +33,11 @@ class TestAppleSimulatorOSType(gdbremote_testcase.GdbRemoteTestCaseBase): 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