Implement WebAssembly runtime and kinematics coverage

This commit is contained in:
2026-08-21 06:04:48 +08:00
parent 5dd614c335
commit 554b72dae8
112 changed files with 47148 additions and 807 deletions

View File

@@ -0,0 +1,31 @@
import json
import unittest
from pathlib import Path
import generate_trt_report
ROOT = Path(__file__).resolve().parents[1]
class TrtReportTests(unittest.TestCase):
def test_contract(self):
report = json.loads((ROOT / "coverage/trt-kinematics.report.json").read_text(encoding="utf-8"))
self.assertEqual(report["schema"], "trt-kinematics-report.v1")
self.assertTrue(report["configuration_candidates"]["xyzac"]["scan"])
self.assertTrue(report["configuration_candidates"]["xyzbc"]["scan"])
self.assertTrue(report["samples"]["byte_identical_json"])
self.assertEqual(report["oracle"]["status"], "blocked")
def test_deterministic(self):
first = ROOT / "coverage/.trt-one.json"
second = ROOT / "coverage/.trt-two.json"
try:
self.assertEqual(generate_trt_report.generate(ROOT, first), generate_trt_report.generate(ROOT, second))
finally:
first.unlink(missing_ok=True)
second.unlink(missing_ok=True)
if __name__ == "__main__":
unittest.main()