Implement WebAssembly runtime and kinematics coverage
This commit is contained in:
31
scripts/test_trt_report.py
Normal file
31
scripts/test_trt_report.py
Normal 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()
|
||||
Reference in New Issue
Block a user