summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2024-01-26 14:49:31 -0300
committerGeorge Marques <george@gmarqu.es>2024-02-08 11:20:07 -0300
commit72e5f8c31e9237a4581cf250aa9943a4290f4017 (patch)
treeb7054c6531edaf067a7d45711d3c5af96df1bfc5 /modules/gdscript/tests
parentb4d0a09f15c60c88bbf516d2f6dcdb451dcad9c7 (diff)
downloadredot-engine-72e5f8c31e9237a4581cf250aa9943a4290f4017.tar.gz
GDScript: Enable compression on export
Besides the regular option to export GDScript as binary tokens, this also includes a compression option on top of it. The binary format needs to encode some information which generally makes it bigger than the source text. This option reduces that difference by using Zstandard compression on the buffer.
Diffstat (limited to 'modules/gdscript/tests')
-rw-r--r--modules/gdscript/tests/gdscript_test_runner.cpp2
-rw-r--r--modules/gdscript/tests/test_gdscript.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/tests/gdscript_test_runner.cpp b/modules/gdscript/tests/gdscript_test_runner.cpp
index 880289d2a8..a0329eb8d2 100644
--- a/modules/gdscript/tests/gdscript_test_runner.cpp
+++ b/modules/gdscript/tests/gdscript_test_runner.cpp
@@ -538,7 +538,7 @@ GDScriptTest::TestResult GDScriptTest::execute_test_code(bool p_is_generating) {
} else {
String code = FileAccess::get_file_as_string(source_file, &err);
if (!err) {
- Vector<uint8_t> buffer = GDScriptTokenizerBuffer::parse_code_string(code);
+ Vector<uint8_t> buffer = GDScriptTokenizerBuffer::parse_code_string(code, GDScriptTokenizerBuffer::COMPRESS_ZSTD);
script->set_binary_tokens_source(buffer);
}
}
diff --git a/modules/gdscript/tests/test_gdscript.cpp b/modules/gdscript/tests/test_gdscript.cpp
index e4fab68e06..f6965cf7cf 100644
--- a/modules/gdscript/tests/test_gdscript.cpp
+++ b/modules/gdscript/tests/test_gdscript.cpp
@@ -111,7 +111,7 @@ static void test_tokenizer(const String &p_code, const Vector<String> &p_lines)
static void test_tokenizer_buffer(const Vector<uint8_t> &p_buffer, const Vector<String> &p_lines);
static void test_tokenizer_buffer(const String &p_code, const Vector<String> &p_lines) {
- Vector<uint8_t> binary = GDScriptTokenizerBuffer::parse_code_string(p_code);
+ Vector<uint8_t> binary = GDScriptTokenizerBuffer::parse_code_string(p_code, GDScriptTokenizerBuffer::COMPRESS_NONE);
test_tokenizer_buffer(binary, p_lines);
}