Skip to content

Commit eb39839

Browse files
committed
Merge pull request #106129 from kitbdev/fix-solo-tests
Fix tests that fail when alone
2 parents fc8f2a1 + 6d56d2d commit eb39839

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

modules/gdscript/tests/gdscript_test_runner_suite.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ TEST_SUITE("[Modules][GDScript]") {
4848
REQUIRE_MESSAGE(fail_count == 0, "All GDScript tests should pass.");
4949
}
5050
}
51+
#endif // TOOLS_ENABLED
5152

5253
TEST_CASE("[Modules][GDScript] Load source code dynamically and run it") {
54+
GDScriptLanguage::get_singleton()->init();
5355
Ref<GDScript> gdscript = memnew(GDScript);
5456
gdscript->set_source_code(R"(
5557
extends RefCounted
@@ -69,7 +71,6 @@ func _init():
6971
ref_counted->set_script(gdscript);
7072
CHECK_MESSAGE(int(ref_counted->get_meta("result")) == 42, "The script should assign object metadata successfully.");
7173
}
72-
#endif // TOOLS_ENABLED
7374

7475
TEST_CASE("[Modules][GDScript] Validate built-in API") {
7576
GDScriptLanguage *lang = GDScriptLanguage::get_singleton();

tests/core/config/test_project_settings.h

+6-9
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,25 @@ class TestProjectSettingsInternalsAccessor {
4444

4545
namespace TestProjectSettings {
4646

47-
// TODO: Handle some cases failing on release builds. See: https://github.com/godotengine/godot/pull/88452
48-
#ifdef TOOLS_ENABLED
4947
TEST_CASE("[ProjectSettings] Get existing setting") {
50-
CHECK(ProjectSettings::get_singleton()->has_setting("application/config/name"));
48+
CHECK(ProjectSettings::get_singleton()->has_setting("application/run/main_scene"));
5149

52-
Variant variant = ProjectSettings::get_singleton()->get_setting("application/config/name");
50+
Variant variant = ProjectSettings::get_singleton()->get_setting("application/run/main_scene");
5351
CHECK_EQ(variant.get_type(), Variant::STRING);
5452

5553
String name = variant;
56-
CHECK_EQ(name, "GDScript Integration Test Suite");
54+
CHECK_EQ(name, String());
5755
}
5856

5957
TEST_CASE("[ProjectSettings] Default value is ignored if setting exists") {
60-
CHECK(ProjectSettings::get_singleton()->has_setting("application/config/name"));
58+
CHECK(ProjectSettings::get_singleton()->has_setting("application/run/main_scene"));
6159

62-
Variant variant = ProjectSettings::get_singleton()->get_setting("application/config/name", "SomeDefaultValue");
60+
Variant variant = ProjectSettings::get_singleton()->get_setting("application/run/main_scene", "SomeDefaultValue");
6361
CHECK_EQ(variant.get_type(), Variant::STRING);
6462

6563
String name = variant;
66-
CHECK_EQ(name, "GDScript Integration Test Suite");
64+
CHECK_EQ(name, String());
6765
}
68-
#endif // TOOLS_ENABLED
6966

7067
TEST_CASE("[ProjectSettings] Non existing setting is null") {
7168
CHECK_FALSE(ProjectSettings::get_singleton()->has_setting("not_existing_setting"));

0 commit comments

Comments
 (0)