From: Pavel Labath Date: Thu, 10 Dec 2020 13:52:20 +0000 (+0100) Subject: [lldb/test] Replace ad-hoc server test choice with test categories X-Git-Tag: llvmorg-13-init~3781 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db8420825073371ddc077b020634e71e315e38a1;p=platform%2Fupstream%2Fllvm.git [lldb/test] Replace ad-hoc server test choice with test categories This makes things consistent, and enables further simplifications down the road. --- diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py b/lldb/packages/Python/lldbsuite/test/decorators.py index bcf665f..ff445fa 100644 --- a/lldb/packages/Python/lldbsuite/test/decorators.py +++ b/lldb/packages/Python/lldbsuite/test/decorators.py @@ -373,20 +373,12 @@ def apple_simulator_test(platform): 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 64a1978..86ea34e 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 699fcf4..9f1196e 100644 --- a/lldb/packages/Python/lldbsuite/test/test_categories.py +++ b/lldb/packages/Python/lldbsuite/test/test_categories.py @@ -23,6 +23,7 @@ all_categories = { '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 @@ all_categories = { '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',