File size: 1,130 Bytes
ceea884 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | """src/vkgs/src/render_graph.cpp ์ ์ ๋ ฌยท๋ฐฐ๋ฆฌ์ด ๋ก์ง์ g++ ๋ก ์ปดํ์ผํด ์ํํ๋ค. GPUยท์ฐฝ ์์
(vkCmdPipelineBarrier ๋ ์ํ ์ชฝ ๊ฐ์ง๊ฐ ๊ธฐ๋กํ๋ค)."""
import os
import shutil
import subprocess
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parents[1]
# ๋ทฐ์ด ๋น๋์ ๊ฐ์ ์ปดํ์ผ๋ฌ (conda gcc 12, $CXX). ์์คํ
g++ 9 ๋ C++20 ์ ๋ชจ๋ฅธ๋ค
CXX = os.environ.get("CXX") or "g++"
@pytest.mark.skipif(shutil.which(CXX) is None, reason="g++ ์์")
def test_render_graph(tmp_path):
exe = tmp_path / "t"
inc = [str(ROOT / "src/vkgs/src"), str(ROOT / "third_party")]
if os.environ.get("CONDA_PREFIX"):
inc.append(os.environ["CONDA_PREFIX"] + "/include")
subprocess.run([CXX, "-std=c++20", "-O1", *(f"-I{d}" for d in inc),
str(ROOT / "tests/cpp/test_render_graph.cpp"), str(ROOT / "src/vkgs/src/render_graph.cpp"),
"-o", str(exe)], check=True)
r = subprocess.run([str(exe), str(ROOT / "configs/render_graph.json")], capture_output=True, text=True)
assert r.returncode == 0, r.stdout + r.stderr
|