"""CTest driver proving the C++ reader consumes Python publisher generations.""" from __future__ import annotations import os import subprocess import sys import uuid ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, ROOT) from tracker.fake_pose import make_fake_pose # noqa: E402 from tracker.publisher import FrameContractPublisher # noqa: E402 def main() -> int: probe = sys.argv[1] name = f"kinect_seqlock_{uuid.uuid4().hex}" with FrameContractPublisher( depth_size=(32, 24), color_size=(32, 24), name=name, ) as publisher: for index in range(9): publisher.publish( make_fake_pose(index, image_width=32, image_height=24), None, ) result = subprocess.run( [probe, name], check=True, capture_output=True, text=True, ) print(result.stdout, end="") return 0 if "published=9 frame=9 slot_sequence=6" in result.stdout else 1 if __name__ == "__main__": raise SystemExit(main())