mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-30 13:45:34 +00:00
Merge branch 'integration_tests_built_in' into 'master'
Enable built-in script in the integration tests See merge request OpenMW/openmw!4289
This commit is contained in:
commit
07c89c4f84
4 changed files with 13 additions and 7 deletions
|
@ -1 +0,0 @@
|
|||
# It is an empty file that overrides builtin.omwscripts and disables builtin scripts
|
|
@ -220,7 +220,7 @@ testing.registerLocalTest('findNearestNavMeshPosition',
|
|||
|
||||
return {
|
||||
engineHandlers = {
|
||||
onUpdate = testing.updateLocal,
|
||||
onFrame = testing.updateLocal,
|
||||
},
|
||||
eventHandlers = testing.eventHandlers
|
||||
}
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
GLOBAL: test.lua
|
||||
PLAYER: player.lua
|
||||
|
||||
|
|
|
@ -31,8 +31,12 @@ function M.runLocalTest(obj, name)
|
|||
currentLocalTest = name
|
||||
currentLocalTestError = nil
|
||||
obj:sendEvent('runLocalTest', name)
|
||||
while currentLocalTest do coroutine.yield() end
|
||||
if currentLocalTestError then error(currentLocalTestError, 2) end
|
||||
while currentLocalTest do
|
||||
coroutine.yield()
|
||||
end
|
||||
if currentLocalTestError then
|
||||
error(currentLocalTestError, 2)
|
||||
end
|
||||
end
|
||||
|
||||
function M.expect(cond, delta, msg)
|
||||
|
@ -181,7 +185,9 @@ end
|
|||
|
||||
function M.updateLocal()
|
||||
if localTestRunner and coroutine.status(localTestRunner) ~= 'dead' then
|
||||
coroutine.resume(localTestRunner)
|
||||
if not core.isWorldPaused() then
|
||||
coroutine.resume(localTestRunner)
|
||||
end
|
||||
else
|
||||
localTestRunner = nil
|
||||
end
|
||||
|
@ -196,7 +202,9 @@ M.eventHandlers = {
|
|||
end
|
||||
localTestRunner = coroutine.create(function()
|
||||
local status, err = pcall(fn)
|
||||
if status then err = nil end
|
||||
if status then
|
||||
err = nil
|
||||
end
|
||||
core.sendGlobalEvent('localTestFinished', {name=name, errMsg=err})
|
||||
end)
|
||||
end,
|
||||
|
|
Loading…
Reference in a new issue