Commit 341ec564 authored by Adrian Prantl's avatar Adrian Prantl
Browse files

Add a decorator to skip tests when running under Rosetta

This allows skipping a test when running the testsuite on macOS under
the Rosetta translation layer.

Differential Revision: https://reviews.llvm.org/D83600
parent 340c376b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -552,6 +552,14 @@ def skipIfNoSBHeaders(func):
    return skipTestIfFn(are_sb_headers_missing)(func)


def skipIfRosetta(func, bugnumber=None):
    """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 False
        return platform.uname()[5] == "arm" and self.getArchitecture() == "x86_64"
    return skipTestIfFn(is_running_rosetta, bugnumber)(func)

def skipIfiOSSimulator(func):
    """Decorate the item to skip tests that should be skipped on the iOS Simulator."""
    def is_ios_simulator():