Improve XML documentation coverage across src modules and sync generated analysis artifacts.

This commit is contained in:
Joseph Doherty
2026-03-14 03:56:58 -04:00
parent ba0d65317a
commit 46ead5ea9f
152 changed files with 2821 additions and 11284 deletions

View File

@@ -0,0 +1,41 @@
import json
import subprocess
import unittest
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
SNAPSHOT = ROOT / "snapshots" / "js-ordered-consume.dtp"
SCRIPT = ROOT / "tools" / "dtp_parse.py"
def walk(node):
yield node
for child in node.get("children", []):
yield from walk(child)
class DtpParserTests(unittest.TestCase):
def test_emits_machine_readable_call_tree(self):
result = subprocess.run(
["python3", str(SCRIPT), str(SNAPSHOT), "--stdout"],
cwd=ROOT,
capture_output=True,
text=True,
check=False,
)
self.assertEqual(result.returncode, 0, msg=result.stderr)
payload = json.loads(result.stdout)
self.assertIn("callTree", payload)
self.assertIn("hotspots", payload)
self.assertTrue(payload["callTree"]["children"])
self.assertTrue(payload["hotspots"]["inclusive"])
node_names = [node["name"] for node in walk(payload["callTree"])]
self.assertTrue(any(not name.startswith("[special:") for name in node_names))
if __name__ == "__main__":
unittest.main()