Skip to content

Commit 4e9d7a6

Browse files
committed
[lldb][test] skip Lua tests when the Lua interpreter is not found
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 and the `LUAANDSWIG_FOUND` is not set.
1 parent a1e59bd commit 4e9d7a6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lldb/cmake/modules/FindLuaAndSwig.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ else()
3434
FOUND_VAR
3535
LUAANDSWIG_FOUND
3636
REQUIRED_VARS
37+
LUA_EXECUTABLE
3738
LUA_LIBRARIES
3839
LUA_INCLUDE_DIR
3940
LUA_VERSION_MINOR

lldb/test/API/lua_api/TestLuaAPI.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ def get_tests(self):
158158
return tests
159159

160160
def test_lua_api(self):
161-
if "LUA_EXECUTABLE" not in os.environ or len(os.environ["LUA_EXECUTABLE"]) == 0:
161+
if "LUA_EXECUTABLE" not in os.environ or not os.path.exists(
162+
os.environ["LUA_EXECUTABLE"]
163+
):
162164
self.skipTest("Lua API tests could not find Lua executable.")
163165
return
164166
lua_executable = os.environ["LUA_EXECUTABLE"]

0 commit comments

Comments
 (0)