mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Run Lua integration tests starting with menu script
This allows writing tests for menu scripts. Keep global script as entry point to morrowind tests. Fix menu.newGame and menu.loadGame to hide main menu.
This commit is contained in:
parent
7a9c2d5e88
commit
0e19b1dd75
8 changed files with 167 additions and 51 deletions
43
scripts/data/integration_tests/test_lua_api/menu.lua
Normal file
43
scripts/data/integration_tests/test_lua_api/menu.lua
Normal file
|
@ -0,0 +1,43 @@
|
|||
local testing = require('testing_util')
|
||||
local menu = require('openmw.menu')
|
||||
|
||||
local function registerGlobalTest(name, description)
|
||||
testing.registerMenuTest(description or name, function()
|
||||
menu.newGame()
|
||||
coroutine.yield()
|
||||
testing.runGlobalTest(name)
|
||||
end)
|
||||
end
|
||||
|
||||
registerGlobalTest('timers')
|
||||
registerGlobalTest('teleport')
|
||||
registerGlobalTest('getGMST')
|
||||
registerGlobalTest('MWScript')
|
||||
registerGlobalTest('record stores')
|
||||
registerGlobalTest('record creation')
|
||||
registerGlobalTest('UTF-8 characters')
|
||||
registerGlobalTest('UTF-8 strings')
|
||||
registerGlobalTest('memory limit')
|
||||
registerGlobalTest('vfs')
|
||||
registerGlobalTest('commit crime')
|
||||
registerGlobalTest('record model property')
|
||||
|
||||
registerGlobalTest('player yaw rotation', 'rotating player with controls.yawChange should change rotation')
|
||||
registerGlobalTest('player pitch rotation', 'rotating player with controls.pitchChange should change rotation')
|
||||
registerGlobalTest('player pitch and yaw rotation', 'rotating player with controls.pitchChange and controls.yawChange should change rotation')
|
||||
registerGlobalTest('player rotation', 'rotating player should not lead to nan rotation')
|
||||
registerGlobalTest('player forward running')
|
||||
registerGlobalTest('player diagonal walking')
|
||||
registerGlobalTest('findPath')
|
||||
registerGlobalTest('findRandomPointAroundCircle')
|
||||
registerGlobalTest('castNavigationRay')
|
||||
registerGlobalTest('findNearestNavMeshPosition')
|
||||
registerGlobalTest('player memory limit')
|
||||
registerGlobalTest('player weapon attack', 'player with equipped weapon on attack should damage health of other actors')
|
||||
|
||||
return {
|
||||
engineHandlers = {
|
||||
onFrame = testing.makeUpdateMenu(),
|
||||
},
|
||||
eventHandlers = testing.menuEventHandlers,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue