Older systems: iOS 18+ / macOS 15+ via the older-API build; floating left stick; runeword required level; Mac keyboard, mouse and docs; clearer older-device dialog
This commit is contained in:
+19
-5
@@ -46,7 +46,7 @@ echo $$ > "$LOCK/pid"; echo "$ME" > "$LOCK/owner"; trap 'rm -rf "$LOCK"' EXIT
|
||||
mkdir -p "${DM_ROOT:-$HOME/dm-work}/run/verify/dm/accept"
|
||||
L=$(mktemp -d "${DM_ROOT:-$HOME/dm-work}/run/verify/dm/accept/$(date +%m%d_%H%M%S)_${TREE}_$$.XXXXXX") || { echo "ACCEPT RED 无法创建结果目录"; exit 1; }
|
||||
T0=$SECONDS
|
||||
SKIP=""; SCOPE="全量"
|
||||
SKIP=""; SCOPE="全量"; M3GATE=1 # M3GATE:老接口版(图形后端 DM_NVN_M3=1)的画面闸门跑不跑,见 ⑪ | M3GATE: whether the picture gate of the older-API build (graphics backend DM_NVN_M3=1) runs, see step 11
|
||||
if [ "${ACCEPT_ALL:-0}" != 1 ]; then
|
||||
ROOT=$(git -C "$HERE" rev-parse --show-toplevel 2>/dev/null); MB=$(git -C "$HERE" merge-base HEAD main 2>/dev/null)
|
||||
CH=""; [ -n "$ROOT" ] && [ -n "$MB" ] && CH=$( { git -C "$ROOT" diff --name-only --no-renames "$MB" HEAD; git -C "$ROOT" status --porcelain --no-renames | cut -c4-; } 2>/dev/null | sort -u | grep -v '^$') # --no-renames:改名按「删旧 + 加新」两条路径列,旧路径在别的目录时不会被漏掉 | --no-renames: a rename is listed as two paths, "delete old + add new", so the old path is not missed when it is in another directory
|
||||
@@ -62,7 +62,10 @@ if [ "${ACCEPT_ALL:-0}" != 1 ]; then
|
||||
elif ! printf '%s\n' "$CH" | grep -qvE '^(dm/gfx/|dm/ios/|docs/)|\.md$'; then SKIP="1 2 5 6 7 9"; SCOPE="改动只在 dm/gfx(及 dm/ios、文档)"; fi
|
||||
fi
|
||||
fi
|
||||
echo "SCOPE ${SCOPE}$([ -n "$SKIP" ] && echo ";跳过项序号 ${SKIP}(ACCEPT_ALL=1 强制全量)")"
|
||||
# ⑪ 老接口版画面闸门只在改动碰到图形层或宿主的图形 / 前端 / 构建文件时跑(动图形的人两条路都得验,别的线不多付这一分钟);读不出改动清单时照跑
|
||||
# The older-API picture gate (step 11) runs only when the change touches the graphics layer or the host's graphics / front-end / build files (whoever changes graphics must verify both paths, and other work does not pay this extra minute); when the list of changes cannot be read it runs anyway
|
||||
if [ "${ACCEPT_ALL:-0}" != 1 ] && [ -n "${CH:-}" ] && ! printf '%s\n' "$CH" | grep -qE '^dm/gfx/|^dm/host/(front|app_mac|touch_mac|memstat)[^/]*$|^dm/host/Makefile$|^dm/verify/(shotgate|hostshot|accept)'; then M3GATE=0; fi
|
||||
echo "SCOPE ${SCOPE}$([ -n "$SKIP" ] && echo ";跳过项序号 ${SKIP}(ACCEPT_ALL=1 强制全量)");老接口版画面闸门 $([ $M3GATE = 1 ] && echo 跑 || echo 本次改动不涉及,跳过)"
|
||||
[ "${ACCEPT_SCOPE_ONLY:-0}" = 1 ] && exit 0
|
||||
# 并行子项都调用增量make;先在锁内只构建一次,避免冷树多个链接器争写同一个dmhost/dSYM。
|
||||
# The parallel sub-items all invoke an incremental make; build once first inside the lock, so that on a cold tree several linkers do not compete to write the same dmhost/dSYM.
|
||||
@@ -192,13 +195,24 @@ item 9 "⑨ 功能用例 touchchain" "自动收集 script.txt + assert.py 用例
|
||||
PAGES=()
|
||||
[ "$MODE" = fast ] && PAGES=(camp_e stash wild charselect skilltree)
|
||||
PAGE_NAMES=${PAGES[*]:-$(cd "$HERE/shotgate_pages" && ls *.json | sed 's/\.json$//' | tr '\n' ' ')}
|
||||
item 3 "③ 画面闸门 shotgate ${MODE}(${PAGE_NAMES})" "每页对真值绿(结构 / 非黑 / 网格 / 命名区域 / 应有元素 / 宿主日志无【红】)" shotgate.log 'SHOTGATE_ALL' 1 "$HERE/shotgate.sh" "$OUT" ${PAGES[@]+"${PAGES[@]}"} &
|
||||
# ⑪ 老接口版画面闸门:同一批页面用老接口版宿主(make dmhost_m3)再过一遍。排在 ③ 后面串着跑,不和 ③ 抢宿主
|
||||
# Step 11, older-API picture gate: the same set of pages is run once more with the older-API host (make dmhost_m3). It runs serially after step 3 and does not compete with it for hosts
|
||||
m3_shotgate() {
|
||||
local name="⑪ 老接口版画面闸门 shotgate ${MODE}(DM_NVN_M3=1,${PAGE_NAMES})" want="老接口版宿主每页对真值绿"
|
||||
if [ $M3GATE != 1 ]; then printf '0\n| %s | %s | ⏭ 老接口版画面闸门:本次改动不涉及,跳过 | 0 秒 |\n' "$name" "$want" > "$L/11.row"; echo "⏭ ${name}(老接口版画面闸门:本次改动不涉及,跳过)"; return 0; fi
|
||||
case " $SKIP " in *" 3 "*) printf '0\n| %s | %s | ⏭ 跳过:%s | 0 秒 |\n' "$name" "$want" "$SCOPE" > "$L/11.row"; echo "⏭ ${name}(跳过:${SCOPE})"; return 0;; esac
|
||||
local s=$SECONDS rc=0
|
||||
{ make -s -C "$HERE/../host" dmhost_m3 && DM_HOST="$HERE/../host/dmhost_m3" "$HERE/shotgate.sh" "$OUT" ${PAGES[@]+"${PAGES[@]}"}; } > "$L/shotgate_m3.log" 2>&1 || rc=1
|
||||
local got=$(grep -E 'SHOTGATE_ALL' "$L/shotgate_m3.log" | tail -1) mark; [ $rc = 0 ] && mark="✅" || mark="🔴"
|
||||
printf '%s\n| %s | %s | %s %s | %s 秒 |\n' "$rc" "$name" "$want" "$mark" "${got:-(无读数行,见 shotgate_m3.log)}" "$((SECONDS - s))" > "$L/11.row"; echo "$mark ${name}($((SECONDS - s)) 秒)"
|
||||
}
|
||||
{ item 3 "③ 画面闸门 shotgate ${MODE}(${PAGE_NAMES})" "每页对真值绿(结构 / 非黑 / 网格 / 命名区域 / 应有元素 / 宿主日志无【红】)" shotgate.log 'SHOTGATE_ALL' 1 "$HERE/shotgate.sh" "$OUT" ${PAGES[@]+"${PAGES[@]}"}; m3_shotgate; } &
|
||||
unit_tests() { # ④ 宿主与图形单测(E:SHOT 合入后 gfx 单测链接失败,accept 却绿):任何失败或构建 / 链接错误即红 | (4) host and graphics unit tests (after E:SHOT was merged the gfx unit test failed to link, yet accept was green): any failure or build / link error is a failure
|
||||
local rc=0
|
||||
"${DM_ROOT:-$HOME/dm-work}/build/cache/dm/venv/bin/python" "$HERE/ryu/test_selfcmp.py" > "$L/unit_selfcmp.log" 2>&1 && echo "UNIT selfcmp 通过" || { echo "UNIT selfcmp 失败(见 unit_selfcmp.log)"; rc=1; }
|
||||
"${DM_ROOT:-$HOME/dm-work}/build/cache/dm/venv/bin/python" "$HERE/ryu/test_plan.py" > "$L/unit_plan.log" 2>&1 && echo "UNIT plan 通过" || { echo "UNIT plan 失败(见 unit_plan.log)"; rc=1; }
|
||||
make -j8 -C "$HERE/../host/tests" run > "$L/unit_host.log" 2>&1 && echo "UNIT host 通过" || { echo "UNIT host 失败:$(grep -m1 -iE 'error|fail|失败|红' "$L/unit_host.log" | cut -c1-140)"; rc=1; }
|
||||
make -j8 -C "$HERE/../gfx/tests" run > "$L/unit_gfx.log" 2>&1 && echo "UNIT gfx 通过" || { echo "UNIT gfx 失败:$(grep -m1 -iE 'error|fail|失败|红|undefined' "$L/unit_gfx.log" | cut -c1-140)"; rc=1; }
|
||||
make -j8 -C "$HERE/../gfx/tests" run > "$L/unit_gfx.log" 2>&1 && make -j8 -C "$HERE/../gfx/tests" run-m3 >> "$L/unit_gfx.log" 2>&1 && echo "UNIT gfx 通过" || { echo "UNIT gfx 失败:$(grep -m1 -iE 'error|fail|失败|红|undefined' "$L/unit_gfx.log" | cut -c1-140)"; rc=1; }
|
||||
# iOS 触摸层单测(这一套从没接进闸门,回城钮改版后红了一天没人看见)
|
||||
# iOS touch layer unit tests (this set was never wired into the gate check, and after the town portal button redesign it was red for a day without anyone seeing it)
|
||||
make -C "$HERE/../ios/tests" test > "$L/unit_ios.log" 2>&1 && echo "UNIT ios 通过" || { echo "UNIT ios 失败:$(grep -m1 -E 'FAIL|Error|error' "$L/unit_ios.log" | cut -c1-140)"; rc=1; }
|
||||
@@ -229,7 +243,7 @@ item 10 "⑩ 局内切运行模式 opmode" "切换前已进局;取走通知 30
|
||||
[ "$MODE" = full ] && item 6 "⑥ 存档事务 save_txn_regress" "4/4 注入命中;已提交文件同期望版;校验和自洽;残缺工作目录 / 拒绝日志负对照成立" save_txn.log '^✓|^✗|^结论|^SAVE_TXN' 6 bash "$HERE/../tools/save_txn_regress.sh" "$OUT" &
|
||||
wait
|
||||
allrc=0; rows=()
|
||||
ITEMS=(0 1 2 3 4 5 7 8 9 10); [ "$MODE" = full ] && ITEMS+=(6)
|
||||
ITEMS=(0 1 2 3 11 4 5 7 8 9 10); [ "$MODE" = full ] && ITEMS+=(6)
|
||||
for k in "${ITEMS[@]}"; do { read -r rc; read -r row; } < "$L/$k.row"; [ "$rc" = 0 ] || allrc=1; rows+=("$row"); done
|
||||
[ "$allrc" = 0 ] || echo "ACCEPT $MODE 红;本目录保留,不删不覆盖" > "$L/KEEP"
|
||||
echo; echo "| 项 | 期望 | 真结果 | 用时 |"; echo "|---|---|---|---|"; printf '%s\n' "${rows[@]}"
|
||||
|
||||
@@ -45,13 +45,14 @@ class AcceptTests(unittest.TestCase):
|
||||
'echo txn >> "$TRACE"; echo "结论:存档事务回归 4/4 绿"; exit "${TXN_RC:-0}"\n')
|
||||
for tree in ['host', 'gfx']:
|
||||
p = self.root / f'dm/{tree}/tests'; p.mkdir(parents=True)
|
||||
(p / 'Makefile').write_text('run:\n\t@echo OK\n')
|
||||
(p / 'Makefile').write_text('run:\n\t@echo OK\nrun-m3:\n\t@echo OK\n') # run-m3:图形层单测的老接口版那一遍(accept ④ 两遍都跑) | run-m3: the older-API pass of the graphics-layer unit tests (accept step 4 runs both passes)
|
||||
p = self.root / 'dm/ios/tests'; p.mkdir(parents=True) # iOS 触摸层单测(accept ④ 第六套)的替身 | Stand-in for the iOS touch layer unit tests (accept ④, sixth suite)
|
||||
(p / 'Makefile').write_text('test:\n\t@echo OK\n')
|
||||
(self.root / 'dm/host/Makefile').write_text(
|
||||
'all:\n\t@test "$${HOST_BUILD_RC:-0}" = 0\n'
|
||||
'\t@echo built >> "$$HOME/build-count"\n'
|
||||
'\t@touch "$$HOME/host-built"\n')
|
||||
'\t@touch "$$HOME/host-built"\n'
|
||||
'dmhost_m3:\n\t@true\n') # 老接口版宿主(accept ⑪ 用) | older-API host (used by accept step 11)
|
||||
for p in ['camp_e', 'stash', 'wild', 'charselect', 'skilltree', 'npc']:
|
||||
(self.verify / f'shotgate_pages/{p}.json').write_text('{}')
|
||||
|
||||
@@ -64,10 +65,27 @@ class AcceptTests(unittest.TestCase):
|
||||
return subprocess.run(['bash', str(self.verify / 'accept.sh'), *args],
|
||||
env=self.env, capture_output=True, text=True, errors='replace', timeout=10)
|
||||
|
||||
def test_m3_shotgate_runs_only_when_graphics_touched(self):
|
||||
# ⑪ 老接口版画面闸门按改动范围触发:碰图形层 / 宿主图形前端文件就跑,碰不到就跳过并写明(期望值按规则手写)
|
||||
# The older-API picture gate (step 11) is triggered by the scope of the change: it runs when graphics-layer / host graphics and front-end files are touched, and is skipped with a note otherwise (expected values written by hand from the rule)
|
||||
for ch, want in (('dm/gfx/nvn/nvn_mtl.m', '老接口版画面闸门 跑'), ('dm/host/front_mac.m dm/host/dm_rift.c', '老接口版画面闸门 跑'),
|
||||
('dm/host/Makefile', '老接口版画面闸门 跑'), ('dm/host/dm_rift.c dm/host/hle_fs.c', '老接口版画面闸门 本次改动不涉及,跳过'),
|
||||
('dm/ios/Sources/main.m docs/x.md', '老接口版画面闸门 本次改动不涉及,跳过')):
|
||||
r = self.run_accept('/fixture/out', ACCEPT_SCOPE_CH=ch, ACCEPT_SCOPE_ONLY='1')
|
||||
self.assertIn(want, r.stdout, ch)
|
||||
|
||||
def test_m3_shotgate_row_present(self):
|
||||
# 夹具不是 git 仓库、读不出改动清单 ⇒ 照跑:表里有 ⑪ 这一行,画面闸门脚本被调了两次(缺省宿主一次、老接口版宿主一次)
|
||||
# The fixture is not a git repository and no list of changes can be read => it runs anyway: the table has the step 11 row, and the picture-gate script is called twice (once with the default host, once with the older-API host)
|
||||
r = self.run_accept('/fixture/out')
|
||||
self.assertEqual(r.returncode, 0, r.stdout + r.stderr)
|
||||
self.assertIn('⑪ 老接口版画面闸门', r.stdout)
|
||||
self.assertEqual(self.trace.read_text().count('shot:'), 2, self.trace.read_text())
|
||||
|
||||
def test_fast_has_only_five_pages_and_no_transaction(self):
|
||||
r = self.run_accept('--fast', '/fixture/out')
|
||||
self.assertEqual(r.returncode, 0, r.stdout + r.stderr)
|
||||
self.assertEqual(self.trace.read_text().strip(), 'shot:/fixture/out camp_e stash wild charselect skilltree')
|
||||
self.assertEqual(self.trace.read_text().strip(), '\n'.join(['shot:/fixture/out camp_e stash wild charselect skilltree'] * 2)) # 两次:③ 缺省宿主、⑪ 老接口版宿主(夹具读不出改动清单 ⇒ 照跑),页面相同 | twice: step 3 with the default host, step 11 with the older-API host (the fixture cannot read a list of changes => it runs anyway), same pages
|
||||
|
||||
def test_full_runs_transaction_and_propagates_its_failure(self):
|
||||
r = self.run_accept('--full', '/fixture/out', TXN_RC='1')
|
||||
|
||||
Reference in New Issue
Block a user