aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/packages')
-rw-r--r--lldb/packages/Python/lldbsuite/test/builders/__init__.py10
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbplatformutil.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/lldbtest.py19
3 files changed, 20 insertions, 12 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/builders/__init__.py b/lldb/packages/Python/lldbsuite/test/builders/__init__.py
index 9dd82cb..7331526 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/__init__.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/__init__.py
@@ -8,7 +8,15 @@ factory method below hands out builders based on the given platform.
def get_builder(platform):
"""Returns a Builder instance for the given platform."""
- if platform == "darwin":
+ if platform in [
+ "bridgeos",
+ "darwin",
+ "ios",
+ "macosx",
+ "tvos",
+ "watchos",
+ "xros",
+ ]:
from .darwin import BuilderDarwin
return BuilderDarwin()
diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
index a1ab060..cea6270 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -229,7 +229,8 @@ def hasChattyStderr(test_case):
def builder_module():
- return get_builder(sys.platform)
+ """Return the builder for the target platform."""
+ return get_builder(getPlatform())
def getArchitecture():
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index a74961e..0fc85fc 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1517,7 +1517,7 @@ class Base(unittest.TestCase):
testname = self.getBuildDirBasename()
module = builder_module()
- command = builder_module().getBuildCommand(
+ command = module.getBuildCommand(
debug_info,
architecture,
compiler,
@@ -1778,16 +1778,15 @@ class LLDBTestCaseFactory(type):
attrvalue, "__no_debug_info_test__", False
):
# If any debug info categories were explicitly tagged, assume that list to be
- # authoritative. If none were specified, try with all debug
- # info formats.
+ # authoritative. If none were specified, try with all debug info formats.
+ test_method_categories = set(getattr(attrvalue, "categories", []))
all_dbginfo_categories = set(
test_categories.debug_info_categories.keys()
)
- categories = (
- set(getattr(attrvalue, "categories", [])) & all_dbginfo_categories
- )
- if not categories:
- categories = [
+ dbginfo_categories = test_method_categories & all_dbginfo_categories
+ other_categories = list(test_method_categories - all_dbginfo_categories)
+ if not dbginfo_categories:
+ dbginfo_categories = [
category
for category, can_replicate in test_categories.debug_info_categories.items()
if can_replicate
@@ -1799,9 +1798,8 @@ class LLDBTestCaseFactory(type):
skip_for_debug_info_cat_fn = getattr(
attrvalue, "__skip_for_debug_info_cat_fn__", no_reason
)
- for cat in categories:
+ for cat in dbginfo_categories:
- @decorators.add_test_categories([cat])
@wraps(attrvalue)
def test_method(self, attrvalue=attrvalue):
return attrvalue(self)
@@ -1809,6 +1807,7 @@ class LLDBTestCaseFactory(type):
method_name = attrname + "_" + cat
test_method.__name__ = method_name
test_method.debug_info = cat
+ test_method.categories = other_categories + [cat]
xfail_reason = xfail_for_debug_info_cat_fn(cat)
if xfail_reason: