diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py index 2e44ee318dac0..36d800b61a95f 100644 --- a/lldb/packages/Python/lldbsuite/test/decorators.py +++ b/lldb/packages/Python/lldbsuite/test/decorators.py @@ -551,6 +551,16 @@ def are_sb_headers_missing(): return skipTestIfFn(are_sb_headers_missing)(func) +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" + return None + return skipTestIfFn(is_running_rosetta) + def skipIfiOSSimulator(func): """Decorate the item to skip tests that should be skipped on the iOS Simulator.""" def is_ios_simulator():