[Lldb-commits] [PATCH] D134524: [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
Fri Sep 23 02:47:46 PDT 2022
Michael137 created this revision.
Michael137 added reviewers: aprantl, labath.
Herald added a project: All.
Michael137 requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
Currently, by default LLDB runs an API test with 3 variants,
one of which, depending on platform, is `gmodules`. However,
most tests don't actually make use of any specific `gmodules`
feature since they compile a single `main.cpp` file without
imporint types from other modules.
Instead of running all tests an extra time with `-gmodules`
enabled, we plan to test `gmodules` features with dedicated
API tests that explicitly opt-into compiling with `-gmodules`.
One of the main benefits of this will be a reduction in total
API test-suite run-time (by around 1/3).
This patch adds a flag to `debug_info_categories` that indicates
whether a category is eligible to be replicated by `lldbtest`.
Keeping `gmodules` a debug-info category is desirable because
`builder.py` knows how to inject the appropriate Makefile flags
into the build command for debug-info categories already. Whereas
for non-debug-info categories we'd have to teach it how to. The
category is inferred from the test-name debug-info suffix currently.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D134524
Files:
lldb/packages/Python/lldbsuite/test/lldbtest.py
lldb/packages/Python/lldbsuite/test/test_categories.py
Index: lldb/packages/Python/lldbsuite/test/test_categories.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/test_categories.py
+++ lldb/packages/Python/lldbsuite/test/test_categories.py
@@ -13,10 +13,14 @@
# LLDB modules
from lldbsuite.support import gmodules
-
-debug_info_categories = [
- 'dwarf', 'dwo', 'dsym', 'gmodules'
-]
+# Key: Category name
+# Value: should be used in lldbtest's debug-info replication
+debug_info_categories = {
+ 'dwarf' : True,
+ 'dwo' : True,
+ 'dsym' : True,
+ 'gmodules' : False
+}
all_categories = {
'basic_process': 'Basic process execution sniff tests.',
Index: lldb/packages/Python/lldbsuite/test/lldbtest.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1664,14 +1664,16 @@
# If any debug info categories were explicitly tagged, assume that list to be
# authoritative. If none were specified, try with all debug
# info formats.
- all_dbginfo_categories = set(test_categories.debug_info_categories)
+ all_dbginfo_categories = set(test_categories.debug_info_categories.values())
categories = set(
getattr(
attrvalue,
"categories",
[])) & all_dbginfo_categories
if not categories:
- categories = all_dbginfo_categories
+ categories = [category for category, can_replicate \
+ in test_categories.debug_info_categories.items() \
+ if can_replicate]
for cat in categories:
@decorators.add_test_categories([cat])
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134524.462430.patch
Type: text/x-patch
Size: 1931 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220923/51368903/attachment.bin>
More information about the lldb-commits
mailing list