diff options
author | Jiri Suchan <yed@vanyli.net> | 2022-06-30 11:14:07 +0900 |
---|---|---|
committer | Jiri Suchan <yed@vanyli.net> | 2022-08-19 20:32:13 +0900 |
commit | 388d35b74d8919b251faae9e24af50476f12b1a2 (patch) | |
tree | 6e984d73605bf3de867722bd88e1ee888a351fea /tests/python_build/test_gles3_builder.py | |
parent | b04593c22bd5e88d24f1be19422696e7bde584f6 (diff) | |
download | redot-engine-388d35b74d8919b251faae9e24af50476f12b1a2.tar.gz |
ci: add basic test pipeline for shader builders
Diffstat (limited to 'tests/python_build/test_gles3_builder.py')
-rw-r--r-- | tests/python_build/test_gles3_builder.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/python_build/test_gles3_builder.py b/tests/python_build/test_gles3_builder.py new file mode 100644 index 0000000000..861e0b84c4 --- /dev/null +++ b/tests/python_build/test_gles3_builder.py @@ -0,0 +1,31 @@ +import json + +import pytest + +from gles3_builders import build_gles3_header, GLES3HeaderStruct + + +@pytest.mark.parametrize( + ["shader_files", "builder", "header_struct"], + [ + ("gles3/vertex_fragment", build_gles3_header, GLES3HeaderStruct), + ], + indirect=["shader_files"], +) +def test_gles3_builder(shader_files, builder, header_struct): + header = 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: + expected_parts = json.load(f) + assert expected_parts == header.__dict__ + + with open(shader_files["path_output"], "r") as f: + actual_output = f.read() + assert actual_output + + with open(shader_files["path_expected_full"], "r") as f: + expected_output = f.read() + + assert actual_output == expected_output |