Skip to content

Commit

Permalink
[lldb] Fix bug in skipIfRosetta decorator
Browse files Browse the repository at this point in the history
Currently, the skipIfRosetta decorator will skip tests with the message
"not on macOS" on all platforms that are not `darwin` or `macosx`.
Instead, it should only check the platform and architecture when running
on these platforms.

This triggers for example when running the test suite on device.

Differential revision: https://reviews.llvm.org/D85388
  • Loading branch information
JDevlieghere committed Aug 6, 2020
1 parent 633e3da commit 4fccdd5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lldb/packages/Python/lldbsuite/test/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,9 @@ def are_sb_headers_missing():
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)

Expand Down

0 comments on commit 4fccdd5

Please sign in to comment.