Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/tests/test_scripts.h
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | void test_scripts() | ||||
if (!VfsFileExists(L"simulation/components/tests/setup.js")) | if (!VfsFileExists(L"simulation/components/tests/setup.js")) | ||||
{ | { | ||||
debug_printf("WARNING: Skipping component scripts tests (can't find binaries/data/mods/public/simulation/components/tests/setup.js)\n"); | debug_printf("WARNING: Skipping component scripts tests (can't find binaries/data/mods/public/simulation/components/tests/setup.js)\n"); | ||||
return; | return; | ||||
} | } | ||||
VfsPaths paths; | VfsPaths paths; | ||||
TS_ASSERT_OK(vfs::GetPathnames(g_VFS, L"simulation/components/tests/", L"test_*.js", paths)); | TS_ASSERT_OK(vfs::GetPathnames(g_VFS, L"simulation/components/tests/", L"test_*.js", paths)); | ||||
TS_ASSERT_OK(vfs::GetPathnames(g_VFS, L"simulation/helpers/tests/", L"test_*.js", paths)); | |||||
paths.push_back(VfsPath(L"simulation/components/tests/setup_test.js")); | paths.push_back(VfsPath(L"simulation/components/tests/setup_test.js")); | ||||
for (const VfsPath& path : paths) | for (const VfsPath& path : paths) | ||||
{ | { | ||||
CSimContext context; | CSimContext context; | ||||
CComponentManager componentManager(context, g_ScriptRuntime, true); | CComponentManager componentManager(context, g_ScriptRuntime, true); | ||||
ScriptTestSetup(componentManager.GetScriptInterface()); | ScriptTestSetup(componentManager.GetScriptInterface()); | ||||
Show All 10 Lines |
Wildfire Games · Phabricator