[Lldb-commits] [lldb] 341ec56 - Add a decorator to skip tests when running under Rosetta
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Mon Jul 13 13:11:30 PDT 2020
Author: Adrian Prantl
Date: 2020-07-13T13:09:53-07:00
New Revision: 341ec564182161861ec4415cdee1f4f3a0527e97
URL: https://github.com/llvm/llvm-project/commit/341ec564182161861ec4415cdee1f4f3a0527e97
DIFF: https://github.com/llvm/llvm-project/commit/341ec564182161861ec4415cdee1f4f3a0527e97.diff
LOG: 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
Added:
Modified:
lldb/packages/Python/lldbsuite/test/decorators.py
Removed:
################################################################################
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py
index ec084184cd65..be282f6db32c 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -552,6 +552,14 @@ def are_sb_headers_missing():
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():
More information about the lldb-commits
mailing list