feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -57,6 +57,7 @@
#include "tests/core/io/test_resource_uid.h"
#include "tests/core/io/test_stream_peer.h"
#include "tests/core/io/test_stream_peer_buffer.h"
#include "tests/core/io/test_stream_peer_gzip.h"
#include "tests/core/io/test_tcp_server.h"
#include "tests/core/io/test_udp_server.h"
#include "tests/core/io/test_xml_parser.h"
@ -102,6 +103,7 @@
#include "tests/core/templates/test_oa_hash_map.h"
#include "tests/core/templates/test_paged_array.h"
#include "tests/core/templates/test_rid.h"
#include "tests/core/templates/test_span.h"
#include "tests/core/templates/test_vector.h"
#include "tests/core/test_crypto.h"
#include "tests/core/test_hashing_context.h"
@ -133,7 +135,6 @@
#include "tests/scene/test_parallax_2d.h"
#include "tests/scene/test_path_2d.h"
#include "tests/scene/test_path_follow_2d.h"
#include "tests/scene/test_physics_material.h"
#include "tests/scene/test_sprite_frames.h"
#include "tests/scene/test_style_box_texture.h"
#include "tests/scene/test_texture_progress_bar.h"
@ -143,6 +144,7 @@
#include "tests/scene/test_visual_shader.h"
#include "tests/scene/test_window.h"
#include "tests/servers/rendering/test_shader_preprocessor.h"
#include "tests/servers/test_nav_heap.h"
#include "tests/servers/test_text_server.h"
#include "tests/test_validate_testing.h"
@ -159,21 +161,10 @@
#endif // ADVANCED_GUI_DISABLED
#ifndef _3D_DISABLED
#ifdef MODULE_NAVIGATION_ENABLED
#include "tests/scene/test_navigation_agent_2d.h"
#include "tests/scene/test_navigation_agent_3d.h"
#include "tests/scene/test_navigation_obstacle_2d.h"
#include "tests/scene/test_navigation_obstacle_3d.h"
#include "tests/scene/test_navigation_region_2d.h"
#include "tests/scene/test_navigation_region_3d.h"
#include "tests/servers/test_navigation_server_2d.h"
#include "tests/servers/test_navigation_server_3d.h"
#endif // MODULE_NAVIGATION_ENABLED
#include "tests/core/math/test_triangle_mesh.h"
#include "tests/scene/test_arraymesh.h"
#include "tests/scene/test_camera_3d.h"
#include "tests/scene/test_gltf_document.h"
#include "tests/scene/test_height_map_shape_3d.h"
#include "tests/scene/test_path_3d.h"
#include "tests/scene/test_path_follow_3d.h"
#include "tests/scene/test_primitives.h"
@ -181,22 +172,48 @@
#include "tests/scene/test_sky.h"
#endif // _3D_DISABLED
#ifndef PHYSICS_3D_DISABLED
#include "tests/scene/test_height_map_shape_3d.h"
#include "tests/scene/test_physics_material.h"
#endif // PHYSICS_3D_DISABLED
#ifdef MODULE_NAVIGATION_2D_ENABLED
#include "tests/scene/test_navigation_agent_2d.h"
#include "tests/scene/test_navigation_obstacle_2d.h"
#include "tests/scene/test_navigation_region_2d.h"
#include "tests/servers/test_navigation_server_2d.h"
#endif // MODULE_NAVIGATION_2D_ENABLED
#ifdef MODULE_NAVIGATION_3D_ENABLED
#include "tests/scene/test_navigation_agent_3d.h"
#include "tests/scene/test_navigation_obstacle_3d.h"
#include "tests/scene/test_navigation_region_3d.h"
#include "tests/servers/test_navigation_server_3d.h"
#endif // MODULE_NAVIGATION_3D_ENABLED
#include "modules/modules_tests.gen.h"
#include "tests/display_server_mock.h"
#include "tests/test_macros.h"
#include "scene/theme/theme_db.h"
#ifndef _3D_DISABLED
#ifndef NAVIGATION_2D_DISABLED
#include "servers/navigation_server_2d.h"
#endif // NAVIGATION_2D_DISABLED
#ifndef NAVIGATION_3D_DISABLED
#include "servers/navigation_server_3d.h"
#endif // _3D_DISABLED
#endif // NAVIGATION_3D_DISABLED
#ifndef PHYSICS_2D_DISABLED
#include "servers/physics_server_2d.h"
#include "servers/physics_server_2d_dummy.h"
#ifndef _3D_DISABLED
#endif // PHYSICS_2D_DISABLED
#ifndef PHYSICS_3D_DISABLED
#include "servers/physics_server_3d.h"
#include "servers/physics_server_3d_dummy.h"
#endif // _3D_DISABLED
#endif // PHYSICS_3D_DISABLED
#include "servers/rendering/rendering_server_default.h"
int test_main(int argc, char *argv[]) {
@ -271,12 +288,19 @@ struct GodotTestCaseListener : public doctest::IReporter {
SignalWatcher *signal_watcher = nullptr;
#ifndef PHYSICS_2D_DISABLED
PhysicsServer2D *physics_server_2d = nullptr;
#ifndef _3D_DISABLED
#endif // PHYSICS_2D_DISABLED
#ifndef PHYSICS_3D_DISABLED
PhysicsServer3D *physics_server_3d = nullptr;
NavigationServer3D *navigation_server_3d = nullptr;
#endif // PHYSICS_3D_DISABLED
#ifndef NAVIGATION_2D_DISABLED
NavigationServer2D *navigation_server_2d = nullptr;
#endif // _3D_DISABLED
#endif // NAVIGATION_2D_DISABLED
#ifndef NAVIGATION_3D_DISABLED
NavigationServer3D *navigation_server_3d = nullptr;
#endif // NAVIGATION_3D_DISABLED
void test_case_start(const doctest::TestCaseData &p_in) override {
reinitialize();
@ -306,28 +330,32 @@ struct GodotTestCaseListener : public doctest::IReporter {
// So we have to do this for each test case. Also make sure there is
// no residual theme from something else.
ThemeDB::get_singleton()->finalize_theme();
ThemeDB::get_singleton()->initialize_theme_noproject();
ThemeDB::get_singleton()->initialize_theme();
#ifndef _3D_DISABLED
#ifndef PHYSICS_3D_DISABLED
physics_server_3d = PhysicsServer3DManager::get_singleton()->new_default_server();
if (!physics_server_3d) {
physics_server_3d = memnew(PhysicsServer3DDummy);
}
physics_server_3d->init();
#endif // _3D_DISABLED
#endif // PHYSICS_3D_DISABLED
#ifndef PHYSICS_2D_DISABLED
physics_server_2d = PhysicsServer2DManager::get_singleton()->new_default_server();
if (!physics_server_2d) {
physics_server_2d = memnew(PhysicsServer2DDummy);
}
physics_server_2d->init();
#endif // PHYSICS_2D_DISABLED
#ifndef _3D_DISABLED
ERR_PRINT_OFF;
#ifndef NAVIGATION_3D_DISABLED
navigation_server_3d = NavigationServer3DManager::new_default_server();
#endif // NAVIGATION_3D_DISABLED
#ifndef NAVIGATION_2D_DISABLED
navigation_server_2d = NavigationServer2DManager::new_default_server();
#endif // NAVIGATION_2D_DISABLED
ERR_PRINT_ON;
#endif // _3D_DISABLED
memnew(InputMap);
InputMap::get_singleton()->load_default();
@ -358,15 +386,23 @@ struct GodotTestCaseListener : public doctest::IReporter {
return;
}
#ifndef _3D_DISABLED
if (suite_name.contains("[Navigation]") && navigation_server_2d == nullptr && navigation_server_3d == nullptr) {
#ifndef NAVIGATION_3D_DISABLED
if (suite_name.contains("[Navigation3D]") && navigation_server_3d == nullptr) {
ERR_PRINT_OFF;
navigation_server_3d = NavigationServer3DManager::new_default_server();
ERR_PRINT_ON;
return;
}
#endif // NAVIGATION_3D_DISABLED
#ifndef NAVIGATION_2D_DISABLED
if (suite_name.contains("[Navigation2D]") && navigation_server_2d == nullptr) {
ERR_PRINT_OFF;
navigation_server_2d = NavigationServer2DManager::new_default_server();
ERR_PRINT_ON;
return;
}
#endif // _3D_DISABLED
#endif // NAVIGATION_2D_DISABLED
}
void test_case_end(const doctest::CurrentTestCaseStats &) override {
@ -396,31 +432,35 @@ struct GodotTestCaseListener : public doctest::IReporter {
memdelete(SceneTree::get_singleton());
}
#ifndef _3D_DISABLED
#ifndef NAVIGATION_3D_DISABLED
if (navigation_server_3d) {
memdelete(navigation_server_3d);
navigation_server_3d = nullptr;
}
#endif // NAVIGATION_3D_DISABLED
#ifndef NAVIGATION_2D_DISABLED
if (navigation_server_2d) {
memdelete(navigation_server_2d);
navigation_server_2d = nullptr;
}
#endif // _3D_DISABLED
#endif // NAVIGATION_2D_DISABLED
#ifndef _3D_DISABLED
#ifndef PHYSICS_3D_DISABLED
if (physics_server_3d) {
physics_server_3d->finish();
memdelete(physics_server_3d);
physics_server_3d = nullptr;
}
#endif // _3D_DISABLED
#endif // PHYSICS_3D_DISABLED
#ifndef PHYSICS_2D_DISABLED
if (physics_server_2d) {
physics_server_2d->finish();
memdelete(physics_server_2d);
physics_server_2d = nullptr;
}
#endif // PHYSICS_2D_DISABLED
if (Input::get_singleton()) {
memdelete(Input::get_singleton());