diff options
author | George Marques <george@gmarqu.es> | 2024-01-22 11:31:55 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2024-02-08 11:20:05 -0300 |
commit | b4d0a09f15c60c88bbf516d2f6dcdb451dcad9c7 (patch) | |
tree | 016418a6449173814f541c481be0fc6cc3de8dab /modules/gdscript/tests/gdscript_test_runner_suite.h | |
parent | 41564aaf7708b0bf594f745dd2448a54dd687cc5 (diff) | |
download | redot-engine-b4d0a09f15c60c88bbf516d2f6dcdb451dcad9c7.tar.gz |
GDScript: Reintroduce binary tokenization on export
This adds back a function available in 3.x: exporting the GDScript
files in a binary form by converting the tokens recognized by the
tokenizer into a data format.
It is enabled by default on export but can be manually disabled. The
format helps with loading times since, the tokens are easily
reconstructed, and with hiding the source code, since recovering it
would require a specialized tool. Code comments are not stored in this
format.
The `--test` command can also include a `--use-binary-tokens` flag
which will run the GDScript tests with the binary format instead of the
regular source code by converting them in-memory before the test runs.
Diffstat (limited to 'modules/gdscript/tests/gdscript_test_runner_suite.h')
-rw-r--r-- | modules/gdscript/tests/gdscript_test_runner_suite.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/gdscript/tests/gdscript_test_runner_suite.h b/modules/gdscript/tests/gdscript_test_runner_suite.h index 5fd7d942d2..5acf436e42 100644 --- a/modules/gdscript/tests/gdscript_test_runner_suite.h +++ b/modules/gdscript/tests/gdscript_test_runner_suite.h @@ -38,12 +38,10 @@ namespace GDScriptTests { 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."); |