mirror of
https://git.triforceproject.com/triforce/source
synced 2026-11-19 16:20:01 -04:00
Triforce v0.2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
36
tests/test_native_suatom.py
Normal file
36
tests/test_native_suatom.py
Normal file
@@ -0,0 +1,36 @@
|
||||
"""Authored direct SUATOM fields exercise the real production lowering; no GPU or shader dump.
|
||||
|
||||
The same C++ cases also run through Maxwell/IR/SPIR-V in tests/native_suatom/CMakeLists.txt.
|
||||
"""
|
||||
import argparse
|
||||
import os
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
RUN_ALL_ARGS = ["--cxx", "clang++"]
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--cxx", default="clang++")
|
||||
args = parser.parse_args()
|
||||
flags = (subprocess.CREATE_NO_WINDOW | subprocess.BELOW_NORMAL_PRIORITY_CLASS) if os.name == "nt" else 0
|
||||
def run(command):
|
||||
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
||||
text=True, creationflags=flags)
|
||||
print(result.stdout, end="", flush=True)
|
||||
result.check_returncode()
|
||||
|
||||
with tempfile.TemporaryDirectory(prefix="native-suatom-") as tmp:
|
||||
exe = Path(tmp) / "fixture.exe"
|
||||
run([args.cxx, "-std=c++20", "-O1", "-DSUATOM_LOWERING_ONLY",
|
||||
"-I" + str(ROOT / "gpu/vk/compat"), "-I" + str(ROOT / "gpu/vk/eden"),
|
||||
str(ROOT / "tests/native_suatom.cpp"), "-o", str(exe)])
|
||||
run([str(exe)])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user