Add integration test for `core.getGMST`

revert-6246b479
Petr Mikheev 11 months ago
parent 256db78c6c
commit 69f6ab2882

@ -0,0 +1,6 @@
content=test.omwscripts
# Needed to test `core.getGMST`
fallback=Water_RippleFrameCount,4
fallback=Inventory_DirectionalDiffuseR,0.5
fallback=Level_Up_Level2,something

@ -51,6 +51,13 @@ local function testTeleport()
testing.expectEqualWithDelta(player.rotation.z, math.rad(-90), 0.05, 'teleporting changes rotation')
end
local function testGetGMST()
testing.expectEqual(core.getGMST('non-existed gmst'), nil)
testing.expectEqual(core.getGMST('Water_RippleFrameCount'), 4)
testing.expectEqual(core.getGMST('Inventory_DirectionalDiffuseR'), 0.5)
testing.expectEqual(core.getGMST('Level_Up_Level2'), 'something')
end
local function initPlayer()
player:teleport('', util.vector3(4096, 4096, 867.237), util.vector3(0, 0, 0))
coroutine.yield()
@ -83,6 +90,7 @@ tests = {
testing.runLocalTest(player, 'castNavigationRay')
end},
{'teleport', testTeleport},
{'getGMST', testGetGMST},
}
return {

@ -51,7 +51,9 @@ def runTest(name):
"content=template.omwgame\n",
)
)
if (test_dir / "test.omwscripts").exists():
if (test_dir / "openmw.cfg").exists():
omw_cfg.write(open(test_dir / "openmw.cfg").read())
elif (test_dir / "test.omwscripts").exists():
omw_cfg.write("content=test.omwscripts\n")
with open(config_dir / "settings.cfg", "a", encoding="utf-8") as settings_cfg:
settings_cfg.write(

Loading…
Cancel
Save