[Lldb-commits] [lldb] r327052 - [test] Skip a test when using an out-of-tree debugserver

Vedant Kumar via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 8 11:46:39 PST 2018


Author: vedantk
Date: Thu Mar  8 11:46:39 2018
New Revision: 327052

URL: http://llvm.org/viewvc/llvm-project?rev=327052&view=rev
Log:
[test] Skip a test when using an out-of-tree debugserver

The test "test_fp_special_purpose_register_read" in TestRegisters.py
fails on Darwin machines configured to use an out-of-tree debugserver.

The error message is: 'register read ftag' returns expected result, got
'ftag = 0x80'. This indicates that the debugserver in use is too old.

This commit introduces a decorator which can be used to skip tests which
rely on having a just-built debugserver. This resolves the issue:

$ ./bin/llvm-dotest -p TestRegisters.py -v
  1 out of 617 test suites processed - TestRegisters.py
  Test Methods:          7
  Success:               6
  Skip:                  1
...

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/decorators.py
    lldb/trunk/packages/Python/lldbsuite/test/dotest.py
    lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbtest_config.py
    lldb/trunk/test/CMakeLists.txt

Modified: lldb/trunk/packages/Python/lldbsuite/test/decorators.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/decorators.py?rev=327052&r1=327051&r2=327052&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/decorators.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/decorators.py Thu Mar  8 11:46:39 2018
@@ -22,6 +22,7 @@ import use_lldb_suite
 import lldb
 from . import configuration
 from . import test_categories
+from . import lldbtest_config
 from lldbsuite.test_event.event_builder import EventBuilder
 from lldbsuite.support import funcutils
 from lldbsuite.test import lldbplatform
@@ -476,6 +477,11 @@ def expectedFlakeyAndroid(bugnumber=None
             archs),
         bugnumber)
 
+def skipIfOutOfTreeDebugserver(func):
+    """Decorate the item to skip tests if using an out-of-tree debugserver."""
+    def is_out_of_tree_debugserver():
+        return "out-of-tree debugserver" if lldbtest_config.out_of_tree_debugserver else None
+    return skipTestIfFn(is_out_of_tree_debugserver)(func)
 
 def skipIfRemote(func):
     """Decorate the item to skip tests if testing remotely."""

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest.py?rev=327052&r1=327051&r2=327052&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/dotest.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest.py Thu Mar  8 11:46:39 2018
@@ -307,6 +307,9 @@ def parseOptionsAndInitTestdirs():
     if args.log_success:
         lldbtest_config.log_success = args.log_success
 
+    if args.out_of_tree_debugserver:
+        lldbtest_config.out_of_tree_debugserver = args.out_of_tree_debugserver
+
     # Set SDKROOT if we are using an Apple SDK
     if platform_system == 'Darwin' and args.apple_sdk:
         os.environ['SDKROOT'] = seven.get_command_output(

Modified: lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py?rev=327052&r1=327051&r2=327052&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py Thu Mar  8 11:46:39 2018
@@ -127,6 +127,11 @@ def create_parser():
         metavar='server-path',
         help='The path to the debug server executable to use')
     group.add_argument(
+        '--out-of-tree-debugserver',
+        dest='out_of_tree_debugserver',
+        action='store_true',
+        help='A flag to indicate an out-of-tree debug server is being used')
+    group.add_argument(
         '-s',
         metavar='name',
         help='Specify the name of the dir created to store the session files of tests with errored or failed status. If not specified, the test driver uses the timestamp as the session dir name')

Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py?rev=327052&r1=327051&r2=327052&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py Thu Mar  8 11:46:39 2018
@@ -69,6 +69,7 @@ class RegisterCommandsTestCase(TestBase)
     @expectedFailureAndroid(archs=["i386"])
     @skipIfFreeBSD  # llvm.org/pr25057
     @skipIf(archs=no_match(['amd64', 'i386', 'x86_64']))
+    @skipIfOutOfTreeDebugserver
     def test_fp_special_purpose_register_read(self):
         """Test commands that read fpu special purpose registers."""
         self.build()

Modified: lldb/trunk/packages/Python/lldbsuite/test/lldbtest_config.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lldbtest_config.py?rev=327052&r1=327051&r2=327052&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lldbtest_config.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lldbtest_config.py Thu Mar  8 11:46:39 2018
@@ -16,5 +16,8 @@ channels = []
 # leave logs/traces even for successful test runs
 log_success = False
 
+# Indicate whether we're testing with an out-of-tree debugserver
+out_of_tree_debugserver = False
+
 # path to the lldb command line executable tool
 lldbExec = None

Modified: lldb/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=327052&r1=327051&r2=327052&view=diff
==============================================================================
--- lldb/trunk/test/CMakeLists.txt (original)
+++ lldb/trunk/test/CMakeLists.txt Thu Mar  8 11:46:39 2018
@@ -113,6 +113,10 @@ if(CMAKE_HOST_APPLE)
   list(APPEND LLDB_TEST_COMMON_ARGS --server ${DEBUGSERVER_PATH})
 endif()
 
+if(SKIP_DEBUGSERVER)
+  list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver)
+endif()
+
 set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS})
 
 add_python_test_target(check-lldb-single




More information about the lldb-commits mailing list