refactor: production 解散+docs 并入 design+tests 归 game 三层收敛——active.md/roadmap/stage/review-mode 升根目录;qa 报告→design/qa(gate-checks/alpha 验收/任务书→research);docs/→design/dev+registry 并档+散提案→research;tests/→game/tests(空架子 README+示例,真测试在 game/smoke);game/tools→tools+样例输出→sim-data;qa-data→sim-data;design/ux→gdd/ux;删 loop-dashboard.html(可再生成)+route_overlay_preview(零引用);钩子三件+loop_dashboard/balance_verifier/render_sample_sheet 路径随迁;断链修复 12 文件,余 7 条全为搬前幽灵链
This commit is contained in:
1 parent
97e20d51fb
commit
7f24b640ea
179 files changed
+81
-579
No files matched your search
@@ -0,0 +1,37 @@
|
||||
# tests/unit/example_test.gd — 示例测试:项目测试协议的活样板(gate-check 硬性要求 ≥1 示例测试)
|
||||
# 运行:godot --headless --script tests/unit/example_test.gd
|
||||
# 协议要点(ADR-0004 + D2 冒烟协议):
|
||||
# extends SceneTree 以获得 quit(code);断言失败 → push_error + quit(1);全绿 → quit(0)
|
||||
# --script 模式无 autoload 且无全局标识符(裸引用 ConfigDB = parse error)——
|
||||
# 涉及表值的测试须显式实例化 ConfigDB,期望由表读值推导不写死
|
||||
# 第一个真实测试:复制本文件为 tests/unit/<system>/<system>_<feature>_test.gd 并替换占位断言
|
||||
extends SceneTree
|
||||
|
||||
func _init() -> void:
|
||||
var failures := 0
|
||||
failures += _check("headless SceneTree 协议可用(quit(code) 通道)", _test_headless_protocol())
|
||||
failures += _check("命名规范可执行:test_[scenario]_[expected]", _test_naming_convention_followed())
|
||||
if failures > 0:
|
||||
push_error("[example_test] %d 项失败" % failures)
|
||||
quit(1)
|
||||
return
|
||||
print("[example_test] all green")
|
||||
quit(0)
|
||||
|
||||
func _check(desc: String, ok: bool) -> int:
|
||||
if not ok:
|
||||
push_error("[example_test] FAIL: " + desc)
|
||||
return 1
|
||||
print("[example_test] PASS: " + desc)
|
||||
return 0
|
||||
|
||||
func _test_headless_protocol() -> bool:
|
||||
# 占位断言:验证脚本本身在 SceneTree 上下文可执行。
|
||||
# 真实测试写法示例(引用不执行):
|
||||
# var cfg := ConfigDBStub.new() # 显式实例化,非全局标识符
|
||||
# return cfg.action_economy.ap_per_round >= 1
|
||||
return true
|
||||
|
||||
func _test_naming_convention_followed() -> bool:
|
||||
# 占位断言:本文件函数名均以 test_ 前缀 + 场景_期望 结构(docs/code-conventions.md)
|
||||
return true
|
||||
Reference in new issue
Block a user