from pathlib import Path import subprocess,hashlib,json p=Path(__file__).resolve().parent subprocess.run(['g++','-O3','-std=c++17','count_hist.cpp','-o','count_hist'],cwd=p,check=True) r=subprocess.run([str(p/'count_hist')],cwd=p,check=True,capture_output=True) assert r.stdout==(p/'actual-reference.txt').read_bytes() (p/'reproduced-histograms.txt').write_bytes(r.stdout) subprocess.run(['python','check.py'],cwd=p,check=True) print('PASS: all 14 frozen histograms reproduced byte for byte')