工程(ci远端化·阶段三): golden基线按平台各存——四张现行基线(棋盘三图+menu_boot)迁入windows/子目录, mac/待Mac端重制后入库; golden_compare.py按sys.platform自动拼平台子目录(缺本平台基线=fail-closed显式红并给重制指引, 禁静默绿); render_gate基线断言路径与golden_baseline_refresh写入落点全改平台子目录; gate_platform.sh新增gate_platform_id; 依据=用户裁跨平台逐像素必失配(字形/抗锯齿机制差异), 平台内部严格度不降
This commit is contained in:
1 parent
b3928f8167
commit
c28d01ccb0
9 files changed
+42
-12
No files matched your search
@@ -19,6 +19,14 @@ from PIL import Image, ImageChops
|
||||
TOLERANCE = 16 # 灰度差容差(单通道)
|
||||
FAIL_RATIO = 0.02 # changed 占比失败线
|
||||
|
||||
# 基线平台子目录:<黄金图根目录>/<windows|mac|linux>——渲染基线按平台各存(gate_platform_id 同口径),
|
||||
# 平台内部照常逐像素严格比对;跨平台不互比(字形/抗锯齿机制差异,2026-11-03 用户裁)。
|
||||
_PLAT = {"win32": "windows", "darwin": "mac"}.get(sys.platform, "linux")
|
||||
|
||||
|
||||
def plat_missing(base: Path) -> bool:
|
||||
return not (base / _PLAT).is_dir()
|
||||
|
||||
|
||||
def compare(base: Path, curr: Path, name: str, failures: list) -> None:
|
||||
pb, pc = base / name, curr / name
|
||||
@@ -48,6 +56,11 @@ def main() -> int:
|
||||
print("用法: python tools/golden_compare.py <黄金图目录> <新截图目录> [屏清单...]")
|
||||
return 1
|
||||
base, curr = Path(sys.argv[1]), Path(sys.argv[2])
|
||||
base = base / _PLAT
|
||||
if not base.is_dir():
|
||||
print("[golden] FAIL — 本平台(%s)基线目录未建:%s" % (_PLAT, base))
|
||||
print(" 处置:在该平台跑 tools/golden_baseline_refresh.sh 重制基线并提交(基线换代权限 Q6)")
|
||||
return 1
|
||||
shots = sys.argv[3:] or ["shot_menu.png", "shot_camp.png", "shot_level.png", "shot_battle.png"]
|
||||
failures = []
|
||||
for name in shots:
|
||||
|
||||
Reference in new issue
Block a user