Index: lldb/trunk/test/dotest.py =================================================================== --- lldb/trunk/test/dotest.py +++ lldb/trunk/test/dotest.py @@ -41,6 +41,7 @@ import inspect import unittest2 import lldbtest_config +import test_categories import six @@ -80,33 +81,9 @@ # 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 @@ 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 @@ '-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 @@ 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 @@ 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 @@ 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 @@ 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 Index: lldb/trunk/test/dotest_args.py =================================================================== --- lldb/trunk/test/dotest_args.py +++ lldb/trunk/test/dotest_args.py @@ -55,8 +55,6 @@ # 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 @@ # 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.') Index: lldb/trunk/test/expression_command/test/TestExprs.py =================================================================== --- lldb/trunk/test/expression_command/test/TestExprs.py +++ lldb/trunk/test/expression_command/test/TestExprs.py @@ -98,7 +98,7 @@ "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): Index: lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py =================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py @@ -17,7 +17,7 @@ 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() Index: lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py =================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py @@ -28,7 +28,7 @@ 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() Index: lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py =================================================================== --- lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py +++ lldb/trunk/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py @@ -20,7 +20,7 @@ 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() Index: lldb/trunk/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py =================================================================== --- lldb/trunk/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py +++ lldb/trunk/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py @@ -17,7 +17,7 @@ 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.""" Index: lldb/trunk/test/functionalities/command_script/import/TestImport.py =================================================================== --- lldb/trunk/test/functionalities/command_script/import/TestImport.py +++ lldb/trunk/test/functionalities/command_script/import/TestImport.py @@ -12,7 +12,7 @@ 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""" Index: lldb/trunk/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py =================================================================== --- lldb/trunk/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py +++ lldb/trunk/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py @@ -12,7 +12,7 @@ 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.""" Index: lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py =================================================================== --- lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py +++ lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py @@ -21,7 +21,7 @@ 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() Index: lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py =================================================================== --- lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py +++ lldb/trunk/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py @@ -18,6 +18,7 @@ @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") Index: lldb/trunk/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py =================================================================== --- lldb/trunk/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py +++ lldb/trunk/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py @@ -34,7 +34,7 @@ @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.""" Index: lldb/trunk/test/functionalities/inferior-assert/TestInferiorAssert.py =================================================================== --- lldb/trunk/test/functionalities/inferior-assert/TestInferiorAssert.py +++ lldb/trunk/test/functionalities/inferior-assert/TestInferiorAssert.py @@ -33,7 +33,7 @@ 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).""" Index: lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py =================================================================== --- lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py +++ lldb/trunk/test/functionalities/inferior-crashing/TestInferiorCrashing.py @@ -25,7 +25,7 @@ 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).""" Index: lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py =================================================================== --- lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py +++ lldb/trunk/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py @@ -26,7 +26,7 @@ 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).""" Index: lldb/trunk/test/functionalities/inline-stepping/TestInlineStepping.py =================================================================== --- lldb/trunk/test/functionalities/inline-stepping/TestInlineStepping.py +++ lldb/trunk/test/functionalities/inline-stepping/TestInlineStepping.py @@ -13,7 +13,7 @@ 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 @@ 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() Index: lldb/trunk/test/functionalities/return-value/TestReturnValue.py =================================================================== --- lldb/trunk/test/functionalities/return-value/TestReturnValue.py +++ lldb/trunk/test/functionalities/return-value/TestReturnValue.py @@ -17,7 +17,7 @@ @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() Index: lldb/trunk/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py =================================================================== --- lldb/trunk/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py +++ lldb/trunk/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py @@ -16,14 +16,14 @@ 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 @@ 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.""" Index: lldb/trunk/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py =================================================================== --- lldb/trunk/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py +++ lldb/trunk/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py @@ -18,7 +18,7 @@ @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.""" Index: lldb/trunk/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py =================================================================== --- lldb/trunk/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py +++ lldb/trunk/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py @@ -19,7 +19,7 @@ # 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): Index: lldb/trunk/test/lang/c/array_types/TestArrayTypes.py =================================================================== --- lldb/trunk/test/lang/c/array_types/TestArrayTypes.py +++ lldb/trunk/test/lang/c/array_types/TestArrayTypes.py @@ -68,7 +68,7 @@ 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() Index: lldb/trunk/test/lang/c/bitfields/TestBitfields.py =================================================================== --- lldb/trunk/test/lang/c/bitfields/TestBitfields.py +++ lldb/trunk/test/lang/c/bitfields/TestBitfields.py @@ -95,7 +95,7 @@ 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.""" Index: lldb/trunk/test/lang/c/stepping/TestStepAndBreakpoints.py =================================================================== --- lldb/trunk/test/lang/c/stepping/TestStepAndBreakpoints.py +++ lldb/trunk/test/lang/c/stepping/TestStepAndBreakpoints.py @@ -25,7 +25,7 @@ @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() Index: lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py =================================================================== --- lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py +++ lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py @@ -52,7 +52,7 @@ @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() Index: lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py =================================================================== --- lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py +++ lldb/trunk/test/lang/cpp/class_types/TestClassTypes.py @@ -52,7 +52,7 @@ 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() Index: lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py =================================================================== --- lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py +++ lldb/trunk/test/lang/cpp/class_types/TestClassTypesDisassembly.py @@ -36,7 +36,7 @@ #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() Index: lldb/trunk/test/lang/cpp/dynamic-value/TestCppValueCast.py =================================================================== --- lldb/trunk/test/lang/cpp/dynamic-value/TestCppValueCast.py +++ lldb/trunk/test/lang/cpp/dynamic-value/TestCppValueCast.py @@ -17,14 +17,14 @@ 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) Index: lldb/trunk/test/lang/cpp/dynamic-value/TestDynamicValue.py =================================================================== --- lldb/trunk/test/lang/cpp/dynamic-value/TestDynamicValue.py +++ lldb/trunk/test/lang/cpp/dynamic-value/TestDynamicValue.py @@ -29,7 +29,7 @@ @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()) Index: lldb/trunk/test/lang/cpp/stl/TestSTL.py =================================================================== --- lldb/trunk/test/lang/cpp/stl/TestSTL.py +++ lldb/trunk/test/lang/cpp/stl/TestSTL.py @@ -68,7 +68,7 @@ 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() Index: lldb/trunk/test/lang/go/goroutines/TestGoroutines.py =================================================================== --- lldb/trunk/test/lang/go/goroutines/TestGoroutines.py +++ lldb/trunk/test/lang/go/goroutines/TestGoroutines.py @@ -13,7 +13,7 @@ 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 Index: lldb/trunk/test/lang/go/types/TestGoASTContext.py =================================================================== --- lldb/trunk/test/lang/go/types/TestGoASTContext.py +++ lldb/trunk/test/lang/go/types/TestGoASTContext.py @@ -13,7 +13,7 @@ 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 Index: lldb/trunk/test/lang/objc/blocks/TestObjCIvarsInBlocks.py =================================================================== --- lldb/trunk/test/lang/objc/blocks/TestObjCIvarsInBlocks.py +++ lldb/trunk/test/lang/objc/blocks/TestObjCIvarsInBlocks.py @@ -22,7 +22,7 @@ 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""" Index: lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py =================================================================== --- lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py +++ lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py @@ -174,7 +174,7 @@ 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: lldb needs to use the ObjC runtime symbols for ivar offsets Index: lldb/trunk/test/lang/objc/foundation/TestObjectDescriptionAPI.py =================================================================== --- lldb/trunk/test/lang/objc/foundation/TestObjectDescriptionAPI.py +++ lldb/trunk/test/lang/objc/foundation/TestObjectDescriptionAPI.py @@ -24,7 +24,7 @@ # 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'} Index: lldb/trunk/test/lang/objc/foundation/TestSymbolTable.py =================================================================== --- lldb/trunk/test/lang/objc/foundation/TestSymbolTable.py +++ lldb/trunk/test/lang/objc/foundation/TestSymbolTable.py @@ -27,7 +27,7 @@ 'main' ] - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Test symbol table access with Python APIs.""" self.build() Index: lldb/trunk/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py =================================================================== --- lldb/trunk/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py +++ lldb/trunk/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py @@ -22,7 +22,7 @@ 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': Index: lldb/trunk/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py =================================================================== --- lldb/trunk/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py +++ lldb/trunk/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py @@ -21,7 +21,7 @@ self.break_line = line_number(self.main_source, '// Set breakpoint here.') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) # [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.""" Index: lldb/trunk/test/lang/objc/objc-checker/TestObjCCheckers.py =================================================================== --- lldb/trunk/test/lang/objc/objc-checker/TestObjCCheckers.py +++ lldb/trunk/test/lang/objc/objc-checker/TestObjCCheckers.py @@ -23,7 +23,7 @@ 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': Index: lldb/trunk/test/lang/objc/objc-class-method/TestObjCClassMethod.py =================================================================== --- lldb/trunk/test/lang/objc/objc-class-method/TestObjCClassMethod.py +++ lldb/trunk/test/lang/objc/objc-class-method/TestObjCClassMethod.py @@ -22,7 +22,7 @@ @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.""" Index: lldb/trunk/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py =================================================================== --- lldb/trunk/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py +++ lldb/trunk/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py @@ -29,7 +29,7 @@ '// 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.""" Index: lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py =================================================================== --- lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py +++ lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py @@ -21,7 +21,7 @@ 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() Index: lldb/trunk/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py =================================================================== --- lldb/trunk/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py +++ lldb/trunk/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py @@ -23,7 +23,7 @@ @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() Index: lldb/trunk/test/lang/objc/objc-property/TestObjCProperty.py =================================================================== --- lldb/trunk/test/lang/objc/objc-property/TestObjCProperty.py +++ lldb/trunk/test/lang/objc/objc-property/TestObjCProperty.py @@ -23,7 +23,7 @@ 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': Index: lldb/trunk/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py =================================================================== --- lldb/trunk/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py +++ lldb/trunk/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py @@ -21,7 +21,7 @@ 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 # Index: lldb/trunk/test/lang/objc/objc-static-method/TestObjCStaticMethod.py =================================================================== --- lldb/trunk/test/lang/objc/objc-static-method/TestObjCStaticMethod.py +++ lldb/trunk/test/lang/objc/objc-static-method/TestObjCStaticMethod.py @@ -21,7 +21,7 @@ self.break_line = line_number(self.main_source, '// Set breakpoint here.') @skipUnlessDarwin - @python_api_test + @add_test_categories(['pyapi']) # "expression" can't call functions in class methods def test_with_python_api(self): """Test calling functions in static methods.""" Index: lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py =================================================================== --- lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py +++ lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py @@ -28,7 +28,7 @@ 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() Index: lldb/trunk/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py =================================================================== --- lldb/trunk/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py +++ lldb/trunk/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py @@ -21,7 +21,7 @@ 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() Index: lldb/trunk/test/lang/objc/objc-struct-return/TestObjCStructReturn.py =================================================================== --- lldb/trunk/test/lang/objc/objc-struct-return/TestObjCStructReturn.py +++ lldb/trunk/test/lang/objc/objc-struct-return/TestObjCStructReturn.py @@ -21,7 +21,7 @@ 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() Index: lldb/trunk/test/lang/objc/objc-super/TestObjCSuper.py =================================================================== --- lldb/trunk/test/lang/objc/objc-super/TestObjCSuper.py +++ lldb/trunk/test/lang/objc/objc-super/TestObjCSuper.py @@ -22,7 +22,7 @@ @skipUnlessDarwin @expectedFailurei386 - @python_api_test + @add_test_categories(['pyapi']) def test_with_python_api(self): """Test calling methods on super.""" self.build() Index: lldb/trunk/test/lldbtest.py =================================================================== --- lldb/trunk/test/lldbtest.py +++ lldb/trunk/test/lldbtest.py @@ -49,6 +49,7 @@ 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 @@ # # 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 @@ # 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 @@ 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 @@ 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 @@ 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) Index: lldb/trunk/test/macosx/indirect_symbol/TestIndirectSymbols.py =================================================================== --- lldb/trunk/test/macosx/indirect_symbol/TestIndirectSymbols.py +++ lldb/trunk/test/macosx/indirect_symbol/TestIndirectSymbols.py @@ -20,7 +20,7 @@ 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() Index: lldb/trunk/test/macosx/queues/TestQueues.py =================================================================== --- lldb/trunk/test/macosx/queues/TestQueues.py +++ lldb/trunk/test/macosx/queues/TestQueues.py @@ -15,7 +15,7 @@ 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.""" Index: lldb/trunk/test/macosx/safe-to-func-call/TestSafeFuncCalls.py =================================================================== --- lldb/trunk/test/macosx/safe-to-func-call/TestSafeFuncCalls.py +++ lldb/trunk/test/macosx/safe-to-func-call/TestSafeFuncCalls.py @@ -20,7 +20,7 @@ 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() Index: lldb/trunk/test/macosx/universal/TestUniversal.py =================================================================== --- lldb/trunk/test/macosx/universal/TestUniversal.py +++ lldb/trunk/test/macosx/universal/TestUniversal.py @@ -20,7 +20,7 @@ # 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") Index: lldb/trunk/test/python_api/breakpoint/TestBreakpointAPI.py =================================================================== --- lldb/trunk/test/python_api/breakpoint/TestBreakpointAPI.py +++ lldb/trunk/test/python_api/breakpoint/TestBreakpointAPI.py @@ -15,7 +15,7 @@ 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() Index: lldb/trunk/test/python_api/class_members/TestSBTypeClassMembers.py =================================================================== --- lldb/trunk/test/python_api/class_members/TestSBTypeClassMembers.py +++ lldb/trunk/test/python_api/class_members/TestSBTypeClassMembers.py @@ -25,7 +25,7 @@ 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} Index: lldb/trunk/test/python_api/debugger/TestDebuggerAPI.py =================================================================== --- lldb/trunk/test/python_api/debugger/TestDebuggerAPI.py +++ lldb/trunk/test/python_api/debugger/TestDebuggerAPI.py @@ -11,7 +11,7 @@ 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 @@ 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() Index: lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py =================================================================== --- lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py +++ lldb/trunk/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py @@ -24,7 +24,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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() Index: lldb/trunk/test/python_api/disassemble-raw-data/TestDisassembleRawData.py =================================================================== --- lldb/trunk/test/python_api/disassemble-raw-data/TestDisassembleRawData.py +++ lldb/trunk/test/python_api/disassemble-raw-data/TestDisassembleRawData.py @@ -15,7 +15,7 @@ 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.""" Index: lldb/trunk/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py =================================================================== --- lldb/trunk/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py +++ lldb/trunk/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py @@ -16,7 +16,7 @@ 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.""" Index: lldb/trunk/test/python_api/event/TestEvents.py =================================================================== --- lldb/trunk/test/python_api/event/TestEvents.py +++ lldb/trunk/test/python_api/event/TestEvents.py @@ -21,7 +21,7 @@ # 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 @@ # 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 @@ "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): Index: lldb/trunk/test/python_api/findvalue_duplist/TestSBFrameFindValue.py =================================================================== --- lldb/trunk/test/python_api/findvalue_duplist/TestSBFrameFindValue.py +++ lldb/trunk/test/python_api/findvalue_duplist/TestSBFrameFindValue.py @@ -13,7 +13,7 @@ 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() Index: lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py =================================================================== --- lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py +++ lldb/trunk/test/python_api/formatters/TestFormattersSBAPI.py @@ -18,7 +18,7 @@ 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 @@ 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'}) Index: lldb/trunk/test/python_api/frame/TestFrames.py =================================================================== --- lldb/trunk/test/python_api/frame/TestFrames.py +++ lldb/trunk/test/python_api/frame/TestFrames.py @@ -16,7 +16,7 @@ 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 @@ 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 @@ frame.EvaluateExpression(None) - @python_api_test + @add_test_categories(['pyapi']) def test_frame_api_IsEqual(self): """Exercise SBFrame API IsEqual.""" self.build() Index: lldb/trunk/test/python_api/frame/inlines/TestInlinedFrame.py =================================================================== --- lldb/trunk/test/python_api/frame/inlines/TestInlinedFrame.py +++ lldb/trunk/test/python_api/frame/inlines/TestInlinedFrame.py @@ -23,7 +23,7 @@ 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() Index: lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py =================================================================== --- lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py +++ lldb/trunk/test/python_api/function_symbol/TestDisasmAPI.py @@ -22,7 +22,7 @@ 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() Index: lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py =================================================================== --- lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py +++ lldb/trunk/test/python_api/function_symbol/TestSymbolAPI.py @@ -22,7 +22,7 @@ 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.""" Index: lldb/trunk/test/python_api/hello_world/TestHelloWorld.py =================================================================== --- lldb/trunk/test/python_api/hello_world/TestHelloWorld.py +++ lldb/trunk/test/python_api/hello_world/TestHelloWorld.py @@ -29,7 +29,7 @@ # 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 @@ # 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 @@ 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): Index: lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.py =================================================================== --- lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.py +++ lldb/trunk/test/python_api/interpreter/TestCommandInterpreterAPI.py @@ -18,7 +18,7 @@ # 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() Index: lldb/trunk/test/python_api/lldbutil/frame/TestFrameUtils.py =================================================================== --- lldb/trunk/test/python_api/lldbutil/frame/TestFrameUtils.py +++ lldb/trunk/test/python_api/lldbutil/frame/TestFrameUtils.py @@ -21,7 +21,7 @@ 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() Index: lldb/trunk/test/python_api/lldbutil/iter/TestLLDBIterator.py =================================================================== --- lldb/trunk/test/python_api/lldbutil/iter/TestLLDBIterator.py +++ lldb/trunk/test/python_api/lldbutil/iter/TestLLDBIterator.py @@ -22,7 +22,7 @@ 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 @@ 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 @@ 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() Index: lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py =================================================================== --- lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py +++ lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py @@ -21,7 +21,7 @@ # 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().""" Index: lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py =================================================================== --- lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py +++ lldb/trunk/test/python_api/lldbutil/process/TestPrintStackTraces.py @@ -23,7 +23,7 @@ @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() Index: lldb/trunk/test/python_api/module_section/TestModuleAndSection.py =================================================================== --- lldb/trunk/test/python_api/module_section/TestModuleAndSection.py +++ lldb/trunk/test/python_api/module_section/TestModuleAndSection.py @@ -16,7 +16,7 @@ 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 @@ 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 @@ 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() Index: lldb/trunk/test/python_api/objc_type/TestObjCType.py =================================================================== --- lldb/trunk/test/python_api/objc_type/TestObjCType.py +++ lldb/trunk/test/python_api/objc_type/TestObjCType.py @@ -21,7 +21,7 @@ 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() Index: lldb/trunk/test/python_api/process/TestProcessAPI.py =================================================================== --- lldb/trunk/test/python_api/process/TestProcessAPI.py +++ lldb/trunk/test/python_api/process/TestProcessAPI.py @@ -21,7 +21,7 @@ # 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 @@ 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 @@ 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 @@ 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 @@ 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() Index: lldb/trunk/test/python_api/process/io/TestProcessIO.py =================================================================== --- lldb/trunk/test/python_api/process/io/TestProcessIO.py +++ lldb/trunk/test/python_api/process/io/TestProcessIO.py @@ -28,7 +28,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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() Index: lldb/trunk/test/python_api/sbdata/TestSBData.py =================================================================== --- lldb/trunk/test/python_api/sbdata/TestSBData.py +++ lldb/trunk/test/python_api/sbdata/TestSBData.py @@ -20,7 +20,7 @@ # 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() Index: lldb/trunk/test/python_api/sbvalue_persist/TestSBValuePersist.py =================================================================== --- lldb/trunk/test/python_api/sbvalue_persist/TestSBValuePersist.py +++ lldb/trunk/test/python_api/sbvalue_persist/TestSBValuePersist.py @@ -13,7 +13,7 @@ mydir = TestBase.compute_mydir(__file__) - @python_api_test + @add_test_categories(['pyapi']) @expectedFailureWindows("llvm.org/pr24772") def test(self): """Test SBValue::Persist""" Index: lldb/trunk/test/python_api/section/TestSectionAPI.py =================================================================== --- lldb/trunk/test/python_api/section/TestSectionAPI.py +++ lldb/trunk/test/python_api/section/TestSectionAPI.py @@ -12,7 +12,7 @@ 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) Index: lldb/trunk/test/python_api/signals/TestSignalsAPI.py =================================================================== --- lldb/trunk/test/python_api/signals/TestSignalsAPI.py +++ lldb/trunk/test/python_api/signals/TestSignalsAPI.py @@ -14,7 +14,7 @@ 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): Index: lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py =================================================================== --- lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py +++ lldb/trunk/test/python_api/symbol-context/TestSymbolContext.py @@ -21,7 +21,7 @@ # 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.""" Index: lldb/trunk/test/python_api/target/TestTargetAPI.py =================================================================== --- lldb/trunk/test/python_api/target/TestTargetAPI.py +++ lldb/trunk/test/python_api/target/TestTargetAPI.py @@ -31,7 +31,7 @@ # 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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) Index: lldb/trunk/test/python_api/thread/TestThreadAPI.py =================================================================== --- lldb/trunk/test/python_api/thread/TestThreadAPI.py +++ lldb/trunk/test/python_api/thread/TestThreadAPI.py @@ -15,19 +15,19 @@ 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 @@ 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 @@ 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. Index: lldb/trunk/test/python_api/type/TestTypeList.py =================================================================== --- lldb/trunk/test/python_api/type/TestTypeList.py +++ lldb/trunk/test/python_api/type/TestTypeList.py @@ -24,7 +24,7 @@ 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} Index: lldb/trunk/test/python_api/value/TestValueAPI.py =================================================================== --- lldb/trunk/test/python_api/value/TestValueAPI.py +++ lldb/trunk/test/python_api/value/TestValueAPI.py @@ -24,7 +24,7 @@ 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} Index: lldb/trunk/test/python_api/value/change_values/TestChangeValueAPI.py =================================================================== --- lldb/trunk/test/python_api/value/change_values/TestChangeValueAPI.py +++ lldb/trunk/test/python_api/value/change_values/TestChangeValueAPI.py @@ -26,7 +26,7 @@ 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} Index: lldb/trunk/test/python_api/value/linked_list/TestValueAPILinkedList.py =================================================================== --- lldb/trunk/test/python_api/value/linked_list/TestValueAPILinkedList.py +++ lldb/trunk/test/python_api/value/linked_list/TestValueAPILinkedList.py @@ -24,7 +24,7 @@ # 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} Index: lldb/trunk/test/python_api/value_var_update/TestValueVarUpdate.py =================================================================== --- lldb/trunk/test/python_api/value_var_update/TestValueVarUpdate.py +++ lldb/trunk/test/python_api/value_var_update/TestValueVarUpdate.py @@ -20,7 +20,7 @@ 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) Index: lldb/trunk/test/python_api/watchpoint/TestSetWatchpoint.py =================================================================== --- lldb/trunk/test/python_api/watchpoint/TestSetWatchpoint.py +++ lldb/trunk/test/python_api/watchpoint/TestSetWatchpoint.py @@ -23,7 +23,7 @@ # 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): Index: lldb/trunk/test/python_api/watchpoint/TestWatchpointIgnoreCount.py =================================================================== --- lldb/trunk/test/python_api/watchpoint/TestWatchpointIgnoreCount.py +++ lldb/trunk/test/python_api/watchpoint/TestWatchpointIgnoreCount.py @@ -23,7 +23,7 @@ # 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): Index: lldb/trunk/test/python_api/watchpoint/TestWatchpointIter.py =================================================================== --- lldb/trunk/test/python_api/watchpoint/TestWatchpointIter.py +++ lldb/trunk/test/python_api/watchpoint/TestWatchpointIter.py @@ -23,7 +23,7 @@ # 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): Index: lldb/trunk/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py =================================================================== --- lldb/trunk/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py +++ lldb/trunk/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py @@ -25,7 +25,7 @@ # 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): Index: lldb/trunk/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py =================================================================== --- lldb/trunk/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py +++ lldb/trunk/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py @@ -25,7 +25,7 @@ # 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 @@ # 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): Index: lldb/trunk/test/source-manager/TestSourceManager.py =================================================================== --- lldb/trunk/test/source-manager/TestSourceManager.py +++ lldb/trunk/test/source-manager/TestSourceManager.py @@ -28,7 +28,7 @@ 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() Index: lldb/trunk/test/test_categories.py =================================================================== --- lldb/trunk/test/test_categories.py +++ lldb/trunk/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