#!/usr/bin/env python3
import subprocess,sys
from pathlib import Path
R=Path(__file__).resolve().parent

def run(cmd,expect=0,cwd=R):
    p=subprocess.run(cmd,cwd=cwd,text=True,capture_output=True)
    print(p.stdout.strip())
    assert p.returncode==expect,(cmd,p.returncode,p.stdout,p.stderr)

run([sys.executable,"verify.py"])
run([sys.executable,"verify.py","--tamper"])
run([sys.executable,"verify.py"],0)
control=R/"controls/synthetic_receipt_chain"
run([sys.executable,"verify.py"],0,control)
run([sys.executable,"test_verify.py"],0,control)
print("test_verify: PASS (v2 real capsule + v1-compatible synthetic control)")
