Rust STM32F103嵌入式开发教程之Defmt 单元测试8

安装依赖

  • flip-link:
cargo install flip-link
  • probe-run:
# make sure to install v0.2.0 or later
cargo install probe-run
  • cargo-generate(可选):
cargo install cargo-generate

运行测试

  • 运行这些单元测试
cargo test --lib

cargo test --target thumbv7m-none-eabi -p testsuite

cargo test --target thumbv7m-none-eabi -p testsuite probe-run -- --chip STM32F103C8
  • 集成测试

    集成测试驻留在该 tests 目录中;
    最初的一组集成测试位于 tests/integration.rs.
    cargo test --test integration 将运行这些集成测试。
    请注意,标志的参数–test 必须与目录中测试文件的名称匹配 tests。

cargo test --test integration

设备调试

# 完整指令
cargo run --target thumbv7m-none-eabi -p testsuite_replace_embed probe-run -- --chip STM32F103C8 trace

# 简写, 配置的有 `.cargo/config.toml` 文件
cargo run -p testsuite_replace_embed
# 别名
cargo rp testsuite_replace_embed

# 日志级别
DEFMT_LOG=trace cargo run -p testsuite_replace_embed

设置日志级别

export DEFMT_LOG=info

# or
DEFMT_LOG=trace cargo rb levels

相关文档

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值