Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests] Fix test regression without editor #88449

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@

#include "test_main.h"

#ifdef TOOLS_ENABLED
#include "editor/editor_paths.h"
#include "editor/editor_settings.h"
#endif // TOOLS_ENABLED

#include "tests/core/config/test_project_settings.h"
#include "tests/core/input/test_input_event.h"
#include "tests/core/input/test_input_event_key.h"
Expand Down Expand Up @@ -270,11 +273,13 @@ struct GodotTestCaseListener : public doctest::IReporter {
SceneTree::get_singleton()->get_root()->set_embedding_subwindows(true);
}

#ifdef TOOLS_ENABLED
if (name.find("[Editor]") != -1) {
Engine::get_singleton()->set_editor_hint(true);
EditorPaths::create();
EditorSettings::create();
}
#endif // TOOLS_ENABLED
Comment on lines +276 to +282
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure if we should error here when not using a tools build just to warn, didn't add anything right now but can do if desired


return;
}
Expand All @@ -298,9 +303,11 @@ struct GodotTestCaseListener : public doctest::IReporter {
}

void test_case_end(const doctest::CurrentTestCaseStats &) override {
#ifdef TOOLS_ENABLED
if (EditorSettings::get_singleton()) {
EditorSettings::destroy();
}
#endif // TOOLS_ENABLED

Engine::get_singleton()->set_editor_hint(false);

Expand Down
Loading