test(迭代35卡①): fv4 致命子进程判据改三分退出码(0 静默/2 失效分支/其余非零=致命中止)——使「无解路径改返回空图」变异能让断言见红
This commit is contained in:
1 parent
63a6ea8055
commit
a039306f02
1 file changed
+5
-2
@@ -85,7 +85,10 @@ func _test_fatal_subprocess() -> void:
|
||||
var out := []
|
||||
var code: int = OS.execute(bin, ["--headless", "--path", game_dir, "--script",
|
||||
"res://tests/unit/core/node_map_growth_test.gd", "--", "fatal-fixture"], out, true)
|
||||
Kit.check("无解参数档产图进程致命中止(退出码非零,无残图交付)〔fv4〕", code != 0)
|
||||
# 退出码三分:0 = 子进程正常收尾(致命通道静默);2 = 无解后仍走完 quit(2) 的失效分支;
|
||||
# 其余非零(含 assert/OS.crash 中止码)=致命中止真实发生。
|
||||
print("[fv4] 无解子进程退出码 = %d" % code)
|
||||
Kit.check("无解参数档产图进程致命中止(退出码既非 0 亦非失效分支 2,无残图交付)〔fv4〕", code != 0 and code != 2)
|
||||
|
||||
|
||||
func _trigger_fatal() -> void:
|
||||
@@ -95,7 +98,7 @@ func _trigger_fatal() -> void:
|
||||
"rest_ratio": 0.2, "shop_ratio": 0.1, "entry_count": 1, "exit_count": 3, "battle_floor": 4,
|
||||
"fork_ways_min": 2, "fork_ways_max": 3}
|
||||
gen.generate(unsolvable, 42)
|
||||
# 走到这里=致命通道未止住(软回退缺陷)→ 显式退出码 2 与崩溃码区分
|
||||
# 走到这里=致命通道未止住(软回退缺陷)→ 显式退出码 2,父断言按「非 0 且非 2」判致命是否真发生
|
||||
push_error("[fatal-fixture] 参数无解未致命中止(fail-fast 失效回归)")
|
||||
quit(2)
|
||||
|
||||
|
||||
Reference in new issue
Block a user