diff options
Diffstat (limited to 'modules/gdscript/tests/gdscript_test_runner_suite.h')
| -rw-r--r-- | modules/gdscript/tests/gdscript_test_runner_suite.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/modules/gdscript/tests/gdscript_test_runner_suite.h b/modules/gdscript/tests/gdscript_test_runner_suite.h index 5fd7d942d2..d6befd2db3 100644 --- a/modules/gdscript/tests/gdscript_test_runner_suite.h +++ b/modules/gdscript/tests/gdscript_test_runner_suite.h @@ -37,13 +37,13 @@ namespace GDScriptTests { +// TODO: Handle some cases failing on release builds. See: https://github.com/godotengine/godot/pull/88452 +#ifdef TOOLS_ENABLED TEST_SUITE("[Modules][GDScript]") { - // GDScript 2.0 is still under heavy construction. - // Allow the tests to fail, but do not ignore errors during development. - // Update the scripts and expected output as needed. TEST_CASE("Script compilation and runtime") { bool print_filenames = OS::get_singleton()->get_cmdline_args().find("--print-filenames") != nullptr; - GDScriptTestRunner runner("modules/gdscript/tests/scripts", true, print_filenames); + bool use_binary_tokens = OS::get_singleton()->get_cmdline_args().find("--use-binary-tokens") != nullptr; + GDScriptTestRunner runner("modules/gdscript/tests/scripts", true, print_filenames, use_binary_tokens); int fail_count = runner.run_tests(); INFO("Make sure `*.out` files have expected results."); REQUIRE_MESSAGE(fail_count == 0, "All GDScript tests should pass."); @@ -70,6 +70,7 @@ func _init(): ref_counted->set_script(gdscript); CHECK_MESSAGE(int(ref_counted->get_meta("result")) == 42, "The script should assign object metadata successfully."); } +#endif // TOOLS_ENABLED TEST_CASE("[Modules][GDScript] Validate built-in API") { GDScriptLanguage *lang = GDScriptLanguage::get_singleton(); @@ -80,11 +81,10 @@ TEST_CASE("[Modules][GDScript] Validate built-in API") { SUBCASE("[Modules][GDScript] Validate built-in methods") { for (const MethodInfo &mi : builtin_methods) { - for (int j = 0; j < mi.arguments.size(); j++) { - PropertyInfo arg = mi.arguments[j]; - - TEST_COND((arg.name.is_empty() || arg.name.begins_with("_unnamed_arg")), - vformat("Unnamed argument in position %d of built-in method '%s'.", j, mi.name)); + int i = 0; + for (List<PropertyInfo>::ConstIterator itr = mi.arguments.begin(); itr != mi.arguments.end(); ++itr, ++i) { + TEST_COND((itr->name.is_empty() || itr->name.begins_with("_unnamed_arg")), + vformat("Unnamed argument in position %d of built-in method '%s'.", i, mi.name)); } } } @@ -95,11 +95,10 @@ TEST_CASE("[Modules][GDScript] Validate built-in API") { SUBCASE("[Modules][GDScript] Validate built-in annotations") { for (const MethodInfo &ai : builtin_annotations) { - for (int j = 0; j < ai.arguments.size(); j++) { - PropertyInfo arg = ai.arguments[j]; - - TEST_COND((arg.name.is_empty() || arg.name.begins_with("_unnamed_arg")), - vformat("Unnamed argument in position %d of built-in annotation '%s'.", j, ai.name)); + int i = 0; + for (List<PropertyInfo>::ConstIterator itr = ai.arguments.begin(); itr != ai.arguments.end(); ++itr, ++i) { + TEST_COND((itr->name.is_empty() || itr->name.begins_with("_unnamed_arg")), + vformat("Unnamed argument in position %d of built-in annotation '%s'.", i, ai.name)); } } } |
