This revision was automatically updated to reflect the committed changes.
Closed by commit rG436eaf8d32fa: [lldb] Improve TestAppleSimulatorOSType.py 
error message (authored by JDevlieghere).
Herald added a project: LLDB.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126217/new/

https://reviews.llvm.org/D126217

Files:
  lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py


Index: lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
===================================================================
--- lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
+++ lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
@@ -17,9 +17,13 @@
 
     def check_simulator_ostype(self, sdk, platform_name, 
arch=platform.machine()):
         cmd = ['xcrun', 'simctl', 'list', '-j', 'devices']
-        self.trace(' '.join(cmd))
+        cmd_str = ' '.join(cmd)
+        self.trace(cmd_str)
         sim_devices_str = subprocess.check_output(cmd).decode("utf-8")
-        sim_devices = json.loads(sim_devices_str)['devices']
+        try:
+            sim_devices = json.loads(sim_devices_str)['devices']
+        except json.decoder.JSONDecodeError:
+            self.fail("Could not parse '{}' output. Authorization 
denied?".format(cmd_str))
         # Find an available simulator for the requested platform
         deviceUDID = None
         deviceRuntime = None


Index: lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
===================================================================
--- lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
+++ lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
@@ -17,9 +17,13 @@
 
     def check_simulator_ostype(self, sdk, platform_name, arch=platform.machine()):
         cmd = ['xcrun', 'simctl', 'list', '-j', 'devices']
-        self.trace(' '.join(cmd))
+        cmd_str = ' '.join(cmd)
+        self.trace(cmd_str)
         sim_devices_str = subprocess.check_output(cmd).decode("utf-8")
-        sim_devices = json.loads(sim_devices_str)['devices']
+        try:
+            sim_devices = json.loads(sim_devices_str)['devices']
+        except json.decoder.JSONDecodeError:
+            self.fail("Could not parse '{}' output. Authorization denied?".format(cmd_str))
         # Find an available simulator for the requested platform
         deviceUDID = None
         deviceRuntime = None
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
  • [Lldb-commits] [PATCH] ... Jonas Devlieghere via Phabricator via lldb-commits
    • [Lldb-commits] [PA... Jonas Devlieghere via Phabricator via lldb-commits

Reply via email to