diff options
Diffstat (limited to 'lldb/test')
96 files changed, 235 insertions, 262 deletions
diff --git a/lldb/test/dotest.py b/lldb/test/dotest.py index 39d7207efa6..bec967a9e05 100755 --- a/lldb/test/dotest.py +++ b/lldb/test/dotest.py @@ -41,6 +41,7 @@ from test_results import EventBuilder import inspect import unittest2 import lldbtest_config +import test_categories import six @@ -80,33 +81,9 @@ class _WritelnDecorator(object): # Global variables: # -# Dictionary of categories -# When you define a new category for your testcases, be sure to add it here, or the test suite -# will gladly complain as soon as you try to use it. This allows us to centralize which categories -# exist, and to provide a description for each one -validCategories = { -'dataformatters':'Tests related to the type command and the data formatters subsystem', -'expression':'Tests related to the expression parser', -'objc':'Tests related to the Objective-C programming language support', -'pyapi':'Tests related to the Python API', -'basic_process': 'Basic process execution sniff tests.', -'cmdline' : 'Tests related to the LLDB command-line interface', -'dyntype' : 'Tests related to dynamic type support', -'stresstest' : 'Tests related to stressing lldb limits', -'flakey' : 'Flakey test cases, i.e. tests that do not reliably pass at each execution' -} - # The test suite. suite = unittest2.TestSuite() -# By default, both command line and Python API tests are performed. -# Use @python_api_test decorator, defined in lldbtest.py, to mark a test as -# a Python API test. -dont_do_python_api_test = False - -# By default, both command line and Python API tests are performed. -just_do_python_api_test = False - # By default, lldb-mi tests are performed if lldb-mi can be found. # Use @lldbmi_test decorator, defined in lldbtest.py, to mark a test as # a lldb-mi test. @@ -389,35 +366,6 @@ o GDB_REMOTE_LOG: if defined, specifies the log file pathname for the sys.exit(0) -def unique_string_match(yourentry,list): - candidate = None - for item in list: - if item.startswith(yourentry): - if candidate: - return None - candidate = item - return candidate - -def validate_categories(categories): - """For each category in categories, ensure that it's a valid category (or a prefix thereof). - If a category is invalid, print a message and quit. - If all categories are valid, return the list of categories. Prefixes are expanded in the - returned list. - """ - global validCategories - result = [] - for category in categories: - origCategory = category - if category not in validCategories: - category = unique_string_match(category, validCategories) - if (category not in validCategories) or category == None: - print("fatal error: category '" + origCategory + "' is not a valid category") - print("if you have added a new category, please edit dotest.py, adding your new category to validCategories") - print("else, please specify one or more of the following: " + str(list(validCategories.keys()))) - sys.exit(1) - result.append(category) - return result - def setCrashInfoHook_Mac(text): import crashinfo crashinfo.setCrashReporterDescription(text) @@ -472,8 +420,6 @@ def parseOptionsAndInitTestdirs(): '-h/--help as the first option prints out usage info and exit the program. """ - global dont_do_python_api_test - global just_do_python_api_test global dont_do_lldbmi_test global just_do_lldbmi_test global just_do_benchmarks_test @@ -592,13 +538,13 @@ def parseOptionsAndInitTestdirs(): archs = [platform_machine] if args.categoriesList: - categoriesList = set(validate_categories(args.categoriesList)) + categoriesList = set(test_categories.validate(args.categoriesList, False)) useCategories = True else: categoriesList = [] if args.skipCategories: - skipCategories = validate_categories(args.skipCategories) + skipCategories = test_categories.validate(args.skipCategories, False) if args.D: dumpSysPath = True @@ -615,14 +561,10 @@ def parseOptionsAndInitTestdirs(): elif args.N == 'dsym': dont_do_dsym_test = True - if args.a: - dont_do_python_api_test = True - - if args.plus_a: - if dont_do_python_api_test: - print("Warning: -a and +a can't both be specified! Using only -a") - else: - just_do_python_api_test = True + if args.a or args.plus_a: + print("Options '-a' and '+a' have been deprecated. Please use the test category\n" + "functionality (-G pyapi, --skip-category pyapi) instead.") + sys.exit(1) if args.plus_b: just_do_benchmarks_test = True @@ -785,10 +727,6 @@ def parseOptionsAndInitTestdirs(): if do_help == True: usage(parser) - # Do not specify both '-a' and '+a' at the same time. - if dont_do_python_api_test and just_do_python_api_test: - usage(parser) - # Do not specify both '-m' and '+m' at the same time. if dont_do_lldbmi_test and just_do_lldbmi_test: usage(parser) @@ -1579,8 +1517,6 @@ if __name__ == "__main__": lldb.lldbtest_remote_shell_template = lldbtest_remote_shell_template # Put all these test decorators in the lldb namespace. - lldb.dont_do_python_api_test = dont_do_python_api_test - lldb.just_do_python_api_test = just_do_python_api_test lldb.dont_do_lldbmi_test = dont_do_lldbmi_test lldb.just_do_lldbmi_test = just_do_lldbmi_test lldb.just_do_benchmarks_test = just_do_benchmarks_test diff --git a/lldb/test/dotest_args.py b/lldb/test/dotest_args.py index 5d1bf751903..79afcddca0a 100644 --- a/lldb/test/dotest_args.py +++ b/lldb/test/dotest_args.py @@ -55,8 +55,6 @@ def create_parser(): # Test filtering options group = parser.add_argument_group('Test filtering options') group.add_argument('-N', choices=['dwarf', 'dwo', 'dsym'], help="Don't do test cases marked with the @dsym_test/@dwarf_test/@dwo_test decorator by passing dsym/dwarf/dwo as the option arg") - X('-a', "Don't do lldb Python API tests") - X('+a', "Just do lldb Python API tests. Do not specify along with '-a'", dest='plus_a') X('+b', 'Just do benchmark tests', dest='plus_b') group.add_argument('-b', metavar='blacklist', help='Read a blacklist file specified after this option') group.add_argument('-f', metavar='filterspec', action='append', help='Specify a filter, which consists of the test class name, a dot, followed by the test method, to only admit such test into the test suite') # FIXME: Example? @@ -183,6 +181,13 @@ def create_parser(): # Remove the reference to our helper function del X + D = lambda optstr, **kwargs: group.add_argument(optstr, action='store_true', **kwargs) + group = parser.add_argument_group('Deprecated options (do not use)') + # Deprecated on 23.10.2015. Remove completely after a grace period. + D('-a') + D('+a', dest='plus_a') + del D + group = parser.add_argument_group('Test directories') group.add_argument('args', metavar='test-dir', nargs='*', help='Specify a list of directory names to search for test modules named after Test*.py (test discovery). If empty, search from the current working directory instead.') diff --git a/lldb/test/expression_command/test/TestExprs.py b/lldb/test/expression_command/test/TestExprs.py index 88517333f1c..7b6d032aba5 100644 --- a/lldb/test/expression_command/test/TestExprs.py +++ b/lldb/test/expression_command/test/TestExprs.py @@ -98,7 +98,7 @@ class BasicExprCommandsTestCase(TestBase): "a.out"]) # (const char *) $8 = 0x... "/Volumes/data/lldb/svn/trunk/test/expression_command/test/a.out" - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"]) @expectedFailureWindows # Test crashes def test_evaluate_expression_python(self): diff --git a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py index f9eb809ec80..f16588b16d2 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py @@ -17,7 +17,7 @@ class PythonBreakpointCommandSettingTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) my_var = 10 - @python_api_test + @add_test_categories(['pyapi']) def test_step_out_python(self): """Test stepping out using avoid-no-debug with dsyms.""" self.build() diff --git a/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py b/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py index d69637e90e3..95114ba4300 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py @@ -28,7 +28,7 @@ class BreakpointConditionsTestCase(TestBase): self.breakpoint_conditions(inline=True) @skipIfWindows # Requires EE to support COFF on Windows (http://llvm.org/pr22232) - @python_api_test + @add_test_categories(['pyapi']) def test_breakpoint_condition_and_python_api(self): """Use Python APIs to set breakpoint conditions.""" self.build() diff --git a/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py b/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py index c012bb2234d..77b51ed7226 100644 --- a/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py +++ b/lldb/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py @@ -20,7 +20,7 @@ class BreakpointIgnoreCountTestCase(TestBase): self.build() self.breakpoint_ignore_count() - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Use Python APIs to set breakpoint ignore count.""" self.build() diff --git a/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py b/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py index 7db738969c2..fa618b8e497 100644 --- a/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py +++ b/lldb/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py @@ -17,7 +17,7 @@ class TestCPPExceptionBreakpoint (TestBase): mydir = TestBase.compute_mydir(__file__) my_var = 10 - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureWindows("llvm.org/pr24538") # clang-cl does not support throw or catch def test_cpp_exception_breakpoint(self): """Test setting and hitting the C++ exception breakpoint.""" diff --git a/lldb/test/functionalities/command_script/import/TestImport.py b/lldb/test/functionalities/command_script/import/TestImport.py index 9a6937b99c3..37d5fbd2be0 100644 --- a/lldb/test/functionalities/command_script/import/TestImport.py +++ b/lldb/test/functionalities/command_script/import/TestImport.py @@ -12,7 +12,7 @@ class ImportTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_import_command(self): """Import some Python scripts by path and test them""" diff --git a/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py b/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py index b5209d4a3a4..f314adebefb 100644 --- a/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py +++ b/lldb/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py @@ -12,7 +12,7 @@ class Rdar12586188TestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_rdar12586188_command(self): """Check that we handle an ImportError in a special way when command script importing files.""" diff --git a/lldb/test/functionalities/conditional_break/TestConditionalBreak.py b/lldb/test/functionalities/conditional_break/TestConditionalBreak.py index b51393f5dd1..61de7cae798 100644 --- a/lldb/test/functionalities/conditional_break/TestConditionalBreak.py +++ b/lldb/test/functionalities/conditional_break/TestConditionalBreak.py @@ -21,7 +21,7 @@ class ConditionalBreakTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @expectedFailureWindows("llvm.org/pr24778") - @python_api_test + @add_test_categories(['pyapi']) def test_with_python(self): """Exercise some thread and frame APIs to break if c() is called by a().""" self.build() diff --git a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py index 1ff25a1bc9e..a82ff66798f 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py @@ -18,6 +18,7 @@ class LibcxxListDataFormatterTestCase(TestBase): @skipIfGcc @skipIfWindows # libc++ not ported to Windows yet + @add_test_categories(["pyapi"]) def test_with_run_command(self): self.build() exe = os.path.join(os.getcwd(), "a.out") diff --git a/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py b/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py index 6b31ebc26dc..df8630655f9 100644 --- a/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py +++ b/lldb/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py @@ -34,7 +34,7 @@ class DynamicValueChildCountTestCase(TestBase): @expectedFailureFreeBSD("llvm.org/pr19311") # continue at a breakpoint does not work @expectedFailureWindows("llvm.org/pr24663") @expectedFailurei386("to be figured out") - @python_api_test + @add_test_categories(['pyapi']) def test_get_dynamic_vals(self): """Test fetching C++ dynamic values from pointers & references.""" """Get argument vals for the call stack when stopped on a breakpoint.""" diff --git a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py index b307abaaf69..2bf1108cdbb 100644 --- a/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py +++ b/lldb/test/functionalities/inferior-assert/TestInferiorAssert.py @@ -33,7 +33,7 @@ class AssertingInferiorTestCase(TestBase): self.build() self.inferior_asserting_disassemble() - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureWindows("llvm.org/pr21793: need to implement support for detecting assertion / abort on Windows") def test_inferior_asserting_python(self): """Test that lldb reliably catches the inferior asserting (Python API).""" diff --git a/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py b/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py index ee41cd5f9c2..3e79c777122 100644 --- a/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py +++ b/lldb/test/functionalities/inferior-crashing/TestInferiorCrashing.py @@ -25,7 +25,7 @@ class CrashingInferiorTestCase(TestBase): self.build() self.inferior_crashing_registers() - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureWindows("llvm.org/pr24778") def test_inferior_crashing_python(self): """Test that lldb reliably catches the inferior crashing (Python API).""" diff --git a/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py b/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py index 53ca4ffbcfb..efc857d8a24 100644 --- a/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py +++ b/lldb/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py @@ -26,7 +26,7 @@ class CrashingRecursiveInferiorTestCase(TestBase): self.build() self.recursive_inferior_crashing_registers() - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureWindows("llvm.org/pr24778") def test_recursive_inferior_crashing_python(self): """Test that lldb reliably catches the inferior crashing (Python API).""" diff --git a/lldb/test/functionalities/inline-stepping/TestInlineStepping.py b/lldb/test/functionalities/inline-stepping/TestInlineStepping.py index aa9fcaed703..7b2c38dca13 100644 --- a/lldb/test/functionalities/inline-stepping/TestInlineStepping.py +++ b/lldb/test/functionalities/inline-stepping/TestInlineStepping.py @@ -13,7 +13,7 @@ class TestInlineStepping(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureFreeBSD('llvm.org/pr17214') @expectedFailureIcc # Not really a bug. ICC combines two inlined functions. @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"]) @@ -25,14 +25,14 @@ class TestInlineStepping(TestBase): self.build() self.inline_stepping() - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureAll("llvm.org/pr23139", oslist=["linux"], compiler="gcc", compiler_version=[">=","4.9"], archs=["i386"]) def test_step_over_with_python_api(self): """Test stepping over and into inlined functions.""" self.build() self.inline_stepping_step_over() - @python_api_test + @add_test_categories(['pyapi']) def test_step_in_template_with_python_api(self): """Test stepping in to templated functions.""" self.build() diff --git a/lldb/test/functionalities/return-value/TestReturnValue.py b/lldb/test/functionalities/return-value/TestReturnValue.py index 9ced2682118..bf895739c7a 100644 --- a/lldb/test/functionalities/return-value/TestReturnValue.py +++ b/lldb/test/functionalities/return-value/TestReturnValue.py @@ -17,7 +17,7 @@ class ReturnValueTestCase(TestBase): @expectedFailurei386 @expectedFailureWindows("llvm.org/pr24778") - @python_api_test + @add_test_categories(['pyapi']) def test_with_python(self): """Test getting return values from stepping out.""" self.build() diff --git a/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py b/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py index 3427ec16d52..94ffaec9852 100644 --- a/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py +++ b/lldb/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py @@ -16,14 +16,14 @@ class ReturnValueTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) def test_step_out_with_python(self): """Test stepping out using avoid-no-debug with dsyms.""" self.build() self.get_to_starting_point() self.do_step_out_past_nodebug() - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureGcc("llvm.org/pr19247") def test_step_over_with_python(self): """Test stepping over using avoid-no-debug with dwarf.""" @@ -31,7 +31,7 @@ class ReturnValueTestCase(TestBase): self.get_to_starting_point() self.do_step_over_past_nodebug() - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureGcc("llvm.org/pr19247") def test_step_in_with_python(self): """Test stepping in using avoid-no-debug with dwarf.""" diff --git a/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py b/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py index ab68309af93..3b6407fa82d 100644 --- a/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py +++ b/lldb/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py @@ -18,7 +18,7 @@ class ThreadSpecificBreakTestCase(TestBase): @skipIfFreeBSD # test frequently times out or hangs @expectedFailureFreeBSD('llvm.org/pr18522') # hits break in another thread in testrun @expectedFailureWindows("llvm.org/pr24777") - @python_api_test + @add_test_categories(['pyapi']) @expectedFlakeyLinux # this test fails 6/100 dosep runs def test_python(self): """Test that we obey thread conditioned breakpoints.""" diff --git a/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py b/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py index 6483f879c73..0b325509491 100644 --- a/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py +++ b/lldb/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py @@ -19,7 +19,7 @@ class TestWatchpointEvents (TestBase): # Find the line numbers that we will step to in main: self.main_source = "main.c" - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported @expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows def test_with_python_api(self): diff --git a/lldb/test/lang/c/array_types/TestArrayTypes.py b/lldb/test/lang/c/array_types/TestArrayTypes.py index 85b4ede7cea..2d7d8a76096 100644 --- a/lldb/test/lang/c/array_types/TestArrayTypes.py +++ b/lldb/test/lang/c/array_types/TestArrayTypes.py @@ -68,7 +68,7 @@ class ArrayTypesTestCase(TestBase): self.expect("frame variable --show-types long_6", VARIABLES_DISPLAYED_CORRECTLY, startstr = '(long [6])') - @python_api_test + @add_test_categories(['pyapi']) def test_and_python_api(self): """Use Python APIs to inspect variables with array types.""" self.build() diff --git a/lldb/test/lang/c/bitfields/TestBitfields.py b/lldb/test/lang/c/bitfields/TestBitfields.py index 5f53437678c..a459434fe28 100644 --- a/lldb/test/lang/c/bitfields/TestBitfields.py +++ b/lldb/test/lang/c/bitfields/TestBitfields.py @@ -95,7 +95,7 @@ class BitfieldsTestCase(TestBase): self.expect("expr (more_bits.d)", VARIABLES_DISPLAYED_CORRECTLY, substrs = ['uint8_t', '\\0']) - @python_api_test + @add_test_categories(['pyapi']) @skipIfWindows # BitFields exhibit crashes in record layout on Windows (http://llvm.org/pr21800) def test_and_python_api(self): """Use Python APIs to inspect a bitfields variable.""" diff --git a/lldb/test/lang/c/stepping/TestStepAndBreakpoints.py b/lldb/test/lang/c/stepping/TestStepAndBreakpoints.py index 170a02b8e65..0e0c624c4fe 100644 --- a/lldb/test/lang/c/stepping/TestStepAndBreakpoints.py +++ b/lldb/test/lang/c/stepping/TestStepAndBreakpoints.py @@ -25,7 +25,7 @@ class TestCStepping(TestBase): @expectedFailureFreeBSD('llvm.org/pr17932') @expectedFailureLinux # llvm.org/pr14437 @expectedFailureWindows("llvm.org/pr24777") - @python_api_test + @add_test_categories(['pyapi']) def test_and_python_api(self): """Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms.""" self.build() diff --git a/lldb/test/lang/cpp/class_static/TestStaticVariables.py b/lldb/test/lang/cpp/class_static/TestStaticVariables.py index ba770af9826..5bb54810f2e 100644 --- a/lldb/test/lang/cpp/class_static/TestStaticVariables.py +++ b/lldb/test/lang/cpp/class_static/TestStaticVariables.py @@ -52,7 +52,7 @@ class StaticVariableTestCase(TestBase): @expectedFailureClang('Clang emits incomplete debug info.') @expectedFailureFreeBSD('llvm.org/pr20550 failing on FreeBSD-11') @expectedFailureGcc('GCC emits incomplete debug info.') - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Test Python APIs on file and class static variables.""" self.build() diff --git a/lldb/test/lang/cpp/class_types/TestClassTypes.py b/lldb/test/lang/cpp/class_types/TestClassTypes.py index 9a46f5df36f..3fda9e4faa5 100644 --- a/lldb/test/lang/cpp/class_types/TestClassTypes.py +++ b/lldb/test/lang/cpp/class_types/TestClassTypes.py @@ -52,7 +52,7 @@ class ClassTypesTestCase(TestBase): substrs = ['C *', ' this = ']) - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Use Python APIs to create a breakpoint by (filespec, line).""" self.build() diff --git a/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py b/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py index f9e0f5fcd9c..cbb34560254 100644 --- a/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py +++ b/lldb/test/lang/cpp/class_types/TestClassTypesDisassembly.py @@ -36,7 +36,7 @@ class IterateFrameAndDisassembleTestCase(TestBase): #print("function:", function) self.runCmd("disassemble -n '%s'" % function) - @python_api_test + @add_test_categories(['pyapi']) def test_and_python_api(self): """Disassemble each call frame when stopped on C's constructor.""" self.build() diff --git a/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py b/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py index 4d620a90725..bcefda2caaf 100644 --- a/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py +++ b/lldb/test/lang/cpp/dynamic-value/TestCppValueCast.py @@ -17,14 +17,14 @@ class CppValueCastTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @unittest2.expectedFailure("rdar://problem/10808472 SBValue::Cast test case is failing (virtual inheritance)") - @python_api_test + @add_test_categories(['pyapi']) def test_value_cast_with_virtual_inheritance(self): """Test SBValue::Cast(SBType) API for C++ types with virtual inheritance.""" self.build(dictionary=self.d_virtual) self.setTearDownCleanup(dictionary=self.d_virtual) self.do_sbvalue_cast(self.exe_name) - @python_api_test + @add_test_categories(['pyapi']) def test_value_cast_with_regular_inheritance(self): """Test SBValue::Cast(SBType) API for C++ types with regular inheritance.""" self.build(dictionary=self.d_regular) diff --git a/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py b/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py index 7095e42721c..4f1cd5e31c8 100644 --- a/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py +++ b/lldb/test/lang/cpp/dynamic-value/TestDynamicValue.py @@ -29,7 +29,7 @@ class DynamicValueTestCase(TestBase): @expectedFailureFreeBSD # FIXME: This needs to be root-caused. @expectedFailureWindows("llvm.org/pr24663") - @python_api_test + @add_test_categories(['pyapi']) def test_get_dynamic_vals(self): """Test fetching C++ dynamic values from pointers & references.""" self.build(dictionary=self.getBuildFlags()) diff --git a/lldb/test/lang/cpp/stl/TestSTL.py b/lldb/test/lang/cpp/stl/TestSTL.py index 66a8dce143f..4c7636cc74a 100644 --- a/lldb/test/lang/cpp/stl/TestSTL.py +++ b/lldb/test/lang/cpp/stl/TestSTL.py @@ -68,7 +68,7 @@ class STLTestCase(TestBase): substrs = [' = 2']) @expectedFailureIcc # icc 13.1 and 14-beta do not emit DW_TAG_template_type_parameter - @python_api_test + @add_test_categories(['pyapi']) def test_SBType_template_aspects(self): """Test APIs for getting template arguments from an SBType.""" self.build() diff --git a/lldb/test/lang/go/goroutines/TestGoroutines.py b/lldb/test/lang/go/goroutines/TestGoroutines.py index a5726c40b9d..a51ad7b82f8 100644 --- a/lldb/test/lang/go/goroutines/TestGoroutines.py +++ b/lldb/test/lang/go/goroutines/TestGoroutines.py @@ -13,7 +13,7 @@ class TestGoASTContext(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) @skipIfFreeBSD # llvm.org/pr24895 triggers assertion failure @skipIfRemote # Not remote test suite ready @no_debug_info_test diff --git a/lldb/test/lang/go/types/TestGoASTContext.py b/lldb/test/lang/go/types/TestGoASTContext.py index 2f52563e395..4c1e451bbca 100644 --- a/lldb/test/lang/go/types/TestGoASTContext.py +++ b/lldb/test/lang/go/types/TestGoASTContext.py @@ -13,7 +13,7 @@ class TestGoASTContext(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) @skipIfFreeBSD # llvm.org/pr24895 triggers assertion failure @skipIfRemote # Not remote test suit ready @no_debug_info_test diff --git a/lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py b/lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py index 5e9d55af5d5..2403823d560 100644 --- a/lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py +++ b/lldb/test/lang/objc/blocks/TestObjCIvarsInBlocks.py @@ -22,7 +22,7 @@ class TestObjCIvarsInBlocks(TestBase): self.class_source_file_spec = lldb.SBFileSpec(self.class_source) @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) @expectedFailurei386 # This test requires the 2.0 runtime, so it will fail on i386. def test_with_python_api(self): """Test printing the ivars of the self when captured in blocks""" diff --git a/lldb/test/lang/objc/foundation/TestObjCMethods.py b/lldb/test/lang/objc/foundation/TestObjCMethods.py index ee5fab5f37c..39af9af6da9 100644 --- a/lldb/test/lang/objc/foundation/TestObjCMethods.py +++ b/lldb/test/lang/objc/foundation/TestObjCMethods.py @@ -174,7 +174,7 @@ class FoundationTestCase(TestBase): self.expect("expression --object-description -- my", "Object description displayed correctly", patterns = ["Hello from.*a.out.*with timestamp: "]) - @python_api_test + @add_test_categories(['pyapi']) def test_print_ivars_correctly (self): self.build() # See: <rdar://problem/8717050> lldb needs to use the ObjC runtime symbols for ivar offsets diff --git a/lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py b/lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py index f0b1d0d083e..5fe59c23780 100644 --- a/lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py +++ b/lldb/test/lang/objc/foundation/TestObjectDescriptionAPI.py @@ -24,7 +24,7 @@ class ObjectDescriptionAPITestCase(TestBase): # rdar://problem/10857337 @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) def test_find_global_variables_then_object_description(self): """Exercise SBTarget.FindGlobalVariables() API.""" d = {'EXE': 'b.out'} diff --git a/lldb/test/lang/objc/foundation/TestSymbolTable.py b/lldb/test/lang/objc/foundation/TestSymbolTable.py index 378147e40e1..620ada67cfb 100644 --- a/lldb/test/lang/objc/foundation/TestSymbolTable.py +++ b/lldb/test/lang/objc/foundation/TestSymbolTable.py @@ -27,7 +27,7 @@ class FoundationSymtabTestCase(TestBase): 'main' ] - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Test symbol table access with Python APIs.""" self.build() diff --git a/lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py b/lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py index d7cdda1500d..d02103c7c47 100644 --- a/lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py +++ b/lldb/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py @@ -22,7 +22,7 @@ class ObjCDynamicValueTestCase(TestBase): self.line = line_number('main.m', '// Set breakpoint here.') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) def test_get_baseclass(self): """Test fetching ObjC dynamic values.""" if self.getArchitecture() == 'i386': diff --git a/lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py b/lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py index 95a5414460d..3b07320ccc8 100644 --- a/lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py +++ b/lldb/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py @@ -21,7 +21,7 @@ class TestObjCBuiltinTypes(TestBase): self.break_line = line_number(self.main_source, '// Set breakpoint here.') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) #<rdar://problem/10591460> [regression] Can't print ivar value: error: reference to 'id' is ambiguous def test_with_python_api(self): """Test expression parser respect for ObjC built-in types.""" diff --git a/lldb/test/lang/objc/objc-checker/TestObjCCheckers.py b/lldb/test/lang/objc/objc-checker/TestObjCCheckers.py index b3c44435b3d..e4708d6c493 100644 --- a/lldb/test/lang/objc/objc-checker/TestObjCCheckers.py +++ b/lldb/test/lang/objc/objc-checker/TestObjCCheckers.py @@ -23,7 +23,7 @@ class ObjCCheckerTestCase(TestBase): self.source_name = 'main.m' @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) def test_objc_checker(self): """Test that checkers catch unrecognized selectors""" if self.getArchitecture() == 'i386': diff --git a/lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py b/lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py index a22a2c012fc..31db76877e4 100644 --- a/lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py +++ b/lldb/test/lang/objc/objc-class-method/TestObjCClassMethod.py @@ -22,7 +22,7 @@ class TestObjCClassMethod(TestBase): @skipUnlessDarwin @expectedFailurei386 - @python_api_test + @add_test_categories(['pyapi']) #rdar://problem/9745789 "expression" can't call functions in class methods def test_with_python_api(self): """Test calling functions in class methods.""" diff --git a/lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py b/lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py index 7c2b7dce6ff..cc810d8682c 100644 --- a/lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py +++ b/lldb/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py @@ -29,7 +29,7 @@ class ObjCDynamicValueTestCase(TestBase): '// Break here to see if we can step into real method.') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureDarwin("llvm.org/pr20271 rdar://18684107") def test_get_objc_dynamic_vals(self): """Test fetching ObjC dynamic values.""" diff --git a/lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py b/lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py index c53d84c82e4..0be0150a0b0 100644 --- a/lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py +++ b/lldb/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py @@ -21,7 +21,7 @@ class TestObjCIvarOffsets(TestBase): self.stop_line = line_number(self.main_source, '// Set breakpoint here.') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Test printing ObjC objects that use unbacked properties""" self.build() diff --git a/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py b/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py index de529e8fa86..f49ad7165a7 100644 --- a/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py +++ b/lldb/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py @@ -23,7 +23,7 @@ class TestObjCIvarStripped(TestBase): @skipUnlessDarwin @skipIfDwarf # This test requires a stripped binary and a dSYM @skipIfDWO # This test requires a stripped binary and a dSYM - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Test that we can find stripped Objective-C ivars in the runtime""" self.build() diff --git a/lldb/test/lang/objc/objc-property/TestObjCProperty.py b/lldb/test/lang/objc/objc-property/TestObjCProperty.py index 0806776a690..83291431305 100644 --- a/lldb/test/lang/objc/objc-property/TestObjCProperty.py +++ b/lldb/test/lang/objc/objc-property/TestObjCProperty.py @@ -23,7 +23,7 @@ class ObjCPropertyTestCase(TestBase): self.source_name = 'main.m' @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) def test_objc_properties(self): """Test that expr uses the correct property getters and setters""" if self.getArchitecture() == 'i386': diff --git a/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py b/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py index 6d230f22f43..d74c5a1e9d6 100644 --- a/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py +++ b/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py @@ -21,7 +21,7 @@ class TestObjCStaticMethodStripped(TestBase): self.break_line = line_number(self.main_source, '// Set breakpoint here.') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) @skipIfDwarf # This test requires a stripped binary and a dSYM @skipIfDWO # This test requires a stripped binary and a dSYM #<rdar://problem/12042992> diff --git a/lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py b/lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py index 290d29e0df5..edd774335cf 100644 --- a/lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py +++ b/lldb/test/lang/objc/objc-static-method/TestObjCStaticMethod.py @@ -21,7 +21,7 @@ class TestObjCStaticMethod(TestBase): self.break_line = line_number(self.main_source, '// Set breakpoint here.') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) #<rdar://problem/9745789> "expression" can't call functions in class methods def test_with_python_api(self): """Test calling functions in static methods.""" diff --git a/lldb/test/lang/objc/objc-stepping/TestObjCStepping.py b/lldb/test/lang/objc/objc-stepping/TestObjCStepping.py index 2f51a9ade84..be29114fdfa 100644 --- a/lldb/test/lang/objc/objc-stepping/TestObjCStepping.py +++ b/lldb/test/lang/objc/objc-stepping/TestObjCStepping.py @@ -28,7 +28,7 @@ class TestObjCStepping(TestBase): self.stepped_past_nil_line = line_number (self.main_source, '// Step over nil should stop here.') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Test stepping through ObjC method dispatch in various forms.""" self.build() diff --git a/lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py b/lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py index 1b4388febeb..4d3386fd053 100644 --- a/lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py +++ b/lldb/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py @@ -21,7 +21,7 @@ class TestObjCStructArgument(TestBase): self.break_line = line_number(self.main_source, '// Set breakpoint here.') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Test passing structs to Objective-C methods.""" self.build() diff --git a/lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py b/lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py index 60455687a48..b5a01f04e33 100644 --- a/lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py +++ b/lldb/test/lang/objc/objc-struct-return/TestObjCStructReturn.py @@ -21,7 +21,7 @@ class TestObjCClassMethod(TestBase): self.break_line = line_number(self.main_source, '// Set breakpoint here.') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Test calling functions in class methods.""" self.build() diff --git a/lldb/test/lang/objc/objc-super/TestObjCSuper.py b/lldb/test/lang/objc/objc-super/TestObjCSuper.py index 051cb253eb9..414a1a8d456 100644 --- a/lldb/test/lang/objc/objc-super/TestObjCSuper.py +++ b/lldb/test/lang/objc/objc-super/TestObjCSuper.py @@ -22,7 +22,7 @@ class TestObjCSuperMethod(TestBase): @skipUnlessDarwin @expectedFailurei386 - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Test calling methods on super.""" self.build() diff --git a/lldb/test/lldbtest.py b/lldb/test/lldbtest.py index 01d6ead0ce2..d49bdd0271e 100644 --- a/lldb/test/lldbtest.py +++ b/lldb/test/lldbtest.py @@ -49,6 +49,7 @@ import unittest2 import lldb import lldbtest_config import lldbutil +import test_categories from six import add_metaclass from six import StringIO as SixStringIO @@ -469,21 +470,14 @@ def android_device_api(): # # Decorators for categorizing test cases. # - from functools import wraps -def python_api_test(func): - """Decorate the item as a Python API only test.""" - if isinstance(func, type) and issubclass(func, unittest2.TestCase): - raise Exception("@python_api_test can only be used to decorate a test method") - @wraps(func) - def wrapper(self, *args, **kwargs): - if lldb.dont_do_python_api_test: - self.skipTest("python api tests") - return func(self, *args, **kwargs) - - # Mark this function as such to separate them from lldb command line tests. - wrapper.__python_api_test__ = True - return wrapper +def add_test_categories(cat): + """Decorate an item with test categories""" + cat = test_categories.validate(cat, True) + def impl(func): + func.getCategories = lambda test: cat + return func + return impl def lldbmi_test(func): """Decorate the item as a lldb-mi only test.""" @@ -1388,19 +1382,6 @@ class Base(unittest2.TestCase): # used for all the test cases. self.testMethodName = self._testMethodName - # Python API only test is decorated with @python_api_test, - # which also sets the "__python_api_test__" attribute of the - # function object to True. - try: - if lldb.just_do_python_api_test: - testMethod = getattr(self, self._testMethodName) - if getattr(testMethod, "__python_api_test__", False): - pass - else: - self.skipTest("non python api test") - except AttributeError: - pass - # lldb-mi only test is decorated with @lldbmi_test, # which also sets the "__lldbmi_test__" attribute of the # function object to True. @@ -2252,6 +2233,7 @@ class LLDBTestCaseFactory(type): for attrname, attrvalue in attrs.items(): if attrname.startswith("test") and not getattr(attrvalue, "__no_debug_info_test__", False): @dsym_test + @wraps(attrvalue) def dsym_test_method(self, attrvalue=attrvalue): self.debug_info = "dsym" return attrvalue(self) @@ -2260,6 +2242,7 @@ class LLDBTestCaseFactory(type): newattrs[dsym_method_name] = dsym_test_method @dwarf_test + @wraps(attrvalue) def dwarf_test_method(self, attrvalue=attrvalue): self.debug_info = "dwarf" return attrvalue(self) @@ -2268,6 +2251,7 @@ class LLDBTestCaseFactory(type): newattrs[dwarf_method_name] = dwarf_test_method @dwo_test + @wraps(attrvalue) def dwo_test_method(self, attrvalue=attrvalue): self.debug_info = "dwo" return attrvalue(self) diff --git a/lldb/test/macosx/indirect_symbol/TestIndirectSymbols.py b/lldb/test/macosx/indirect_symbol/TestIndirectSymbols.py index 3985358f602..cea72749f55 100644 --- a/lldb/test/macosx/indirect_symbol/TestIndirectSymbols.py +++ b/lldb/test/macosx/indirect_symbol/TestIndirectSymbols.py @@ -20,7 +20,7 @@ class TestIndirectFunctions(TestBase): self.main_source = "main.c" @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Test stepping and setting breakpoints in indirect and re-exported symbols.""" self.build() diff --git a/lldb/test/macosx/queues/TestQueues.py b/lldb/test/macosx/queues/TestQueues.py index 77b1b6b2804..edd3ff063c7 100644 --- a/lldb/test/macosx/queues/TestQueues.py +++ b/lldb/test/macosx/queues/TestQueues.py @@ -15,7 +15,7 @@ class TestQueues(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) @unittest2.expectedFailure("rdar://22531180") def test_with_python_api(self): """Test queues inspection SB APIs.""" diff --git a/lldb/test/macosx/safe-to-func-call/TestSafeFuncCalls.py b/lldb/test/macosx/safe-to-func-call/TestSafeFuncCalls.py index e0e7b74b304..c24ccd5216e 100644 --- a/lldb/test/macosx/safe-to-func-call/TestSafeFuncCalls.py +++ b/lldb/test/macosx/safe-to-func-call/TestSafeFuncCalls.py @@ -20,7 +20,7 @@ class TestSafeFuncCalls(TestBase): self.main_source = "main.c" @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Test function call thread safety.""" self.build() diff --git a/lldb/test/macosx/universal/TestUniversal.py b/lldb/test/macosx/universal/TestUniversal.py index efe49a13b7d..d08c7c915c8 100644 --- a/lldb/test/macosx/universal/TestUniversal.py +++ b/lldb/test/macosx/universal/TestUniversal.py @@ -20,7 +20,7 @@ class UniversalTestCase(TestBase): # Find the line number to break inside main(). self.line = line_number('main.c', '// Set break point at this line.') - @python_api_test + @add_test_categories(['pyapi']) @skipUnlessDarwin @unittest2.skipUnless(hasattr(os, "uname") and os.uname()[4] in ['i386', 'x86_64'], "requires i386 or x86_64") diff --git a/lldb/test/python_api/breakpoint/TestBreakpointAPI.py b/lldb/test/python_api/breakpoint/TestBreakpointAPI.py index 245c14267dd..4e984cc266c 100644 --- a/lldb/test/python_api/breakpoint/TestBreakpointAPI.py +++ b/lldb/test/python_api/breakpoint/TestBreakpointAPI.py @@ -15,7 +15,7 @@ class BreakpointAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) def test_breakpoint_is_valid(self): """Make sure that if an SBBreakpoint gets deleted its IsValid returns false.""" self.build() diff --git a/lldb/test/python_api/class_members/TestSBTypeClassMembers.py b/lldb/test/python_api/class_members/TestSBTypeClassMembers.py index 6ead0af0643..6366a791f66 100644 --- a/lldb/test/python_api/class_members/TestSBTypeClassMembers.py +++ b/lldb/test/python_api/class_members/TestSBTypeClassMembers.py @@ -25,7 +25,7 @@ class SBTypeMemberFunctionsTest(TestBase): self.line = line_number(self.source, '// set breakpoint here') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) def test(self): """Test SBType APIs to fetch member function types.""" d = {'EXE': self.exe_name} diff --git a/lldb/test/python_api/debugger/TestDebuggerAPI.py b/lldb/test/python_api/debugger/TestDebuggerAPI.py index add7eade3d4..40719777bbe 100644 --- a/lldb/test/python_api/debugger/TestDebuggerAPI.py +++ b/lldb/test/python_api/debugger/TestDebuggerAPI.py @@ -11,7 +11,7 @@ class DebuggerAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_debugger_api_boundary_condition(self): """Exercise SBDebugger APIs with boundary conditions.""" @@ -32,7 +32,7 @@ class DebuggerAPITestCase(TestBase): self.dbg.SetCurrentPlatform(None) self.dbg.SetCurrentPlatformSDKRoot(None) - @python_api_test + @add_test_categories(['pyapi']) def test_debugger_delete_invalid_target(self): """SBDebugger.DeleteTarget() should not crash LLDB given and invalid target.""" target = lldb.SBTarget() diff --git a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py index fb8961dd2f8..0e6e053dcad 100644 --- a/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py +++ b/lldb/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py @@ -24,7 +24,7 @@ class APIDefaultConstructorTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBAddress(self): obj = lldb.SBAddress() @@ -35,7 +35,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_address sb_address.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBBlock(self): obj = lldb.SBBlock() @@ -46,7 +46,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_block sb_block.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBBreakpoint(self): obj = lldb.SBBreakpoint() @@ -57,7 +57,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_breakpoint sb_breakpoint.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBBreakpointLocation(self): obj = lldb.SBBreakpointLocation() @@ -68,7 +68,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_breakpointlocation sb_breakpointlocation.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBBroadcaster(self): obj = lldb.SBBroadcaster() @@ -79,7 +79,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_broadcaster sb_broadcaster.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBCommandReturnObject(self): """SBCommandReturnObject object is valid after default construction.""" @@ -88,7 +88,7 @@ class APIDefaultConstructorTestCase(TestBase): print(obj) self.assertTrue(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBCommunication(self): obj = lldb.SBCommunication() @@ -99,7 +99,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_communication sb_communication.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBCompileUnit(self): obj = lldb.SBCompileUnit() @@ -110,7 +110,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_compileunit sb_compileunit.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBDebugger(self): obj = lldb.SBDebugger() @@ -121,7 +121,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_debugger sb_debugger.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test # darwin: This test passes with swig 3.0.2, fails w/3.0.5 other tests fail with 2.0.12 http://llvm.org/pr23488 def test_SBError(self): @@ -133,7 +133,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_error sb_error.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBEvent(self): obj = lldb.SBEvent() @@ -146,7 +146,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_event sb_event.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) def test_SBFileSpec(self): obj = lldb.SBFileSpec() # This is just to test that FileSpec(None) does not crash. @@ -158,7 +158,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_filespec sb_filespec.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBFrame(self): obj = lldb.SBFrame() @@ -169,7 +169,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_frame sb_frame.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBFunction(self): obj = lldb.SBFunction() @@ -180,7 +180,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_function sb_function.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBInstruction(self): obj = lldb.SBInstruction() @@ -191,7 +191,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_instruction sb_instruction.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBInstructionList(self): obj = lldb.SBInstructionList() @@ -202,7 +202,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_instructionlist sb_instructionlist.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBLineEntry(self): obj = lldb.SBLineEntry() @@ -213,7 +213,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_lineentry sb_lineentry.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBListener(self): obj = lldb.SBListener() @@ -224,7 +224,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_listener sb_listener.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBModule(self): obj = lldb.SBModule() @@ -235,7 +235,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_module sb_module.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBProcess(self): obj = lldb.SBProcess() @@ -246,7 +246,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_process sb_process.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBSection(self): obj = lldb.SBSection() @@ -257,7 +257,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_section sb_section.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBStream(self): """SBStream object is valid after default construction.""" @@ -266,7 +266,7 @@ class APIDefaultConstructorTestCase(TestBase): print(obj) self.assertTrue(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBStringList(self): obj = lldb.SBStringList() @@ -277,7 +277,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_stringlist sb_stringlist.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBSymbol(self): obj = lldb.SBSymbol() @@ -288,7 +288,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_symbol sb_symbol.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBSymbolContext(self): obj = lldb.SBSymbolContext() @@ -299,7 +299,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_symbolcontext sb_symbolcontext.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBSymbolContextList(self): """SBSymbolContextList object is valid after default construction.""" @@ -308,7 +308,7 @@ class APIDefaultConstructorTestCase(TestBase): print(obj) self.assertTrue(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBTarget(self): obj = lldb.SBTarget() @@ -319,7 +319,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_target sb_target.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBThread(self): obj = lldb.SBThread() @@ -330,7 +330,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_thread sb_thread.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBType(self): try: @@ -349,7 +349,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_type sb_type.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBTypeList(self): """SBTypeList object is valid after default construction.""" @@ -358,7 +358,7 @@ class APIDefaultConstructorTestCase(TestBase): print(obj) self.assertTrue(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBValue(self): obj = lldb.SBValue() @@ -369,7 +369,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_value sb_value.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBValueList(self): obj = lldb.SBValueList() @@ -380,7 +380,7 @@ class APIDefaultConstructorTestCase(TestBase): import sb_valuelist sb_valuelist.fuzz_obj(obj) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_SBWatchpoint(self): obj = lldb.SBWatchpoint() diff --git a/lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py b/lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py index a6a165777ec..e5dcc499dfa 100644 --- a/lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py +++ b/lldb/test/python_api/disassemble-raw-data/TestDisassembleRawData.py @@ -15,7 +15,7 @@ class DisassembleRawDataTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_disassemble_raw_data(self): """Test disassembling raw bytes with the API.""" diff --git a/lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py b/lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py index 6e326b897b9..25f43e2a4f9 100644 --- a/lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py +++ b/lldb/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py @@ -16,7 +16,7 @@ class Disassemble_VST1_64(TestBase): mydir = TestBase.compute_mydir(__file__) @skipIf(True) # llvm.org/pr24575: all tests get ERRORs in dotest.py after this - @python_api_test + @add_test_categories(['pyapi']) @no_debug_info_test def test_disassemble_invalid_vst_1_64_raw_data(self): """Test disassembling invalid vst1.64 raw bytes with the API.""" diff --git a/lldb/test/python_api/event/TestEvents.py b/lldb/test/python_api/event/TestEvents.py index 6fcb67f5869..773c1893f47 100644 --- a/lldb/test/python_api/event/TestEvents.py +++ b/lldb/test/python_api/event/TestEvents.py @@ -21,7 +21,7 @@ class EventAPITestCase(TestBase): # Find the line number to of function 'c'. self.line = line_number('main.c', '// Find the line number of function "c" here.') - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureLinux("llvm.org/pr23730") # Flaky, fails ~1/10 cases @skipIfLinux # skip to avoid crashes def test_listen_for_and_print_event(self): @@ -100,7 +100,7 @@ class EventAPITestCase(TestBase): # Wait until the 'MyListeningThread' terminates. my_thread.join() - @python_api_test + @add_test_categories(['pyapi']) def test_wait_for_event(self): """Exercise SBListener.WaitForEvent() API.""" self.build() @@ -172,7 +172,7 @@ class EventAPITestCase(TestBase): "My listening thread successfully received an event") @skipIfFreeBSD # llvm.org/pr21325 - @python_api_test + @add_test_categories(['pyapi']) @expectedFlakeyLinux("llvm.org/pr23617") # Flaky, fails ~1/10 cases @expectedFailureWindows("llvm.org/pr24778") def test_add_listener_to_broadcaster(self): diff --git a/lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py b/lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py index 6a3be36a592..fbe43bc77ca 100644 --- a/lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py +++ b/lldb/test/python_api/findvalue_duplist/TestSBFrameFindValue.py @@ -13,7 +13,7 @@ class SBFrameFindValueTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) def test_formatters_api(self): """Test that SBFrame::FindValue finds things but does not duplicate the entire variables list""" self.build() diff --git a/lldb/test/python_api/formatters/TestFormattersSBAPI.py b/lldb/test/python_api/formatters/TestFormattersSBAPI.py index 7f3075f09c5..807848fff1b 100644 --- a/lldb/test/python_api/formatters/TestFormattersSBAPI.py +++ b/lldb/test/python_api/formatters/TestFormattersSBAPI.py @@ -18,7 +18,7 @@ class SBFormattersAPITestCase(TestBase): TestBase.setUp(self) self.line = line_number('main.cpp', '// Set break point at this line.') - @python_api_test + @add_test_categories(['pyapi']) def test_formatters_api(self): """Test Python APIs for working with formatters""" self.build() @@ -291,7 +291,7 @@ class SBFormattersAPITestCase(TestBase): self.expect("frame variable e2", substrs=["I am an empty Empty2"]) self.expect("frame variable e2", substrs=["I am an empty Empty2 {}"], matching=False) - @python_api_test + @add_test_categories(['pyapi']) def test_force_synth_off(self): """Test that one can have the public API return non-synthetic SBValues if desired""" self.build(dictionary={'EXE':'no_synth'}) diff --git a/lldb/test/python_api/frame/TestFrames.py b/lldb/test/python_api/frame/TestFrames.py index d8cccc6fea0..98f5062e28c 100644 --- a/lldb/test/python_api/frame/TestFrames.py +++ b/lldb/test/python_api/frame/TestFrames.py @@ -16,7 +16,7 @@ class FrameAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureWindows("llvm.org/pr24778") def test_get_arg_vals_for_call_stack(self): """Exercise SBFrame.GetVariables() API to get argument vals.""" @@ -106,7 +106,7 @@ class FrameAPITestCase(TestBase): substrs = ["a((int)val=1, (char)ch='A')", "a((int)val=3, (char)ch='A')"]) - @python_api_test + @add_test_categories(['pyapi']) def test_frame_api_boundary_condition(self): """Exercise SBFrame APIs with boundary condition inputs.""" self.build() @@ -145,7 +145,7 @@ class FrameAPITestCase(TestBase): frame.EvaluateExpression(None) - @python_api_test + @add_test_categories(['pyapi']) def test_frame_api_IsEqual(self): """Exercise SBFrame API IsEqual.""" self.build() diff --git a/lldb/test/python_api/frame/inlines/TestInlinedFrame.py b/lldb/test/python_api/frame/inlines/TestInlinedFrame.py index 1fc86064fb7..63288a8e479 100644 --- a/lldb/test/python_api/frame/inlines/TestInlinedFrame.py +++ b/lldb/test/python_api/frame/inlines/TestInlinedFrame.py @@ -23,7 +23,7 @@ class InlinedFrameAPITestCase(TestBase): self.first_stop = line_number(self.source, '// This should correspond to the first break stop.') self.second_stop = line_number(self.source, '// This should correspond to the second break stop.') - @python_api_test + @add_test_categories(['pyapi']) def test_stop_at_outer_inline(self): """Exercise SBFrame.IsInlined() and SBFrame.GetFunctionName().""" self.build() diff --git a/lldb/test/python_api/function_symbol/TestDisasmAPI.py b/lldb/test/python_api/function_symbol/TestDisasmAPI.py index 7f0dce11fdb..d66a66f1b8d 100644 --- a/lldb/test/python_api/function_symbol/TestDisasmAPI.py +++ b/lldb/test/python_api/function_symbol/TestDisasmAPI.py @@ -22,7 +22,7 @@ class DisasmAPITestCase(TestBase): self.line1 = line_number('main.c', '// Find the line number for breakpoint 1 here.') self.line2 = line_number('main.c', '// Find the line number for breakpoint 2 here.') - @python_api_test + @add_test_categories(['pyapi']) def test(self): """Exercise getting SBAddress objects, disassembly, and SBAddress APIs.""" self.build() diff --git a/lldb/test/python_api/function_symbol/TestSymbolAPI.py b/lldb/test/python_api/function_symbol/TestSymbolAPI.py index bb0a78a59f4..1488e520db6 100644 --- a/lldb/test/python_api/function_symbol/TestSymbolAPI.py +++ b/lldb/test/python_api/function_symbol/TestSymbolAPI.py @@ -22,7 +22,7 @@ class SymbolAPITestCase(TestBase): self.line1 = line_number('main.c', '// Find the line number for breakpoint 1 here.') self.line2 = line_number('main.c', '// Find the line number for breakpoint 2 here.') - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureWindows("llvm.org/pr24778") def test(self): """Exercise some SBSymbol and SBAddress APIs.""" diff --git a/lldb/test/python_api/hello_world/TestHelloWorld.py b/lldb/test/python_api/hello_world/TestHelloWorld.py index 5e8343e2407..430d4fbfa4a 100644 --- a/lldb/test/python_api/hello_world/TestHelloWorld.py +++ b/lldb/test/python_api/hello_world/TestHelloWorld.py @@ -29,7 +29,7 @@ class HelloWorldTestCase(TestBase): # Call super's tearDown(). TestBase.tearDown(self) - @python_api_test + @add_test_categories(['pyapi']) def test_with_process_launch_api(self): """Create target, breakpoint, launch a process, and then kill it.""" self.build(dictionary=self.d) @@ -72,7 +72,7 @@ class HelloWorldTestCase(TestBase): # The breakpoint should have a hit count of 1. self.assertTrue(breakpoint.GetHitCount() == 1, BREAKPOINT_HIT_ONCE) - @python_api_test + @add_test_categories(['pyapi']) @expectedFailurei386 # llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly @expectedFailureWindows("llvm.org/pr24600") def test_with_attach_to_process_with_id_api(self): @@ -101,7 +101,7 @@ class HelloWorldTestCase(TestBase): substrs = ['main.c:%d' % self.line2, '(int)argc=3']) - @python_api_test + @add_test_categories(['pyapi']) @expectedFailurei386 # llvm.org/pr17384: lldb needs to be aware of linux-vdso.so to unwind stacks properly @expectedFailureWindows("llvm.org/pr24600") def test_with_attach_to_process_with_name_api(self): diff --git a/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py b/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py index 74baf11029d..3755bfbd33f 100644 --- a/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py +++ b/lldb/test/python_api/interpreter/TestCommandInterpreterAPI.py @@ -18,7 +18,7 @@ class CommandInterpreterAPICase(TestBase): # Find the line number to break on inside main.cpp. self.line = line_number('main.c', 'Hello world.') - @python_api_test + @add_test_categories(['pyapi']) def test_with_process_launch_api(self): """Test the SBCommandInterpreter APIs.""" self.build() diff --git a/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py b/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py index 90ceed2a29e..a9f735eedff 100644 --- a/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py +++ b/lldb/test/python_api/lldbutil/frame/TestFrameUtils.py @@ -21,7 +21,7 @@ class FrameUtilsTestCase(TestBase): self.line = line_number('main.c', "// Find the line number here.") - @python_api_test + @add_test_categories(['pyapi']) def test_frame_utils(self): """Test utility functions for the frame object.""" self.build() diff --git a/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py b/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py index c8ab81317f4..5c4db483431 100644 --- a/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py +++ b/lldb/test/python_api/lldbutil/iter/TestLLDBIterator.py @@ -22,7 +22,7 @@ class LLDBIteratorTestCase(TestBase): self.line1 = line_number('main.cpp', '// Set break point at this line.') self.line2 = line_number('main.cpp', '// And that line.') - @python_api_test + @add_test_categories(['pyapi']) def test_lldb_iter_module(self): """Test module_iter works correctly for SBTarget -> SBModule.""" self.build() @@ -56,7 +56,7 @@ class LLDBIteratorTestCase(TestBase): self.assertTrue(yours[i] == mine[i], "UUID+FileSpec of yours[{0}] and mine[{0}] matches".format(i)) - @python_api_test + @add_test_categories(['pyapi']) def test_lldb_iter_breakpoint(self): """Test breakpoint_iter works correctly for SBTarget -> SBBreakpoint.""" self.build() @@ -88,7 +88,7 @@ class LLDBIteratorTestCase(TestBase): self.assertTrue(yours[i] == mine[i], "ID of yours[{0}] and mine[{0}] matches".format(i)) - @python_api_test + @add_test_categories(['pyapi']) def test_lldb_iter_frame(self): """Test iterator works correctly for SBProcess->SBThread->SBFrame.""" self.build() diff --git a/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py b/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py index 43b5d9d1074..bb098b9f690 100644 --- a/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py +++ b/lldb/test/python_api/lldbutil/iter/TestRegistersIterator.py @@ -21,7 +21,7 @@ class RegistersIteratorTestCase(TestBase): # Find the line number to break inside main(). self.line1 = line_number('main.cpp', '// Set break point at this line.') - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureWindows # Test crashes def test_iter_registers(self): """Test iterator works correctly for lldbutil.iter_registers().""" diff --git a/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py b/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py index 859cbdc452c..f8a6533fab4 100644 --- a/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py +++ b/lldb/test/python_api/lldbutil/process/TestPrintStackTraces.py @@ -23,7 +23,7 @@ class ThreadsStackTracesTestCase(TestBase): @expectedFailureAll("llvm.org/pr23043", ["linux"], archs=["i386"]) # We are unable to produce a backtrace of the main thread when the thread is blocked in fgets @expectedFailureWindows("llvm.org/pr24778") - @python_api_test + @add_test_categories(['pyapi']) def test_stack_traces(self): """Test SBprocess and SBThread APIs with printing of the stack traces.""" self.build() diff --git a/lldb/test/python_api/module_section/TestModuleAndSection.py b/lldb/test/python_api/module_section/TestModuleAndSection.py index c89ff221d62..d12f1ae6ba3 100644 --- a/lldb/test/python_api/module_section/TestModuleAndSection.py +++ b/lldb/test/python_api/module_section/TestModuleAndSection.py @@ -16,7 +16,7 @@ class ModuleAndSectionAPIsTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) def test_module_and_section(self): """Test module and section APIs.""" self.build() @@ -56,7 +56,7 @@ class ModuleAndSectionAPIsTestCase(TestBase): print(INDENT2 + str(sym)) print(INDENT2 + "symbol type: %s" % symbol_type_to_str(sym.GetType())) - @python_api_test + @add_test_categories(['pyapi']) def test_module_and_section_boundary_condition(self): """Test module and section APIs by passing None when it expects a Python string.""" self.build() @@ -97,7 +97,7 @@ class ModuleAndSectionAPIsTestCase(TestBase): if sec1: sec1.FindSubSection(None) - @python_api_test + @add_test_categories(['pyapi']) def test_module_compile_unit_iter(self): """Test module's compile unit iterator APIs.""" self.build() diff --git a/lldb/test/python_api/objc_type/TestObjCType.py b/lldb/test/python_api/objc_type/TestObjCType.py index d8564632c46..1255d6fb63f 100644 --- a/lldb/test/python_api/objc_type/TestObjCType.py +++ b/lldb/test/python_api/objc_type/TestObjCType.py @@ -21,7 +21,7 @@ class ObjCSBTypeTestCase(TestBase): self.line = line_number("main.m", '// Break at this line') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) def test(self): """Test SBType for ObjC classes.""" self.build() diff --git a/lldb/test/python_api/process/TestProcessAPI.py b/lldb/test/python_api/process/TestProcessAPI.py index e75b78c62f3..0f0d3242010 100644 --- a/lldb/test/python_api/process/TestProcessAPI.py +++ b/lldb/test/python_api/process/TestProcessAPI.py @@ -21,7 +21,7 @@ class ProcessAPITestCase(TestBase): # Find the line number to break inside main(). self.line = line_number("main.cpp", "// Set break point at this line and check variable 'my_char'.") - @python_api_test + @add_test_categories(['pyapi']) def test_read_memory(self): """Test Python SBProcess.ReadMemory() API.""" self.build() @@ -104,7 +104,7 @@ class ProcessAPITestCase(TestBase): if my_uint32 != 12345: self.fail("Result from SBProcess.ReadUnsignedFromMemory() does not match our expected output") - @python_api_test + @add_test_categories(['pyapi']) def test_write_memory(self): """Test Python SBProcess.WriteMemory() API.""" self.build() @@ -156,7 +156,7 @@ class ProcessAPITestCase(TestBase): exe=False, startstr = 'a') - @python_api_test + @add_test_categories(['pyapi']) def test_access_my_int(self): """Test access 'my_int' using Python SBProcess.GetByteOrder() and other APIs.""" self.build() @@ -246,7 +246,7 @@ class ProcessAPITestCase(TestBase): for i in new_bytes: print("byte:", i) - @python_api_test + @add_test_categories(['pyapi']) def test_remote_launch(self): """Test SBProcess.RemoteLaunch() API with a process not in eStateConnected, and it should fail.""" self.build() @@ -266,7 +266,7 @@ class ProcessAPITestCase(TestBase): success = process.RemoteLaunch(None, None, None, None, None, None, 0, False, error) self.assertTrue(not success, "RemoteLaunch() should fail for process state != eStateConnected") - @python_api_test + @add_test_categories(['pyapi']) def test_get_num_supported_hardware_watchpoints(self): """Test SBProcess.GetNumSupportedHardwareWatchpoints() API with a process.""" self.build() diff --git a/lldb/test/python_api/process/io/TestProcessIO.py b/lldb/test/python_api/process/io/TestProcessIO.py index 162003f6bcf..2dc3f40ac9b 100644 --- a/lldb/test/python_api/process/io/TestProcessIO.py +++ b/lldb/test/python_api/process/io/TestProcessIO.py @@ -28,7 +28,7 @@ class ProcessIOTestCase(TestBase): self.lines = ["Line 1", "Line 2", "Line 3"] @skipIfWindows # stdio manipulation unsupported on Windows - @python_api_test + @add_test_categories(['pyapi']) def test_stdin_by_api(self): """Exercise SBProcess.PutSTDIN().""" self.build() @@ -38,7 +38,7 @@ class ProcessIOTestCase(TestBase): self.check_process_output(output, output) @skipIfWindows # stdio manipulation unsupported on Windows - @python_api_test + @add_test_categories(['pyapi']) def test_stdin_redirection(self): """Exercise SBLaunchInfo::AddOpenFileAction() for STDIN without specifying STDOUT or STDERR.""" self.build() @@ -49,7 +49,7 @@ class ProcessIOTestCase(TestBase): self.check_process_output(output, output) @skipIfWindows # stdio manipulation unsupported on Windows - @python_api_test + @add_test_categories(['pyapi']) def test_stdout_redirection(self): """Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT without specifying STDIN or STDERR.""" self.build() @@ -61,7 +61,7 @@ class ProcessIOTestCase(TestBase): self.check_process_output(output, error) @skipIfWindows # stdio manipulation unsupported on Windows - @python_api_test + @add_test_categories(['pyapi']) def test_stderr_redirection(self): """Exercise SBLaunchInfo::AddOpenFileAction() for STDERR without specifying STDIN or STDOUT.""" self.build() @@ -73,7 +73,7 @@ class ProcessIOTestCase(TestBase): self.check_process_output(output, error) @skipIfWindows # stdio manipulation unsupported on Windows - @python_api_test + @add_test_categories(['pyapi']) def test_stdout_stderr_redirection(self): """Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT and STDERR without redirecting STDIN.""" self.build() diff --git a/lldb/test/python_api/sbdata/TestSBData.py b/lldb/test/python_api/sbdata/TestSBData.py index 1e8f0e3cb0d..b0c5be97d18 100644 --- a/lldb/test/python_api/sbdata/TestSBData.py +++ b/lldb/test/python_api/sbdata/TestSBData.py @@ -20,7 +20,7 @@ class SBDataAPICase(TestBase): # Find the line number to break on inside main.cpp. self.line = line_number('main.cpp', '// set breakpoint here') - @python_api_test + @add_test_categories(['pyapi']) def test_with_run_command(self): """Test the SBData APIs.""" self.build() diff --git a/lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py b/lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py index 903eb8b57e2..39c055b854f 100644 --- a/lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py +++ b/lldb/test/python_api/sbvalue_persist/TestSBValuePersist.py @@ -13,7 +13,7 @@ class SBValuePersistTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureWindows("llvm.org/pr24772") def test(self): """Test SBValue::Persist""" diff --git a/lldb/test/python_api/section/TestSectionAPI.py b/lldb/test/python_api/section/TestSectionAPI.py index 8d7aef4945d..4d94a80df32 100755 --- a/lldb/test/python_api/section/TestSectionAPI.py +++ b/lldb/test/python_api/section/TestSectionAPI.py @@ -12,7 +12,7 @@ class SectionAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) def test_get_target_byte_size(self): d = {'EXE': 'b.out'} self.build(dictionary=d) diff --git a/lldb/test/python_api/signals/TestSignalsAPI.py b/lldb/test/python_api/signals/TestSignalsAPI.py index 8ddbdf3a946..4dc8e651e27 100644 --- a/lldb/test/python_api/signals/TestSignalsAPI.py +++ b/lldb/test/python_api/signals/TestSignalsAPI.py @@ -14,7 +14,7 @@ from lldbtest import * class SignalsAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) @expectedFlakeyLinux # this test fails 1/100 dosep runs @skipIfWindows # Windows doesn't have signals def test_ignore_signal(self): diff --git a/lldb/test/python_api/symbol-context/TestSymbolContext.py b/lldb/test/python_api/symbol-context/TestSymbolContext.py index 01509a9dd4a..b34960ac4f9 100644 --- a/lldb/test/python_api/symbol-context/TestSymbolContext.py +++ b/lldb/test/python_api/symbol-context/TestSymbolContext.py @@ -21,7 +21,7 @@ class SymbolContextAPITestCase(TestBase): # Find the line number to of function 'c'. self.line = line_number('main.c', '// Find the line number of function "c" here.') - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureWindows("llvm.org/pr24778") def test(self): """Exercise SBSymbolContext API extensively.""" diff --git a/lldb/test/python_api/target/TestTargetAPI.py b/lldb/test/python_api/target/TestTargetAPI.py index eadae1dc045..176581a167f 100644 --- a/lldb/test/python_api/target/TestTargetAPI.py +++ b/lldb/test/python_api/target/TestTargetAPI.py @@ -31,7 +31,7 @@ class TargetAPITestCase(TestBase): # It does not segfaults now. But for dwarf, the variable value is None if # the inferior process does not exist yet. The radar has been updated. #@unittest232.skip("segmentation fault -- skipping") - @python_api_test + @add_test_categories(['pyapi']) def test_find_global_variables(self): """Exercise SBTarget.FindGlobalVariables() API.""" d = {'EXE': 'b.out'} @@ -39,7 +39,7 @@ class TargetAPITestCase(TestBase): self.setTearDownCleanup(dictionary=d) self.find_global_variables('b.out') - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureWindows("llvm.org/pr24778") def test_find_functions(self): """Exercise SBTarget.FindFunctions() API.""" @@ -48,25 +48,25 @@ class TargetAPITestCase(TestBase): self.setTearDownCleanup(dictionary=d) self.find_functions('b.out') - @python_api_test + @add_test_categories(['pyapi']) def test_get_description(self): """Exercise SBTarget.GetDescription() API.""" self.build() self.get_description() - @python_api_test + @add_test_categories(['pyapi']) def test_launch_new_process_and_redirect_stdout(self): """Exercise SBTarget.Launch() API.""" self.build() self.launch_new_process_and_redirect_stdout() - @python_api_test + @add_test_categories(['pyapi']) def test_resolve_symbol_context_with_address(self): """Exercise SBTarget.ResolveSymbolContextForAddress() API.""" self.build() self.resolve_symbol_context_with_address() - @python_api_test + @add_test_categories(['pyapi']) def test_get_platform(self): d = {'EXE': 'b.out'} self.build(dictionary=d) @@ -75,7 +75,7 @@ class TargetAPITestCase(TestBase): platform = target.platform self.assertTrue(platform, VALID_PLATFORM) - @python_api_test + @add_test_categories(['pyapi']) def test_get_data_byte_size(self): d = {'EXE': 'b.out'} self.build(dictionary=d) @@ -83,7 +83,7 @@ class TargetAPITestCase(TestBase): target = self.create_simple_target('b.out') self.assertEquals(target.data_byte_size, 1) - @python_api_test + @add_test_categories(['pyapi']) def test_get_code_byte_size(self): d = {'EXE': 'b.out'} self.build(dictionary=d) @@ -91,7 +91,7 @@ class TargetAPITestCase(TestBase): target = self.create_simple_target('b.out') self.assertEquals(target.code_byte_size, 1) - @python_api_test + @add_test_categories(['pyapi']) def test_resolve_file_address(self): d = {'EXE': 'b.out'} self.build(dictionary=d) @@ -114,7 +114,7 @@ class TargetAPITestCase(TestBase): self.assertIsNotNone(data_section2) self.assertEquals(data_section.name, data_section2.name) - @python_api_test + @add_test_categories(['pyapi']) def test_read_memory(self): d = {'EXE': 'b.out'} self.build(dictionary=d) diff --git a/lldb/test/python_api/thread/TestThreadAPI.py b/lldb/test/python_api/thread/TestThreadAPI.py index 4d8e9b4872d..e76bb658f38 100644 --- a/lldb/test/python_api/thread/TestThreadAPI.py +++ b/lldb/test/python_api/thread/TestThreadAPI.py @@ -15,19 +15,19 @@ class ThreadAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) def test_get_process(self): """Test Python SBThread.GetProcess() API.""" self.build() self.get_process() - @python_api_test + @add_test_categories(['pyapi']) def test_get_stop_description(self): """Test Python SBThread.GetStopDescription() API.""" self.build() self.get_stop_description() - @python_api_test + @add_test_categories(['pyapi']) def test_run_to_address(self): """Test Python SBThread.RunToAddress() API.""" # We build a different executable than the default build() does. @@ -36,7 +36,7 @@ class ThreadAPITestCase(TestBase): self.setTearDownCleanup(dictionary=d) self.run_to_address(self.exe_name) - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureFreeBSD # llvm.org/pr20476 @expectedFailureWindows # Test crashes def test_step_out_of_malloc_into_function_b(self): @@ -47,7 +47,7 @@ class ThreadAPITestCase(TestBase): self.setTearDownCleanup(dictionary=d) self.step_out_of_malloc_into_function_b(self.exe_name) - @python_api_test + @add_test_categories(['pyapi']) def test_step_over_3_times(self): """Test Python SBThread.StepOver() API.""" # We build a different executable than the default build() does. diff --git a/lldb/test/python_api/type/TestTypeList.py b/lldb/test/python_api/type/TestTypeList.py index 27683c1dc1b..9ea401afe96 100644 --- a/lldb/test/python_api/type/TestTypeList.py +++ b/lldb/test/python_api/type/TestTypeList.py @@ -24,7 +24,7 @@ class TypeAndTypeListTestCase(TestBase): self.source = 'main.cpp' self.line = line_number(self.source, '// Break at this line') - @python_api_test + @add_test_categories(['pyapi']) def test(self): """Exercise SBType and SBTypeList API.""" d = {'EXE': self.exe_name} diff --git a/lldb/test/python_api/value/TestValueAPI.py b/lldb/test/python_api/value/TestValueAPI.py index 26813506cb3..d8776d506ae 100644 --- a/lldb/test/python_api/value/TestValueAPI.py +++ b/lldb/test/python_api/value/TestValueAPI.py @@ -24,7 +24,7 @@ class ValueAPITestCase(TestBase): self.line = line_number('main.c', '// Break at this line') @expectedFailureWindows("llvm.org/pr24772") - @python_api_test + @add_test_categories(['pyapi']) def test(self): """Exercise some SBValue APIs.""" d = {'EXE': self.exe_name} diff --git a/lldb/test/python_api/value/change_values/TestChangeValueAPI.py b/lldb/test/python_api/value/change_values/TestChangeValueAPI.py index 452cc63e704..1b461d2981e 100644 --- a/lldb/test/python_api/value/change_values/TestChangeValueAPI.py +++ b/lldb/test/python_api/value/change_values/TestChangeValueAPI.py @@ -26,7 +26,7 @@ class ChangeValueAPITestCase(TestBase): self.end_line = line_number ('main.c', '// Set a breakpoint here at the end') @expectedFailureWindows("llvm.org/pr24772") - @python_api_test + @add_test_categories(['pyapi']) def test_change_value(self): """Exercise the SBValue::SetValueFromCString API.""" d = {'EXE': self.exe_name} diff --git a/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py b/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py index 4c3a9b0da46..3ce749fcfcf 100644 --- a/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py +++ b/lldb/test/python_api/value/linked_list/TestValueAPILinkedList.py @@ -24,7 +24,7 @@ class ValueAsLinkedListTestCase(TestBase): # Find the line number to break at. self.line = line_number('main.cpp', '// Break at this line') - @python_api_test + @add_test_categories(['pyapi']) def test(self): """Exercise SBValue API linked_list_iter.""" d = {'EXE': self.exe_name} diff --git a/lldb/test/python_api/value_var_update/TestValueVarUpdate.py b/lldb/test/python_api/value_var_update/TestValueVarUpdate.py index 87e0ccd6629..e6d6d30c6e6 100644 --- a/lldb/test/python_api/value_var_update/TestValueVarUpdate.py +++ b/lldb/test/python_api/value_var_update/TestValueVarUpdate.py @@ -20,7 +20,7 @@ class HelloWorldTestCase(TestBase): self.exe = os.path.join(os.getcwd(), self.testMethodName) self.d = {'EXE': self.testMethodName} - @python_api_test + @add_test_categories(['pyapi']) def test_with_process_launch_api(self): """Test SBValue::GetValueDidChange""" self.build(dictionary=self.d) diff --git a/lldb/test/python_api/watchpoint/TestSetWatchpoint.py b/lldb/test/python_api/watchpoint/TestSetWatchpoint.py index 5554ff044d6..161804ffbb5 100644 --- a/lldb/test/python_api/watchpoint/TestSetWatchpoint.py +++ b/lldb/test/python_api/watchpoint/TestSetWatchpoint.py @@ -23,7 +23,7 @@ class SetWatchpointAPITestCase(TestBase): # Find the line number to break inside main(). self.line = line_number(self.source, '// Set break point at this line.') - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported @expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows def test_watch_val(self): diff --git a/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py b/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py index 95dad364de9..af72f685054 100644 --- a/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py +++ b/lldb/test/python_api/watchpoint/TestWatchpointIgnoreCount.py @@ -23,7 +23,7 @@ class WatchpointIgnoreCountTestCase(TestBase): # Find the line number to break inside main(). self.line = line_number(self.source, '// Set break point at this line.') - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported @expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows def test_set_watch_ignore_count(self): diff --git a/lldb/test/python_api/watchpoint/TestWatchpointIter.py b/lldb/test/python_api/watchpoint/TestWatchpointIter.py index 4ce2c0d79d8..031a4bf6d18 100644 --- a/lldb/test/python_api/watchpoint/TestWatchpointIter.py +++ b/lldb/test/python_api/watchpoint/TestWatchpointIter.py @@ -23,7 +23,7 @@ class WatchpointIteratorTestCase(TestBase): # Find the line number to break inside main(). self.line = line_number(self.source, '// Set break point at this line.') - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported @expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows def test_watch_iter(self): diff --git a/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py b/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py index 3ce2445f442..774288a05c3 100644 --- a/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py +++ b/lldb/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py @@ -25,7 +25,7 @@ class SetWatchlocationAPITestCase(TestBase): # This is for verifying that watch location works. self.violating_func = "do_bad_thing_with_location"; - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported @expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows def test_watch_location(self): diff --git a/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py b/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py index 884989f46de..2051635c13a 100644 --- a/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py +++ b/lldb/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py @@ -25,7 +25,7 @@ class TargetWatchAddressAPITestCase(TestBase): # This is for verifying that watch location works. self.violating_func = "do_bad_thing_with_location"; - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported @expectedFailureWindows("llvm.org/pr24446") def test_watch_address(self): @@ -88,7 +88,7 @@ class TargetWatchAddressAPITestCase(TestBase): # This finishes our test. - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported @skipIf(archs=['mips', 'mipsel', 'mips64', 'mips64el']) # No size constraint on MIPS for watches def test_watch_address_with_invalid_watch_size(self): diff --git a/lldb/test/source-manager/TestSourceManager.py b/lldb/test/source-manager/TestSourceManager.py index 9beaacefa62..3301704f369 100644 --- a/lldb/test/source-manager/TestSourceManager.py +++ b/lldb/test/source-manager/TestSourceManager.py @@ -28,7 +28,7 @@ class SourceManagerTestCase(TestBase): self.line = line_number('main.c', '// Set break point at this line.') lldb.skip_build_and_cleanup = False - @python_api_test + @add_test_categories(['pyapi']) def test_display_source_python(self): """Test display of source using the SBSourceManager API.""" self.build() diff --git a/lldb/test/test_categories.py b/lldb/test/test_categories.py new file mode 100644 index 00000000000..8438a4eba23 --- /dev/null +++ b/lldb/test/test_categories.py @@ -0,0 +1,47 @@ +""" +Provides definitions for various lldb test categories +""" + +import sys + +all_categories = { + 'dataformatters': 'Tests related to the type command and the data formatters subsystem', + 'expression' : 'Tests related to the expression parser', + 'objc' : 'Tests related to the Objective-C programming language support', + 'pyapi' : 'Tests related to the Python API', + 'basic_process' : 'Basic process execution sniff tests.', + 'cmdline' : 'Tests related to the LLDB command-line interface', + 'dyntype' : 'Tests related to dynamic type support', + 'stresstest' : 'Tests related to stressing lldb limits', + 'flakey' : 'Flakey test cases, i.e. tests that do not reliably pass at each execution' +} + +def unique_string_match(yourentry, list): + candidate = None + for item in list: + if not item.startswith(yourentry): + continue + if candidate: + return None + candidate = item + return candidate + +def validate(categories, exact_match): + """ + For each category in categories, ensure that it's a valid category (if exact_match is false, + unique prefixes are also accepted). If a category is invalid, print a message and quit. + If all categories are valid, return the list of categories. Prefixes are expanded in the + returned list. + """ + result = [] + for category in categories: + origCategory = category + if category not in all_categories and not exact_match: + category = unique_string_match(category, all_categories) + if (category not in all_categories) or category == None: + print("fatal error: category '" + origCategory + "' is not a valid category") + print("if you have added a new category, please edit test_categories.py, adding your new category to all_categories") + print("else, please specify one or more of the following: " + str(list(all_categories.keys()))) + sys.exit(1) + result.append(category) + return result |