#!/bin/bash # 跑验证智能体写的 9 个测试,看修复后还有哪些红的。 # # ⚠ 用文件重定向,不要接 PowerShell 管道 —— # docs-writer 踩过:管道捕获 + 并发会让进程被随机 kill, # 看起来像测试坏了。 set -u cd /c/Users/shu/Desktop/deepseekagent/LanRemote 2>/dev/null || \ cd "C:/Users/shu/Desktop/deepseekagent/LanRemote" echo "════════ 验证集 · 逐个跑 ════════" pass=0; fail=0; failed_list="" for t in _tests/test_verify_*.py; do [ -f "$t" ] || continue name=$(basename "$t") out=$(cmd //c "python -u $t > _build/_vt.txt 2>&1"; echo $?) # 取最后一行"通过 N 项,失败 M 项" line=$(grep -oE '通过 [0-9]+ 项,失败 [0-9]+ 项' _build/_vt.txt 2>/dev/null | tail -1) if [ "$out" = "0" ]; then printf " ✓ %-42s %s\n" "$name" "${line:-(退出码 0)}" pass=$((pass + 1)) else printf " ✗ %-42s 退出码 %s %s\n" "$name" "$out" "${line:-}" fail=$((fail + 1)) failed_list="$failed_list $name" # 打一点现场 tail -6 _build/_vt.txt 2>/dev/null | sed 's/^/ /' fi done echo echo " 通过 $pass 个,失败 $fail 个" [ -n "$failed_list" ] && echo " 失败的:$failed_list" rm -f _build/_vt.txt exit 0