[Lldb-commits] [PATCH] D85388: [lldb] Fix bug in skipIfRosetta decorator

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 5 18:37:23 PDT 2020

JDevlieghere created this revision.
JDevlieghere added reviewers: davide, friss.
JDevlieghere added a project: LLDB.
JDevlieghere requested review of this revision.

Currently, the `skipIfRosetta` decorator will skip tests with the message "not on macOS" on non-macOS platforms. This triggers for example when running tests remotely on device. Instead, it should only check the platform and architecture when running on the Darwin/macOS platform.




Index: lldb/packages/Python/lldbsuite/test/decorators.py
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -538,10 +538,9 @@
 def skipIfRosetta(bugnumber):
     """Skip a test when running the testsuite on macOS under the Rosetta translation layer."""
     def is_running_rosetta(self):
-        if not lldbplatformutil.getPlatform() in ['darwin', 'macosx']:
-            return "not on macOS"
-        if (platform.uname()[5] == "arm") and (self.getArchitecture() == "x86_64"):
-            return "skipped under Rosetta"
+        if lldbplatformutil.getPlatform() in ['darwin', 'macosx']:
+            if (platform.uname()[5] == "arm") and (self.getArchitecture() == "x86_64"):
+                return "skipped under Rosetta"
         return None
     return skipTestIfFn(is_running_rosetta)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85388.283466.patch
Type: text/x-patch
Size: 925 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200806/bbe65ef5/attachment-0001.bin>

More information about the lldb-commits mailing list