diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52fa51d299..dc638729c4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -467,7 +467,7 @@ Ubuntu_Clang_tests_Debug: stage: test variables: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" - EXAMPLE_SUITE_REVISION: f51b832e033429a7cdc520e0e48d7dfdb9141caa + EXAMPLE_SUITE_REVISION: 599987b52bd2d064e26299d3317b11049499f32b cache: paths: - .cache/pip diff --git a/scripts/data/integration_tests/test_lua_api/global.lua b/scripts/data/integration_tests/test_lua_api/global.lua index f38c13fa58..e5bfb5ef36 100644 --- a/scripts/data/integration_tests/test_lua_api/global.lua +++ b/scripts/data/integration_tests/test_lua_api/global.lua @@ -82,7 +82,7 @@ testing.registerGlobalTest('getGMST', function() end) testing.registerGlobalTest('MWScript', function() - local variableStoreCount = 18 + local variableStoreCount = 19 local variableStore = world.mwscript.getGlobalVariables(player) testing.expectEqual(variableStoreCount, #variableStore) @@ -351,6 +351,20 @@ testing.registerGlobalTest('nan', function() testing.expectEqual(err, 'Value must be a finite number') end) +testing.registerGlobalTest('mwscript magic interactions', function() + local player = world.players[1] + local script = world.mwscript.getGlobalScript('OpenMW_Tests', player) + testing.expectEqual(script == nil, false, 'Expected mwscript OpenMW_Tests to be active') + script.variables.state = 1 + local globals = world.mwscript.getGlobalVariables(player); + globals.OpenMW_Tests_Failed = 0 + while script.variables.state ~= 0 and globals.OpenMW_Tests_Failed == 0 and script.isRunning do + coroutine.yield() + end + testing.expectEqual(script.isRunning, true, 'OpenMW_Tests should not crash') + testing.expectEqual(globals.OpenMW_Tests_Failed, 0, 'OpenMW_Tests should run without issue') +end) + return { engineHandlers = { onUpdate = testing.updateGlobal, diff --git a/scripts/data/integration_tests/test_lua_api/menu.lua b/scripts/data/integration_tests/test_lua_api/menu.lua index 4f8dbd99c6..a7adbbc58a 100644 --- a/scripts/data/integration_tests/test_lua_api/menu.lua +++ b/scripts/data/integration_tests/test_lua_api/menu.lua @@ -19,6 +19,7 @@ testing.registerMenuTest('save and load', function() 'template.omwgame', 'landracer.omwaddon', 'the_hub.omwaddon', + 'mwscript.omwaddon', 'test_lua_api.omwscripts', }, creationTime = matchers.isAny(), diff --git a/scripts/integration_tests.py b/scripts/integration_tests.py index 80c97f8b73..773932bb20 100755 --- a/scripts/integration_tests.py +++ b/scripts/integration_tests.py @@ -29,6 +29,7 @@ content_paths = ( example_suite_dir / "game_template" / "data" / "template.omwgame", example_suite_dir / "example_animated_creature" / "data" / "landracer.omwaddon", example_suite_dir / "the_hub" / "data" / "the_hub.omwaddon", + example_suite_dir / "integration_tests" / "data" / "mwscript.omwaddon", ) for path in content_paths: if not path.is_file(): @@ -60,6 +61,7 @@ def run_test(test_name): omw_cfg.writelines( ( f'data="{testing_util_dir}"\n', + f'data="{example_suite_dir / "example_static_props" / "data"}"\n', f'data-local="{test_dir}"\n', f'user-data="{userdata_dir}"\n', )