[Lldb-commits] [PATCH] D139463: Fix breakpoint-command.test when no script interpreter is compiled in.
Mitch Phillips via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Dec 6 14:26:39 PST 2022
hctim created this revision.
hctim added reviewers: JDevlieghere, labath.
Herald added a project: All.
hctim requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
My local build is with -DLLVM_ENABLE_PROJECTS=lldb, but I don't compile
with -DLLDB_ENABLE_PYTHON=True or -DLLDB_ENABLE_LUA=True. This results
in there being no script interpreter.
The test lldb/test/Shell/Breakpoint/breakpoint-command.test has an
implicit dependency on a script interpreter being available.
This patch makes that dependency clear. If you have a script
interpreter, the test gets run, otherwise it gets skipped. This means
that folks (like me) who naively use -DLLVM_ENABLE_PROJECTS=lldb can
continue to run check-all without breakages.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D139463
Files:
lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
lldb/test/CMakeLists.txt
lldb/test/Shell/Breakpoint/breakpoint-command.test
lldb/test/Shell/lit.cfg.py
lldb/test/Shell/lit.site.cfg.py.in
Index: lldb/test/Shell/lit.site.cfg.py.in
===================================================================
--- lldb/test/Shell/lit.site.cfg.py.in
+++ lldb/test/Shell/lit.site.cfg.py.in
@@ -28,6 +28,8 @@
config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell")
config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-shell")
+config.has_script_interpreter = @LLDB_HAS_SCRIPT_INTERPRETER@
+
import lit.llvm
lit.llvm.initialize(lit_config, config)
Index: lldb/test/Shell/lit.cfg.py
===================================================================
--- lldb/test/Shell/lit.cfg.py
+++ lldb/test/Shell/lit.cfg.py
@@ -135,6 +135,9 @@
if config.have_lldb_server:
config.available_features.add('lldb-server')
+if config.has_script_interpreter:
+ config.available_features.add('script-interpreter')
+
# NetBSD permits setting dbregs either if one is root
# or if user_set_dbregs is enabled
can_set_dbregs = True
Index: lldb/test/Shell/Breakpoint/breakpoint-command.test
===================================================================
--- lldb/test/Shell/Breakpoint/breakpoint-command.test
+++ lldb/test/Shell/Breakpoint/breakpoint-command.test
@@ -1,3 +1,4 @@
+# REQUIRES: script-interpreter
# RUN: %build %p/Inputs/dummy-target.c -o %t.out
# RUN: %lldb %t.out -o 'b main' -o 'break command add 1 -o "script print(95000 + 126)"' -o 'r' | FileCheck %s
Index: lldb/test/CMakeLists.txt
===================================================================
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -177,7 +177,8 @@
LLDB_HAS_LIBCXX
LLDB_TOOL_LLDB_SERVER_BUILD
LLDB_USE_SYSTEM_DEBUGSERVER
- LLDB_IS_64_BITS)
+ LLDB_IS_64_BITS
+ LLDB_HAS_SCRIPT_INTERPRETER)
# Configure the individual test suites.
add_subdirectory(API)
Index: lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
+++ lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
@@ -1,8 +1,11 @@
+set(LLDB_HAS_SCRIPT_INTERPRETER FALSE)
add_subdirectory(None)
if (LLDB_ENABLE_PYTHON)
+ set(LLDB_HAS_SCRIPT_INTERPRETER TRUE)
add_subdirectory(Python)
endif()
if (LLDB_ENABLE_LUA)
+ set(LLDB_HAS_SCRIPT_INTERPRETER TRUE)
add_subdirectory(Lua)
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139463.480623.patch
Type: text/x-patch
Size: 2352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221206/04be5712/attachment.bin>
More information about the lldb-commits
mailing list