🔬This is a nightly-only experimental API. (
test
)Re-exports
pub use crate::assert_test_result;
Experimentalpub use crate::bench::Bencher;
Experimentalpub use crate::filter_tests;
Experimentalpub use crate::run_test;
Experimentalpub use crate::test_main;
Experimentalpub use crate::test_main_static;
Experimentalpub use crate::test_result::TrFailed;
Experimentalpub use crate::test_result::TrFailedMsg;
Experimentalpub use crate::test_result::TrIgnored;
Experimentalpub use crate::test_result::TrOk;
Experimentalpub use crate::types::DynTestFn;
Experimentalpub use crate::types::DynTestName;
Experimentalpub use crate::types::StaticBenchFn;
Experimentalpub use crate::types::StaticTestFn;
Experimentalpub use crate::types::StaticTestName;
Experimental
Structs
- MetricExperimental
- MetricMapExperimental
- OptionsExperimental调用者定义的测试运行的选项 (而不是 CLI 参数)。 如果我们还想添加其他选项,只需将其添加到此结构体中即可。
- TestDescExperimental
- TestDescAndFnExperimental
- TestExecTimeExperimental单元测试的测量执行时间。
- TestIdExperimental
- TestOptsExperimental
- TestTimeOptionsExperimental具有用于计算测试执行时间的参数的结构体。
Enums
- RunIgnoredExperimental是否应该运行被忽略的测试
- RunStrategyExperimental
- ShouldPanicExperimental是否期望对 panic 进行测试
- TestNameExperimental
- TestResultExperimental
- TestTypeExperimental根据 rust 书 约定的测试类型。
Functions
- parse_optsExperimental将命令行参数解析为测试选项。 如果请求了帮助,则返回
None
(因为我们仅显示帮助消息并且不运行测试),如果提供的参数不正确,则返回Some(Err(..))
,否则创建TestOpts
对象并返回它。