Files
STM32F4-Base/test/README.md
T

41 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# test/ — 测试代码与主机端脚本
> 测试分两部分,**物理隔离**在两个子目录:
> - **`board/`** —— 板端测试套件(`.c/.h`,编入固件由 testTask 执行)
> - **`host/`** —— 主机端脚本(`.py`,PC 侧驱动板子并判读结果)
## 目录结构
| 目录 | 内容 | README |
|---|---|---|
| `board/` | 板端测试套件(编入 Keil 工程,占 RAM) | [`board/README.md`](board/README.md) |
| `host/` | PC 端测试/判读脚本(Python) | [`host/README.md`](host/README.md) |
## 运行方式
```bash
# @test 一键闭环(推荐)
& '.venv\Scripts\python.exe' test/host/run_boot_test.py
# 单独校验日志
& '.venv\Scripts\python.exe' test/host/verify_log.py <日志文件>
```
退出码约定:`0`=PASS / `1`=FAIL / `2`=采集或烧录错误 / `3`=用法或预检错误。
## ⚠️ 注意
- 本目录**被 pre-commit 门禁排除**(测试代码不受 C 规范约束)
- `board/` 套件占用 RAM,启用前先核算预算(见 `docs/内存管理/`)
- **Keil 工程已同步**:`board/` 下 7 个 `.c` 编入 `MDK-ARM/STM32F4-Demo.uvprojx`,
IncludePath 含 `../test/board`;移动文件须同步改工程文件
- 套件选择开关:`board/test_config.h` 的 `TEST_SUITE_*`(互斥,一次只启用一个)
- 测试缓冲用**分 Phase 复用静态缓冲**(避免 `L6406E` 溢出)
## 相关文档
- `docs/测试说明/测试开发标准流程.md` — L0~L3 分层与门禁决策表
- `docs/测试说明/自动化测试流程.md` — `@test` 细节与失败模式
- 各模块测试指南:`docs/测试说明/*_Test_Guide.md`
- `docs/测试说明/链路延迟测试说明.md`