2 Provides definitions for various lldb test categories
5 from __future__ import absolute_import
6 from __future__ import print_function
14 from lldbsuite.support import gmodules
17 debug_info_categories = [
18 'dwarf', 'dwo', 'dsym', 'gmodules'
22 'dataformatters': 'Tests related to the type command and the data formatters subsystem',
23 'dwarf' : 'Tests that can be run with DWARF debug information',
24 'dwo' : 'Tests that can be run with DWO debug information',
25 'dsym' : 'Tests that can be run with DSYM debug information',
26 'gmodules' : 'Tests that can be run with -gmodules debug information',
27 'expression' : 'Tests related to the expression parser',
28 'objc' : 'Tests related to the Objective-C programming language support',
29 'pyapi' : 'Tests related to the Python API',
30 'basic_process' : 'Basic process execution sniff tests.',
31 'cmdline' : 'Tests related to the LLDB command-line interface',
32 'dyntype' : 'Tests related to dynamic type support',
33 'stresstest' : 'Tests related to stressing lldb limits',
34 'flakey' : 'Flakey test cases, i.e. tests that do not reliably pass at each execution',
35 'lldb-mi' : 'lldb-mi tests'
38 def unique_string_match(yourentry, list):
41 if not item.startswith(yourentry):
49 def is_supported_on_platform(category, platform, compiler_paths):
51 # -gsplit-dwarf is not implemented by clang on Windows.
52 return platform in ["linux", "freebsd"]
53 elif category == "dsym":
54 return platform in ["darwin", "macosx", "ios"]
55 elif category == "gmodules":
56 # First, check to see if the platform can even support gmodules.
57 if platform not in ["linux", "freebsd", "darwin", "macosx", "ios"]:
59 # If all compilers specified support gmodules, we'll enable it.
60 for compiler_path in compiler_paths:
61 if not gmodules.is_compiler_clang_with_gmodules(compiler_path):
62 # Ideally in a multi-compiler scenario during a single test run, this would
63 # allow gmodules on compilers that support it and not on ones that don't.
64 # However, I didn't see an easy way for all the callers of this to know
65 # the compiler being used for a test invocation. As we tend to run with
66 # a single compiler per test run, this shouldn't be a major issue.
71 def validate(categories, exact_match):
73 For each category in categories, ensure that it's a valid category (if exact_match is false,
74 unique prefixes are also accepted). If a category is invalid, print a message and quit.
75 If all categories are valid, return the list of categories. Prefixes are expanded in the
79 for category in categories:
80 origCategory = category
81 if category not in all_categories and not exact_match:
82 category = unique_string_match(category, all_categories)
83 if (category not in all_categories) or category == None:
84 print("fatal error: category '" + origCategory + "' is not a valid category")
85 print("if you have added a new category, please edit test_categories.py, adding your new category to all_categories")
86 print("else, please specify one or more of the following: " + str(list(all_categories.keys())))
88 result.append(category)