diff options
author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-02-23 12:52:06 +0100 |
---|---|---|
committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-02-23 20:58:56 +0100 |
commit | 3a707b1f54cc7427d7cfc915907ef70802d9aabb (patch) | |
tree | fe1c1e702fa21eee9ac0b4988ebc303cfd65be14 /tests/test_main.cpp | |
parent | 87d40ba743ff3a3a484db051c11b16559604efa9 (diff) | |
download | redot-engine-3a707b1f54cc7427d7cfc915907ef70802d9aabb.tar.gz |
Fix some additional errors with 3D disabled
* Disabled 2D navigation tests as they do not work
* Disabled tests for primitive meshes
* Unbound some `Mesh` methods that rely on 3D resources
* Unexposed `World3D` as it depends on physics (and isn't useful)
* Unexposed some `Viewport` vrs related properties that had unexposed
methods
Diffstat (limited to 'tests/test_main.cpp')
-rw-r--r-- | tests/test_main.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/tests/test_main.cpp b/tests/test_main.cpp index 47c8e9732d..f40f562973 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -107,14 +107,10 @@ #include "tests/scene/test_curve_3d.h" #include "tests/scene/test_gradient.h" #include "tests/scene/test_image_texture.h" -#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/scene/test_node.h" #include "tests/scene/test_node_2d.h" #include "tests/scene/test_packed_scene.h" #include "tests/scene/test_path_2d.h" -#include "tests/scene/test_primitives.h" #include "tests/scene/test_sprite_frames.h" #include "tests/scene/test_text_edit.h" #include "tests/scene/test_theme.h" @@ -122,16 +118,20 @@ #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_navigation_server_2d.h" #include "tests/servers/test_text_server.h" #include "tests/test_validate_testing.h" #ifndef _3D_DISABLED #include "tests/scene/test_camera_3d.h" +#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/scene/test_path_3d.h" +#include "tests/scene/test_primitives.h" +#include "tests/servers/test_navigation_server_2d.h" #include "tests/servers/test_navigation_server_3d.h" #endif // _3D_DISABLED @@ -141,8 +141,10 @@ #include "tests/test_macros.h" #include "scene/theme/theme_db.h" +#ifndef _3D_DISABLED #include "servers/navigation_server_2d.h" #include "servers/navigation_server_3d.h" +#endif // _3D_DISABLED #include "servers/physics_server_2d.h" #ifndef _3D_DISABLED #include "servers/physics_server_3d.h" @@ -221,12 +223,12 @@ struct GodotTestCaseListener : public doctest::IReporter { SignalWatcher *signal_watcher = nullptr; + PhysicsServer2D *physics_server_2d = nullptr; #ifndef _3D_DISABLED PhysicsServer3D *physics_server_3d = nullptr; -#endif // _3D_DISABLED - PhysicsServer2D *physics_server_2d = nullptr; NavigationServer3D *navigation_server_3d = nullptr; NavigationServer2D *navigation_server_2d = nullptr; +#endif // _3D_DISABLED void test_case_start(const doctest::TestCaseData &p_in) override { reinitialize(); @@ -266,10 +268,12 @@ struct GodotTestCaseListener : public doctest::IReporter { physics_server_2d = PhysicsServer2DManager::get_singleton()->new_default_server(); physics_server_2d->init(); +#ifndef _3D_DISABLED ERR_PRINT_OFF; navigation_server_3d = NavigationServer3DManager::new_default_server(); navigation_server_2d = NavigationServer2DManager::new_default_server(); ERR_PRINT_ON; +#endif // _3D_DISABLED memnew(InputMap); InputMap::get_singleton()->load_default(); @@ -300,6 +304,7 @@ struct GodotTestCaseListener : public doctest::IReporter { return; } +#ifndef _3D_DISABLED if (suite_name.find("[Navigation]") != -1 && navigation_server_2d == nullptr && navigation_server_3d == nullptr) { ERR_PRINT_OFF; navigation_server_3d = NavigationServer3DManager::new_default_server(); @@ -307,6 +312,7 @@ struct GodotTestCaseListener : public doctest::IReporter { ERR_PRINT_ON; return; } +#endif // _3D_DISABLED } void test_case_end(const doctest::CurrentTestCaseStats &) override { @@ -330,6 +336,7 @@ struct GodotTestCaseListener : public doctest::IReporter { memdelete(SceneTree::get_singleton()); } +#ifndef _3D_DISABLED if (navigation_server_3d) { memdelete(navigation_server_3d); navigation_server_3d = nullptr; @@ -339,6 +346,7 @@ struct GodotTestCaseListener : public doctest::IReporter { memdelete(navigation_server_2d); navigation_server_2d = nullptr; } +#endif // _3D_DISABLED #ifndef _3D_DISABLED if (physics_server_3d) { |