summaryrefslogtreecommitdiffstats
path: root/tests/python_build/conftest.py
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-08-22 19:32:11 +0200
committerGitHub <noreply@github.com>2022-08-22 19:32:11 +0200
commit0cea7e3f64e3f22e15cca5e2ab71406bec6b8f5a (patch)
tree914f876e5b9b32a22a7f501326abb4b0e12148b7 /tests/python_build/conftest.py
parent7b4927bb5ff8440a33043cf32c1163e2fe0830d1 (diff)
parent388d35b74d8919b251faae9e24af50476f12b1a2 (diff)
downloadredot-engine-0cea7e3f64e3f22e15cca5e2ab71406bec6b8f5a.tar.gz
Merge pull request #62545 from yedpodtrzitko/yed/pytest-builders
Diffstat (limited to 'tests/python_build/conftest.py')
-rw-r--r--tests/python_build/conftest.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/python_build/conftest.py b/tests/python_build/conftest.py
new file mode 100644
index 0000000000..617230926a
--- /dev/null
+++ b/tests/python_build/conftest.py
@@ -0,0 +1,26 @@
+import os
+import sys
+from pathlib import Path
+
+import pytest
+
+CWD = Path(__file__).parent
+ROOT = CWD.parent.parent
+# append directory with build files to sys.path to import them
+sys.path.append(str(ROOT))
+
+
+@pytest.fixture
+def shader_files(request):
+ shader_path = request.param
+
+ res = {
+ "path_input": str(CWD / "fixtures" / f"{shader_path}.glsl"),
+ "path_output": str(CWD / "fixtures" / f"{shader_path}.glsl.gen.h"),
+ "path_expected_full": str(CWD / "fixtures" / f"{shader_path}_expected_full.glsl"),
+ "path_expected_parts": str(CWD / "fixtures" / f"{shader_path}_expected_parts.json"),
+ }
+ yield res
+
+ if not os.getenv("PYTEST_KEEP_GENERATED_FILES"):
+ os.remove(res["path_output"])