mirror of
https://github.com/neovim/neovim.git
synced 2025-11-06 02:34:28 +00:00
unittests: Log syscalls if requested
This commit is contained in:
@@ -343,6 +343,29 @@ else
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function format_list(lst)
|
||||||
|
local ret = ''
|
||||||
|
for _, v in ipairs(lst) do
|
||||||
|
if ret ~= '' then ret = ret .. ', ' end
|
||||||
|
ret = ret .. assert:format({v, n=1})[1]
|
||||||
|
end
|
||||||
|
return ret
|
||||||
|
end
|
||||||
|
|
||||||
|
if os.getenv('NVIM_TEST_PRINT_SYSCALLS') == '1' then
|
||||||
|
for k_, v_ in pairs(sc) do
|
||||||
|
(function(k, v)
|
||||||
|
local f = sc[k]
|
||||||
|
sc[k] = function(...)
|
||||||
|
local rets = {f(...)}
|
||||||
|
io.stderr:write(('%s(%s) = %s\n'):format(k, format_list({...}),
|
||||||
|
format_list(rets)))
|
||||||
|
return unpack(rets)
|
||||||
|
end
|
||||||
|
end)(k_, v_)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local function gen_itp(it)
|
local function gen_itp(it)
|
||||||
local function just_fail(_)
|
local function just_fail(_)
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user