diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-03 17:11:01 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-03 17:11:01 +0200 |
commit | 6de06138c0ce8a57164092794c0ebb782bcb9e9a (patch) | |
tree | 78fd4423e7a3e51df70c0b7fa793131e808a81d8 /modules | |
parent | 9e8a93a5a905a21c02a802ac061510268700873d (diff) | |
parent | 80ba1e0614b87693f154ab52981cd9f7af462a9b (diff) | |
download | redot-engine-6de06138c0ce8a57164092794c0ebb782bcb9e9a.tar.gz |
Merge pull request #79425 from vnen/gdscript-load-classes-for-debug-tests
GDScript: Load global classes when running debug tests
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/tests/test_gdscript.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/gdscript/tests/test_gdscript.cpp b/modules/gdscript/tests/test_gdscript.cpp index b86a8b3cb1..467bedc4b2 100644 --- a/modules/gdscript/tests/test_gdscript.cpp +++ b/modules/gdscript/tests/test_gdscript.cpp @@ -223,6 +223,16 @@ void test(TestType p_type) { // Initialize the language for the test routine. init_language(fa->get_path_absolute().get_base_dir()); + // Load global classes. + TypedArray<Dictionary> script_classes = ProjectSettings::get_singleton()->get_global_class_list(); + for (int i = 0; i < script_classes.size(); i++) { + Dictionary c = script_classes[i]; + if (!c.has("class") || !c.has("language") || !c.has("path") || !c.has("base")) { + continue; + } + ScriptServer::add_global_class(c["class"], c["base"], c["language"], c["path"]); + } + Vector<uint8_t> buf; uint64_t flen = fa->get_length(); buf.resize(flen + 1); |