2053f6d913
四篇讲「本项目怎么接 104」的文档原来散在子系统设计与网络两个目录, 和随库迁入的 36 篇协议库设计混在一起。现集中到 docs/iec60870/板端落地/: - IEC104上行设计说明.md(原 docs/子系统设计/) - IEC104_Net适配契约.md(原 docs/网络/) - IEC104_MCU落地规划.md(原 docs/子系统设计/) - IEC104_MCU最小可行性验证.md(原 docs/子系统设计/) 改动: - 四篇 git mv 保留历史,全库引用经 rename_ref.py 逐篇改写(27 个文件 54 处引用行),旧路径残留扫描为 0。 - docs/README.md:§5.3 改为「IEC 60870-5-104 文档(40 篇)」,拆成 「板端落地 4 篇」与「协议库设计与接口 36 篇」两张表,说明两条轴的分工; 从 §5.1 功能子系统表里移除这三篇的重复条目。 - docs/iec60870/README.md:新增两条轴入口与板端落地表,原阅读顺序 改标注为「协议库部分」。 验证: - check_doc_links.py --all --sections-strict:310 篇 0 问题。 - 三份索引 markdown 链接可达性逐个 exists() 校验,断链 0;索引表覆盖 36 篇协议库文档,与实际磁盘文件双向差集为空。 - 板端落地目录 4 篇 BOM / CR / U+FFFD 均为 0。 - 工作树 Keil 权威构建 0 errors 0 warnings(Code=365896 RO=48336 RW=2736 ZI=173104),此后预提交 21 Passed / 0 Failed。
45 lines
1.8 KiB
Python
45 lines
1.8 KiB
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
"""运行参数段(run_par,「数据可信」这一项)主机侧纯逻辑单元测试运行器(纯标准库)。
|
||
|
||
做什么:用本机 MSVC 离线编译 test/host/run_par/run_par_test.c(#include 纳入
|
||
run_par.c + cfg_file.c + adc_cal.c 真实链 + 内存虚拟盘桩),钉死 [run_par]
|
||
注册/工厂默认/落盘往返、104 地址映射两段式、k/b 覆盖直通 adc_cal 合法带、
|
||
生效值视图回显与 init 幂等。
|
||
|
||
用法(仓库根目录):
|
||
& '.venv\\Scripts\\python.exe' test/host/run_par/run_unit_test.py
|
||
|
||
退出码:0=PASS / 1=测试失败 / 2=环境错误。
|
||
|
||
设计依据:docs/算法/采集与算法层设计说明.md §13(运行参数段)+ docs/iec60870/板端落地/IEC104上行设计说明.md §3.4。
|
||
创建日期:2026-10-25(道D 运行参数段)
|
||
"""
|
||
import os
|
||
import sys
|
||
|
||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||
ROOT = os.path.dirname(os.path.dirname(os.path.dirname(HERE)))
|
||
sys.path.insert(0, os.path.join(ROOT, "test", "host", "common"))
|
||
|
||
from unit_test_harness import TestBuild, run_host_unit_test # noqa: E402
|
||
|
||
# 顺序敏感:stub 先于生产目录(dbg_log.h → 计数宏桩);App/cfg + App/log 真头
|
||
# 供 cfg_file.h / cfg_file_store.h / sys_log.h;adc_input_desc / syslog_post /
|
||
# cfg_store_* 内存虚拟盘由测试单元给强符号桩(同 adc_cal 套件先例)。
|
||
BUILD = TestBuild(
|
||
name="RunPar Layer Tests",
|
||
src=os.path.join(HERE, "run_par_test.c"),
|
||
include_dirs=[
|
||
os.path.join(HERE, "stub"),
|
||
os.path.join(ROOT, "App", "algo"),
|
||
os.path.join(ROOT, "App", "cfg"),
|
||
os.path.join(ROOT, "App", "log"),
|
||
HERE,
|
||
],
|
||
summary_marker="=== RunPar Tests:",
|
||
)
|
||
|
||
if __name__ == "__main__":
|
||
sys.exit(run_host_unit_test(BUILD))
|