From 8ebb981bdb5835bbcc17b4798d5cf41c8f482323 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Tue, 24 Feb 2026 20:17:44 +0100 Subject: [PATCH] Add an integration test --- scripts/data/integration_tests/test_lua_api/global.lua | 6 ++++++ scripts/data/integration_tests/test_lua_api/load.lua | 9 +++++++++ scripts/data/integration_tests/test_lua_api/menu.lua | 1 + .../test_lua_api/test_lua_api.omwscripts | 1 + 4 files changed, 17 insertions(+) create mode 100644 scripts/data/integration_tests/test_lua_api/load.lua diff --git a/scripts/data/integration_tests/test_lua_api/global.lua b/scripts/data/integration_tests/test_lua_api/global.lua index dbc1864195..1bbbdfee88 100644 --- a/scripts/data/integration_tests/test_lua_api/global.lua +++ b/scripts/data/integration_tests/test_lua_api/global.lua @@ -386,6 +386,12 @@ testing.registerGlobalTest('mwscript magic interactions', function() testing.expectEqual(globals.OpenMW_Tests_Failed, 0, 'OpenMW_Tests should run without issue') end) +testing.registerGlobalTest('load script generated static', function() + local record = types.Static.records.OMW_Generated_Static + testing.expectNotEqual(record, nil, 'OMW_Generated_Static should have been generated') + testing.expectEqual(record.model, 'meshes/generatedonload.nif') +end) + return { engineHandlers = { onUpdate = testing.updateGlobal, diff --git a/scripts/data/integration_tests/test_lua_api/load.lua b/scripts/data/integration_tests/test_lua_api/load.lua new file mode 100644 index 0000000000..0ed12cab1f --- /dev/null +++ b/scripts/data/integration_tests/test_lua_api/load.lua @@ -0,0 +1,9 @@ +local content = require('openmw.content') + +return { + engineHandlers = { + onContentFilesLoaded = function() + content.statics.records.OMW_Generated_Static = { model = 'meshes/generatedonload.nif' } + end + } +} diff --git a/scripts/data/integration_tests/test_lua_api/menu.lua b/scripts/data/integration_tests/test_lua_api/menu.lua index 52c2c15d00..928c590ed5 100644 --- a/scripts/data/integration_tests/test_lua_api/menu.lua +++ b/scripts/data/integration_tests/test_lua_api/menu.lua @@ -76,6 +76,7 @@ registerGlobalTest('commit crime') registerGlobalTest('record model property') registerGlobalTest('nan float', 'world.setGameTimeScale should not accept nan') registerGlobalTest('nan vector', 'weather.stormDirection should not accept a vector with a nan component') +registerGlobalTest('load script generated static') registerGlobalTest('player yaw rotation', 'rotating player with controls.yawChange should change rotation') registerGlobalTest('player pitch rotation', 'rotating player with controls.pitchChange should change rotation') diff --git a/scripts/data/integration_tests/test_lua_api/test_lua_api.omwscripts b/scripts/data/integration_tests/test_lua_api/test_lua_api.omwscripts index 4ce925e61d..d13783a6e0 100644 --- a/scripts/data/integration_tests/test_lua_api/test_lua_api.omwscripts +++ b/scripts/data/integration_tests/test_lua_api/test_lua_api.omwscripts @@ -1,3 +1,4 @@ MENU: menu.lua GLOBAL: global.lua PLAYER: player.lua +LOAD: load.lua