|
|
@ -3,28 +3,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
local runner = require('luacov.runner')
|
|
|
|
local runner = require('luacov.runner')
|
|
|
|
|
|
|
|
|
|
|
|
print('runner.debug_hook:', runner.debug_hook)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function init()
|
|
|
|
|
|
|
|
runner.init()
|
|
|
|
|
|
|
|
print('** initializing luacov')
|
|
|
|
|
|
|
|
print('** set debug hook to:', debug.gethook())
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Called by LuaTools.cpp to set the debug hook for new threads. We could do
|
|
|
|
-- Called by LuaTools.cpp to set the debug hook for new threads. We could do
|
|
|
|
-- this in C++, but that's complicated and scary.
|
|
|
|
-- this in C++, but that's complicated and scary.
|
|
|
|
function with_luacov(f)
|
|
|
|
function with_luacov(f)
|
|
|
|
print('** wrapping function', f)
|
|
|
|
|
|
|
|
return function(...)
|
|
|
|
return function(...)
|
|
|
|
print('** setting debug hook')
|
|
|
|
|
|
|
|
print('** was:', debug.gethook())
|
|
|
|
|
|
|
|
debug.sethook(runner.debug_hook, "l")
|
|
|
|
debug.sethook(runner.debug_hook, "l")
|
|
|
|
print('** is now:', debug.gethook())
|
|
|
|
|
|
|
|
print('** running function:', f)
|
|
|
|
|
|
|
|
print('** params:', ...)
|
|
|
|
|
|
|
|
return f(...)
|
|
|
|
return f(...)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return _ENV
|
|
|
|
return _ENV
|
|
|
|