|
|
@ -104,6 +104,16 @@ function delay(frames)
|
|
|
|
script.sleep(frames, 'frames')
|
|
|
|
script.sleep(frames, 'frames')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function clean_require(module)
|
|
|
|
|
|
|
|
-- wrapper around require() - forces a clean load of every module to ensure
|
|
|
|
|
|
|
|
-- that modules checking for dfhack.internal.IN_TEST at load time behave
|
|
|
|
|
|
|
|
-- properly
|
|
|
|
|
|
|
|
if package.loaded[module] then
|
|
|
|
|
|
|
|
reload(module)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return require(module)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function ensure_title_screen()
|
|
|
|
function ensure_title_screen()
|
|
|
|
if df.viewscreen_titlest:is_instance(dfhack.gui.getCurViewscreen()) then
|
|
|
|
if df.viewscreen_titlest:is_instance(dfhack.gui.getCurViewscreen()) then
|
|
|
|
return
|
|
|
|
return
|
|
|
@ -153,6 +163,7 @@ function build_test_env()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expect = {},
|
|
|
|
expect = {},
|
|
|
|
delay = delay,
|
|
|
|
delay = delay,
|
|
|
|
|
|
|
|
require = clean_require,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
local private = {
|
|
|
|
local private = {
|
|
|
|
checks = 0,
|
|
|
|
checks = 0,
|
|
|
|