diff options
author | Pavel Labath <labath@google.com> | 2018-04-24 10:51:44 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2018-04-24 10:51:44 +0000 |
commit | fdfeefd6c29b2f26b69c63bd0a90a9915b94d956 (patch) | |
tree | 31e5c468d8eea7586972c776beeaa21682682a69 /lldb/packages/Python/lldbsuite/test/lldbtest.py | |
parent | 43acdb35bc94ed63b2ebd264aebfa2a757d5d545 (diff) | |
download | bcm5719-llvm-fdfeefd6c29b2f26b69c63bd0a90a9915b94d956.tar.gz bcm5719-llvm-fdfeefd6c29b2f26b69c63bd0a90a9915b94d956.zip |
[dotest] Make the set of tests independent of the test configuration
Summary:
In the magic test duplicator, we were making the decision whether to
create a test variant based on the compiler and the target platform.
This meant that the set of known tests was different for each test
configuration.
This patch makes the set of generated test variants static and handles
the skipping via runtime checks instead. This is more consistent with
how we do other test-skipping decision (e.g. for libc++ tests), and
makes it easier to expose the full set of tests to lit, which now does
not need to know anything about what things can potentially cause tests
to appear or disappear.
Reviewers: JDevlieghere, aprantl
Subscribers: eraman, lldb-commits
Differential Revision: https://reviews.llvm.org/D45949
llvm-svn: 330708
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lldbtest.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lldbtest.py | 52 |
1 files changed, 8 insertions, 44 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py index b3283e4e6a0..a910665c2d2 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbtest.py +++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py @@ -1732,14 +1732,11 @@ class LLDBTestCaseFactory(type): for attrname, attrvalue in attrs.items(): if attrname.startswith("test") and not getattr( attrvalue, "__no_debug_info_test__", False): - target_platform = lldb.DBG.GetSelectedPlatform( - ).GetTriple().split('-')[2] # 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) - set(configuration.skipCategories) + all_dbginfo_categories = set(test_categories.debug_info_categories) categories = set( getattr( attrvalue, @@ -1748,49 +1745,16 @@ class LLDBTestCaseFactory(type): if not categories: categories = all_dbginfo_categories - supported_categories = [ - x for x in categories if test_categories.is_supported_on_platform( - x, target_platform, configuration.compiler)] - - if "dsym" in supported_categories: - @decorators.add_test_categories(["dsym"]) + for cat in categories: + @decorators.add_test_categories([cat]) @wraps(attrvalue) - def dsym_test_method(self, attrvalue=attrvalue): + def test_method(self, attrvalue=attrvalue): return attrvalue(self) - dsym_method_name = attrname + "_dsym" - dsym_test_method.__name__ = dsym_method_name - dsym_test_method.debug_info = "dsym" - newattrs[dsym_method_name] = dsym_test_method - if "dwarf" in supported_categories: - @decorators.add_test_categories(["dwarf"]) - @wraps(attrvalue) - def dwarf_test_method(self, attrvalue=attrvalue): - return attrvalue(self) - dwarf_method_name = attrname + "_dwarf" - dwarf_test_method.__name__ = dwarf_method_name - dwarf_test_method.debug_info = "dwarf" - newattrs[dwarf_method_name] = dwarf_test_method - - if "dwo" in supported_categories: - @decorators.add_test_categories(["dwo"]) - @wraps(attrvalue) - def dwo_test_method(self, attrvalue=attrvalue): - return attrvalue(self) - dwo_method_name = attrname + "_dwo" - dwo_test_method.__name__ = dwo_method_name - dwo_test_method.debug_info = "dwo" - newattrs[dwo_method_name] = dwo_test_method - - if "gmodules" in supported_categories: - @decorators.add_test_categories(["gmodules"]) - @wraps(attrvalue) - def gmodules_test_method(self, attrvalue=attrvalue): - return attrvalue(self) - gmodules_method_name = attrname + "_gmodules" - gmodules_test_method.__name__ = gmodules_method_name - gmodules_test_method.debug_info = "gmodules" - newattrs[gmodules_method_name] = gmodules_test_method + method_name = attrname + "_" + cat + test_method.__name__ = method_name + test_method.debug_info = cat + newattrs[method_name] = test_method else: newattrs[attrname] = attrvalue |