summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-03-25 11:18:54 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-03-25 11:18:54 +0100
commit89c70da7bd7769e6eea757482fcbafa8553345f8 (patch)
treed1780b34c8cad997918a6a137798d77de32fbcb2 /tests
parent79c6023b235b7827a056090be2f6f4588e4bcaaa (diff)
parent4933fa8bf5119e605e53f06a632cfabfcd991032 (diff)
downloadredot-engine-89c70da7bd7769e6eea757482fcbafa8553345f8.tar.gz
Merge pull request #89858 from AThousandShips/utf_fix
[Buildsystem] Fix encoding when reading files
Diffstat (limited to 'tests')
-rw-r--r--tests/create_test.py2
-rw-r--r--tests/python_build/test_gles3_builder.py6
-rw-r--r--tests/python_build/test_glsl_builder.py6
3 files changed, 7 insertions, 7 deletions
diff --git a/tests/create_test.py b/tests/create_test.py
index 4d1f1d656e..deb53aca20 100644
--- a/tests/create_test.py
+++ b/tests/create_test.py
@@ -101,7 +101,7 @@ TEST_CASE("[{name_pascal_case}] Example test case") {{
if args.invasive:
print("Trying to insert include directive in test_main.cpp...")
- with open("test_main.cpp", "r") as file:
+ with open("test_main.cpp", "r", encoding="utf-8") as file:
contents = file.read()
match = re.search(r'#include "tests.*\n', contents)
diff --git a/tests/python_build/test_gles3_builder.py b/tests/python_build/test_gles3_builder.py
index 861e0b84c4..6f16139eb9 100644
--- a/tests/python_build/test_gles3_builder.py
+++ b/tests/python_build/test_gles3_builder.py
@@ -17,15 +17,15 @@ def test_gles3_builder(shader_files, builder, header_struct):
builder(shader_files["path_input"], "drivers/gles3/shader_gles3.h", "GLES3", header_data=header)
- with open(shader_files["path_expected_parts"], "r") as f:
+ with open(shader_files["path_expected_parts"], "r", encoding="utf-8") as f:
expected_parts = json.load(f)
assert expected_parts == header.__dict__
- with open(shader_files["path_output"], "r") as f:
+ with open(shader_files["path_output"], "r", encoding="utf-8") as f:
actual_output = f.read()
assert actual_output
- with open(shader_files["path_expected_full"], "r") as f:
+ with open(shader_files["path_expected_full"], "r", encoding="utf-8") as f:
expected_output = f.read()
assert actual_output == expected_output
diff --git a/tests/python_build/test_glsl_builder.py b/tests/python_build/test_glsl_builder.py
index b9dcef48ac..348ef8441c 100644
--- a/tests/python_build/test_glsl_builder.py
+++ b/tests/python_build/test_glsl_builder.py
@@ -23,15 +23,15 @@ def test_glsl_builder(shader_files, builder, header_struct):
header = header_struct()
builder(shader_files["path_input"], header_data=header)
- with open(shader_files["path_expected_parts"], "r") as f:
+ with open(shader_files["path_expected_parts"], "r", encoding="utf-8") as f:
expected_parts = json.load(f)
assert expected_parts == header.__dict__
- with open(shader_files["path_output"], "r") as f:
+ with open(shader_files["path_output"], "r", encoding="utf-8") as f:
actual_output = f.read()
assert actual_output
- with open(shader_files["path_expected_full"], "r") as f:
+ with open(shader_files["path_expected_full"], "r", encoding="utf-8") as f:
expected_output = f.read()
assert actual_output == expected_output