【发布时间】:2020-09-04 10:15:43
【问题描述】:
我正在开发一个 Rust 板条箱,我想禁用一个特定目标架构 (wasm32) 的所有测试。我知道您可以使用 cfg 注释禁用特定源项:
#[cfg(not(target_arch="wasm32"))]
#[test]
fn only_compile_on_not_wasm32() {
...
}
但由于我想禁用所有测试,我想要一种更快的方法,最好是作为Cargo.toml 文件中的配置。箱子看起来像这样:
├── Cargo.toml
├── src
│ ├── ...
│ └── lib.rs
└── tests
├── ...
└── mod.rs
即我要禁用的测试存储在tests 目录中。
【问题讨论】:
标签: testing rust target-platform