Skip to content
Snippets Groups Projects
Commit ee94aa69 authored by Sergey Kaplun's avatar Sergey Kaplun Committed by Kirill Yukhin
Browse files

test: fix dynamic modules loading on macOS

Since the auxiliary libraries are built as dynamically loaded modules on
macOS instead of shared libraries as it is done on Linux and BSD,
another environment variable should be used to guide `ffi.load()` while
searching the extension. Hence the paths are set in test need to be set
to `DYLD_LIBRARY_PATH` variable instead of `LD_LIBRARY_PATH` on macOS.
parent d011dffd
No related branches found
No related tags found
No related merge requests found
......@@ -25,17 +25,19 @@ if #arg == 0 then
test:plan(#checks)
local libext = package.cpath:match('?.(%a+);')
local vars = {
LUABIN = arg[-1],
SCRIPT = arg[0],
-- To support out-of-source build use relative paths in repo
PATH = arg[-1]:gsub('src/tarantool$', 'test/app-tap'),
SUFFIX = package.cpath:match('?.(%a+);'),
SUFFIX = libext,
}
local cmd = string.gsub('LUA_CPATH="$LUA_CPATH;<PATH>/?.<SUFFIX>" ' ..
'LUA_PATH="$LUA_PATH;<PATH>/?.lua" ' ..
'LD_LIBRARY_PATH=<PATH> ' ..
((libext == 'dylib' and 'DYLD' or 'LD') ..
'_LIBRARY_PATH=<PATH> ') ..
'<LUABIN> 2>&1 <SCRIPT>', '%<(%w+)>', vars)
for _, ch in pairs(checks) do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment