Skip to content

Commit 52dd5ed

Browse files
Merge pull request #1460 from adrian-prantl/decorator
dd a decorator to skip tests when running under Rosetta
2 parents d4a4309 + a06b364 commit 52dd5ed

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lldb/packages/Python/lldbsuite/test/decorators.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,16 @@ def are_sb_headers_missing():
551551
return skipTestIfFn(are_sb_headers_missing)(func)
552552

553553

554+
def skipIfRosetta(bugnumber):
555+
"""Skip a test when running the testsuite on macOS under the Rosetta translation layer."""
556+
def is_running_rosetta(self):
557+
if not lldbplatformutil.getPlatform() in ['darwin', 'macosx']:
558+
return "not on macOS"
559+
if (platform.uname()[5] == "arm") and (self.getArchitecture() == "x86_64"):
560+
return "skipped under Rosetta"
561+
return None
562+
return skipTestIfFn(is_running_rosetta)
563+
554564
def skipIfiOSSimulator(func):
555565
"""Decorate the item to skip tests that should be skipped on the iOS Simulator."""
556566
def is_ios_simulator():

0 commit comments

Comments
 (0)