Author: Michael Buch Date: 2022-09-26T19:54:24+01:00 New Revision: 12502ee551236375516b714cfdfb75d85b3b7e3e
URL: https://github.com/llvm/llvm-project/commit/12502ee551236375516b714cfdfb75d85b3b7e3e DIFF: https://github.com/llvm/llvm-project/commit/12502ee551236375516b714cfdfb75d85b3b7e3e.diff LOG: [lldb][test] 1 - Don't do test-replication for gmodules debug_info variant 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. Differential Revision: https://reviews.llvm.org/D134524 Added: Modified: lldb/docs/resources/test.rst lldb/packages/Python/lldbsuite/test/lldbtest.py lldb/packages/Python/lldbsuite/test/test_categories.py Removed: ################################################################################ diff --git a/lldb/docs/resources/test.rst b/lldb/docs/resources/test.rst index d0e94fbe1f9dc..2ecce85fd9dbf 100644 --- a/lldb/docs/resources/test.rst +++ b/lldb/docs/resources/test.rst @@ -173,9 +173,9 @@ but often it's easier to find an existing ``Makefile`` that does something similar to what you want to do. Another thing this enables is having diff erent variants for the same test -case. By default, we run every test for all 3 debug info formats, so once with -DWARF from the object files, once with gmodules and finally with a dSYM on -macOS or split DWARF (DWO) on Linux. But there are many more things we can test +case. By default, we run every test for two debug info formats, once with +DWARF from the object files and another with a dSYM on macOS or split +DWARF (DWO) on Linux. But there are many more things we can test that are orthogonal to the test itself. On GreenDragon we have a matrix bot that runs the test suite under diff erent configurations, with older host compilers and diff erent DWARF versions. diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py index 5c058769ff3f9..1ea29b3f5a39d 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -1664,14 +1664,16 @@ def __new__(cls, name, bases, attrs): # 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.keys()) 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]) diff --git a/lldb/packages/Python/lldbsuite/test/test_categories.py b/lldb/packages/Python/lldbsuite/test/test_categories.py index a396741ccf8f3..f3d8b0749f2f6 100644 --- a/lldb/packages/Python/lldbsuite/test/test_categories.py +++ b/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.', _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits