Author: Pavel Labath Date: 2020-12-10T16:21:28+01:00 New Revision: db8420825073371ddc077b020634e71e315e38a1
URL: https://github.com/llvm/llvm-project/commit/db8420825073371ddc077b020634e71e315e38a1 DIFF: https://github.com/llvm/llvm-project/commit/db8420825073371ddc077b020634e71e315e38a1.diff LOG: [lldb/test] Replace ad-hoc server test choice with test categories This makes things consistent, and enables further simplifications down the road. Added: Modified: lldb/packages/Python/lldbsuite/test/decorators.py lldb/packages/Python/lldbsuite/test/dotest.py lldb/packages/Python/lldbsuite/test/test_categories.py Removed: ################################################################################ diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py index bcf665f6cc4c..ff445fa0b926 100644 --- a/lldb/packages/Python/lldbsuite/test/decorators.py +++ b/lldb/packages/Python/lldbsuite/test/decorators.py @@ -373,20 +373,12 @@ def should_skip_simulator_test(): def debugserver_test(func): """Decorate the item as a debugserver test.""" - def should_skip_debugserver_test(): - return ("debugserver tests" - if not configuration.debugserver_platform - else None) - return skipTestIfFn(should_skip_debugserver_test)(func) + return add_test_categories(["debugserver"])(func) def llgs_test(func): """Decorate the item as a lldb-server test.""" - def should_skip_llgs_tests(): - return ("llgs tests" - if not configuration.llgs_platform - else None) - return skipTestIfFn(should_skip_llgs_tests)(func) + return add_test_categories(["llgs"])(func) def expectedFailureOS( diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index 64a197872f9e..86ea34ee2582 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -850,6 +850,14 @@ def checkDebugInfoSupport(): if skipped: print("Skipping following debug info categories:", skipped) +def checkDebugServerSupport(): + from lldbsuite.test import lldbplatformutil + + if lldbplatformutil.platformIsDarwin(): + configuration.skip_categories.append("llgs") + else: + configuration.skip_categories.append("debugserver") + def run_suite(): # On MacOS X, check to make sure that domain for com.apple.DebugSymbols defaults # does not exist before proceeding to running the test suite. @@ -944,15 +952,9 @@ def run_suite(): checkLibstdcxxSupport() checkWatchpointSupport() checkDebugInfoSupport() + checkDebugServerSupport() checkObjcSupport() - # Perform LLGS tests only on platforms using it. - configuration.llgs_platform = ( - target_platform in ["freebsd", "linux", "netbsd", "windows"]) - - # Perform debugserver tests elsewhere (i.e. on Darwin platforms). - configuration.debugserver_platform = not configuration.llgs_platform - for testdir in configuration.testdirs: for (dirpath, dirnames, filenames) in os.walk(testdir): visit('Test', dirpath, filenames) diff --git a/lldb/packages/Python/lldbsuite/test/test_categories.py b/lldb/packages/Python/lldbsuite/test/test_categories.py index 699fcf4cb887..9f1196ea6497 100644 --- a/lldb/packages/Python/lldbsuite/test/test_categories.py +++ b/lldb/packages/Python/lldbsuite/test/test_categories.py @@ -23,6 +23,7 @@ 'cmdline': 'Tests related to the LLDB command-line interface', 'darwin-log': 'Darwin log tests', 'dataformatters': 'Tests related to the type command and the data formatters subsystem', + 'debugserver': 'Debugserver tests', 'dsym': 'Tests that can be run with DSYM debug information', 'dwarf': 'Tests that can be run with DWARF debug information', 'dwo': 'Tests that can be run with DWO debug information', @@ -35,6 +36,7 @@ 'libstdcxx': 'Test for libstdcxx data formatters', 'lldb-server': 'Tests related to lldb-server', 'lldb-vscode': 'Visual Studio Code debug adaptor tests', + 'llgs': 'Tests for the gdb-server functionality of lldb-server', 'objc': 'Tests related to the Objective-C programming language support', 'pyapi': 'Tests related to the Python API', 'std-module': 'Tests related to importing the std module', _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits