[Lldb-commits] [lldb] bba6bc6 - [lldb][test] skip Lua tests when the Lua interpreter is not found (#164793)

via lldb-commits lldb-commits at lists.llvm.org
Sat Oct 25 18:27:34 PDT 2025


Author: Vincent Palatin
Date: 2025-10-25T18:27:30-07:00
New Revision: bba6bc671b23ee10212efd6d6cf8cbfa21410105

URL: https://github.com/llvm/llvm-project/commit/bba6bc671b23ee10212efd6d6cf8cbfa21410105
DIFF: https://github.com/llvm/llvm-project/commit/bba6bc671b23ee10212efd6d6cf8cbfa21410105.diff

LOG: [lldb][test] skip Lua tests when the Lua interpreter is not found (#164793)

When SWIG is installed but not any Lua interpreter, the cmake script in
`lldb/cmake/modules/FindLuaAndSwig.cmake` will execute
`find_program(LUA_EXECUTABLE, ...)` and this will set the
`LUA_EXECUTABLE` variable to `LUA_EXECUTABLE-NOTFOUND`.

Ensure that in this case we are skipping the Lua tests requiring the
interpreter.

Added: 
    

Modified: 
    lldb/cmake/modules/FindLuaAndSwig.cmake
    lldb/test/API/lua_api/TestLuaAPI.py

Removed: 
    


################################################################################
diff  --git a/lldb/cmake/modules/FindLuaAndSwig.cmake b/lldb/cmake/modules/FindLuaAndSwig.cmake
index 33fadb2a09740..c5df29e8d0a92 100644
--- a/lldb/cmake/modules/FindLuaAndSwig.cmake
+++ b/lldb/cmake/modules/FindLuaAndSwig.cmake
@@ -34,6 +34,7 @@ else()
                                     FOUND_VAR
                                       LUAANDSWIG_FOUND
                                     REQUIRED_VARS
+                                      LUA_EXECUTABLE
                                       LUA_LIBRARIES
                                       LUA_INCLUDE_DIR
                                       LUA_VERSION_MINOR

diff  --git a/lldb/test/API/lua_api/TestLuaAPI.py b/lldb/test/API/lua_api/TestLuaAPI.py
index 4ac795d696425..e78ed9de72375 100644
--- a/lldb/test/API/lua_api/TestLuaAPI.py
+++ b/lldb/test/API/lua_api/TestLuaAPI.py
@@ -158,7 +158,9 @@ def get_tests(self):
         return tests
 
     def test_lua_api(self):
-        if "LUA_EXECUTABLE" not in os.environ or len(os.environ["LUA_EXECUTABLE"]) == 0:
+        if "LUA_EXECUTABLE" not in os.environ or not os.path.exists(
+            os.environ["LUA_EXECUTABLE"]
+        ):
             self.skipTest("Lua API tests could not find Lua executable.")
             return
         lua_executable = os.environ["LUA_EXECUTABLE"]


        


More information about the lldb-commits mailing list