[Lldb-commits] [PATCH] D134344: [WIP][lldb][test] 1 - Remove gmodules debug_info variant: add decorator for API tests that explicitly test gmodules

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 21 05:39:20 PDT 2022


Michael137 updated this revision to Diff 461864.
Michael137 added a comment.

- Fix typo in comment


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134344/new/

https://reviews.llvm.org/D134344

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


Index: lldb/packages/Python/lldbsuite/test/decorators.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/decorators.py
+++ lldb/packages/Python/lldbsuite/test/decorators.py
@@ -21,10 +21,10 @@
 from . import test_categories
 from . import lldbtest_config
 from lldbsuite.support import funcutils
+from lldbsuite.support import gmodules
 from lldbsuite.test import lldbplatform
 from lldbsuite.test import lldbplatformutil
 
-
 class DecorateMode:
     Skip, Xfail = range(2)
 
@@ -390,6 +390,25 @@
 
     return skipTestIfFn(should_skip_simulator_test)
 
+def gmodules_test(func):
+    """
+    Use this decorator for 'gmodules'-specific tests. This decorator
+    makes sure we skip the test if 'gmodules' is unsupported on the
+    host platform and adds a single debug_info category to the test
+    so we don't run it multiple times (i.e., once for each debug_info variant).
+    """
+    def should_skip_gmodules_test(self):
+        supported_platforms = ["darwin", "macosx", "ios", "watchos", "tvos", "bridgeos"]
+        platform = lldbplatformutil.getHostPlatform()
+        compiler_path = self.getCompiler()
+        if platform not in supported_platforms:
+            return "Tests not supported on " % lldbplatformutil.getHostPlatform()
+        elif not gmodules.is_compiler_clang_with_gmodules(compiler_path):
+            return "-gmodules option is not supported on " % compiler_path
+        else:
+            return None
+
+    return skipTestIfFn(should_skip_gmodules_test)(add_test_categories(["dwarf"])(func))
 
 def debugserver_test(func):
     """Decorate the item as a debugserver test."""


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134344.461864.patch
Type: text/x-patch
Size: 1677 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220921/8bdaacef/attachment.bin>


More information about the lldb-commits mailing list