Skip to content

Commit 04eab84

Browse files
committed
Pass the Lua cpath to TestLuaAPI
1 parent 4858c85 commit 04eab84

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

lldb/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ endif()
137137

138138
if (LLDB_ENABLE_LUA)
139139
if(LLDB_BUILD_FRAMEWORK)
140-
set(lldb_lua_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Lua")
140+
set(LLDB_LUA_CPATH "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Lua")
141141
else()
142-
set(lldb_lua_target_dir "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_LUA_RELATIVE_PATH}")
142+
set(LLDB_LUA_CPATH "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_LUA_RELATIVE_PATH}")
143143
endif()
144144
get_target_property(lldb_lua_bindings_dir swig_wrapper_lua BINARY_DIR)
145-
finish_swig_lua("lldb-lua" "${lldb_lua_bindings_dir}" "${lldb_lua_target_dir}")
145+
finish_swig_lua("lldb-lua" "${lldb_lua_bindings_dir}" "${LLDB_LUA_CPATH}")
146146
endif()
147147

148148
set(LLDB_INCLUDE_UNITTESTS ON)

lldb/test/API/lit.site.cfg.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ config.target_triple = "@LLVM_TARGET_TRIPLE@"
2121
config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
2222
config.python_executable = "@Python3_EXECUTABLE@"
2323
config.lua_executable = "@LUA_EXECUTABLE@"
24+
config.lldb_lua_cpath = "@LLDB_LUA_CPATH@"
2425
config.lua_test_entry = "TestLuaAPI.py"
2526
config.dotest_common_args_str = lit_config.substitute("@LLDB_TEST_COMMON_ARGS@")
2627
config.dotest_user_args_str = lit_config.substitute("@LLDB_TEST_USER_ARGS@")

lldb/test/API/lldbtest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def execute(self, test, litConfig):
5656
cmd = [executable] + self.dotest_cmd + [testPath, "-p", testFile]
5757

5858
if isLuaTest:
59-
luaExecutable = test.config.lua_executable
60-
cmd.extend(["--env", "LUA_EXECUTABLE=%s" % luaExecutable])
59+
cmd.extend(["--env", "LUA_EXECUTABLE=%s" % test.config.lua_executable])
60+
cmd.extend(["--env", "LLDB_LUA_CPATH=%s" % test.config.lldb_lua_cpath])
6161

6262
timeoutInfo = None
6363
try:

lldb/test/API/lua_api/TestLuaAPI.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,14 @@ def test_lua_api(self):
162162
self.skipTest("Lua API tests could not find Lua executable.")
163163
return
164164
lua_executable = os.environ["LUA_EXECUTABLE"]
165+
lldb_lua_cpath = os.environ["LLDB_LUA_CPATH"]
165166

166167
self.build()
167168
test_exe = self.getBuildArtifact("a.out")
168169
test_output = self.getBuildArtifact("output")
169170
test_input = self.getBuildArtifact("input")
170171

171-
lua_lldb_cpath = "%s/lua/5.3/?.so" % configuration.lldb_libs_dir
172-
173-
lua_prelude = "package.cpath = '%s;' .. package.cpath" % lua_lldb_cpath
172+
lua_prelude = "package.cpath = '%s/?.so;' .. package.cpath" % lldb_lua_cpath
174173

175174
lua_env = {
176175
"TEST_EXE": os.path.join(self.getBuildDir(), test_exe),

0 commit comments

Comments
 (0)