[LLDB] Only run lldb-server Shell tests if it gets built
authorAlex Langford <apl@fb.com>
Wed, 12 Oct 2022 23:01:07 +0000 (16:01 -0700)
committerAlex Langford <apl@fb.com>
Fri, 14 Oct 2022 19:00:57 +0000 (12:00 -0700)
It's easy enough to disable the lldb-server build. The lldb-server unit
tests already have logic to disable them if we don't build, so this just
makes it even.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D135825

lldb/test/CMakeLists.txt
lldb/test/Shell/lit.cfg.py
lldb/test/Shell/lit.site.cfg.py.in
lldb/test/Shell/lldb-server/lit.local.cfg [new file with mode: 0644]

index 64a9082..17572f9 100644 (file)
@@ -167,6 +167,7 @@ llvm_canonicalize_cmake_booleans(
   LLVM_ENABLE_ZLIB
   LLVM_ENABLE_SHARED_LIBS
   LLDB_HAS_LIBCXX
+  LLDB_TOOL_LLDB_SERVER_BUILD
   LLDB_USE_SYSTEM_DEBUGSERVER
   LLDB_IS_64_BITS)
 
index 9fd206b..7717400 100644 (file)
@@ -132,6 +132,9 @@ if shutil.which('xz') != None:
 if config.lldb_system_debugserver:
     config.available_features.add('system-debugserver')
 
+if config.have_lldb_server:
+    config.available_features.add('lldb-server')
+
 # NetBSD permits setting dbregs either if one is root
 # or if user_set_dbregs is enabled
 can_set_dbregs = True
index 29d309c..d58918c 100644 (file)
@@ -22,6 +22,7 @@ config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
 config.lldb_enable_python = @LLDB_ENABLE_PYTHON@
 config.lldb_enable_lua = @LLDB_ENABLE_LUA@
 config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
+config.have_lldb_server = @LLDB_TOOL_LLDB_SERVER_BUILD@
 config.lldb_system_debugserver = @LLDB_USE_SYSTEM_DEBUGSERVER@
 # The shell tests use their own module caches.
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell")
diff --git a/lldb/test/Shell/lldb-server/lit.local.cfg b/lldb/test/Shell/lldb-server/lit.local.cfg
new file mode 100644 (file)
index 0000000..6ede36a
--- /dev/null
@@ -0,0 +1,3 @@
+# These tests rely on lldb-server
+if not config.have_lldb_server:
+    config.unsupported = True