mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 22:08:40 +00:00
29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
"""CPU-only unit tests for tools/buffer_store_probe.py (SHADER-364)."""
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
import unittest
|
|
|
|
REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
PROBE = os.path.join(REPO, "tools", "buffer_store_probe.py")
|
|
|
|
|
|
class BufferStoreProbeTests(unittest.TestCase):
|
|
def test_self_test(self):
|
|
proc = subprocess.run([sys.executable, "-I", PROBE, "--self-test"],
|
|
capture_output=True, text=True, check=False)
|
|
self.assertEqual(proc.returncode, 0, proc.stderr or proc.stdout)
|
|
self.assertIn("self-test OK", proc.stdout)
|
|
|
|
def test_non_gfx10_or_missing_oracle_exits_77(self):
|
|
env = {k: v for k, v in os.environ.items()
|
|
if not k.startswith("LEONIDA_HW_") and k != "LEONIDA_AMD_CLANG"}
|
|
env["LEONIDA_AMD_CLANG"] = os.path.join(REPO, "does_not_exist_clang")
|
|
proc = subprocess.run([sys.executable, "-I", PROBE], env=env,
|
|
capture_output=True, text=True, check=False)
|
|
self.assertEqual(proc.returncode, 77, proc.stderr or proc.stdout)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|