From f6769ae1760ce3a4ccc2d4a843fcded748d8b0ec Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Sat, 24 Feb 2018 00:17:04 +0000 Subject: [PATCH] [unittests] Disable lldb-server tests if an external debug server is in use The lldb-server unit tests don't test the right thing when the debug server in use is copied from somewhere else. This can lead to spurious test failures. Disable these unit tests when an external debug server is in use. Fixes llvm.org/PR36494. llvm-svn: 326001 --- lldb/tools/debugserver/source/CMakeLists.txt | 5 +++-- lldb/unittests/tools/CMakeLists.txt | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lldb/tools/debugserver/source/CMakeLists.txt b/lldb/tools/debugserver/source/CMakeLists.txt index 5e567d5..63d3dc9 100644 --- a/lldb/tools/debugserver/source/CMakeLists.txt +++ b/lldb/tools/debugserver/source/CMakeLists.txt @@ -100,6 +100,7 @@ set(LLDB_CODESIGN_IDENTITY "lldb_codesign" if(NOT LLDB_CODESIGN_IDENTITY STREQUAL "") set(DEBUGSERVER_PATH $ CACHE PATH "Path to debugserver.") + set(SKIP_DEBUGSERVER OFF CACHE BOOL "Skip building the in-tree debug server") else() execute_process( COMMAND xcode-select -p @@ -107,7 +108,7 @@ else() string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR) set(DEBUGSERVER_PATH "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver" CACHE PATH "Path to debugserver.") - set(SKIP_DEBUGSERVER True) + set(SKIP_DEBUGSERVER ON CACHE BOOL "Skip building the in-tree debug server") endif() message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}") @@ -124,7 +125,7 @@ if (APPLE) find_library(LOCKDOWN_LIBRARY lockdown) if(NOT BACKBOARD_LIBRARY) - set(SKIP_DEBUGSERVER True) + set(SKIP_DEBUGSERVER ON CACHE BOOL "Skip building the in-tree debug server" FORCE) endif() else() find_library(COCOA_LIBRARY Cocoa) diff --git a/lldb/unittests/tools/CMakeLists.txt b/lldb/unittests/tools/CMakeLists.txt index e381621..e4fc3e6 100644 --- a/lldb/unittests/tools/CMakeLists.txt +++ b/lldb/unittests/tools/CMakeLists.txt @@ -1,3 +1,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|Linux|NetBSD") - add_subdirectory(lldb-server) + if (CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_DEBUGSERVER) + # These tests are meant to test lldb-server/debugserver in isolation, and + # don't provide any value if run against a server copied from somewhere. + else() + add_subdirectory(lldb-server) + endif() endif() -- 2.7.4