[−][src]Crate test
test
)Support code for rustc's built in unit-test and micro-benchmarking framework.
Almost all user code will only be interested in Bencher
and
black_box
. All other interactions (such as writing tests and
benchmarks themselves) should be done via the #[test]
and
#[bench]
attributes.
See the Testing Chapter of the book for more details.
Re-exports
pub use self::ColorConfig::*; |
pub use self::TestFn::*; |
pub use self::TestName::*; |
pub use self::TestResult::*; |
Modules
bench | Experimental |
stats | Experimental |
test | Experimental |
time_constants | Experimental This small module contains constants used by |
Structs
BenchSamples | Experimental |
Bencher | Experimental Manager of the benchmarking runs. |
Metric | Experimental |
MetricMap | Experimental |
Options | Experimental In case we want to add other options as well, just add them in this struct. |
TestDesc | Experimental |
TestDescAndFn | Experimental |
TestExecTime | Experimental The meassured execution time of a unit test. |
TestOpts | Experimental |
TestTimeOptions | Experimental Structure with parameters for calculating test execution time. |
TimeThreshold | Experimental Structure denoting time limits for test execution. |
Enums
BenchMode | Experimental |
ColorConfig | Experimental |
Concurrent | Experimental Whether to execute tests concurrently or not |
NamePadding | Experimental |
OutputFormat | Experimental |
RunIgnored | Experimental |
RunStrategy | Experimental |
ShouldPanic | Experimental |
TestEvent | Experimental |
TestFn | Experimental |
TestName | Experimental |
TestResult | Experimental |
TestType | Experimental Type of the test according to the rust book conventions. |
Traits
TDynBenchFn | Experimental Represents a benchmark function. |
Functions
assert_test_result | Experimental Invoked when unit tests terminate. Should panic if the unit
Tests is considered a failure. By default, invokes |
black_box | Experimental An identity function that hints to the compiler to be maximally pessimistic about what
|
convert_benchmarks_to_tests | Experimental |
filter_tests | Experimental |
fmt_bench_samples | Experimental |
iter | Experimental |
list_tests_console | Experimental |
parse_opts | Experimental |
run_test | Experimental |
run_tests | Experimental |
run_tests_console | Experimental |
test_main | Experimental |
test_main_static | Experimental A variant optimized for invocation with a static test vector. This will panic (intentionally) when fed any dynamic tests. |
test_main_static_abort | Experimental A variant optimized for invocation with a static test vector. This will panic (intentionally) when fed any dynamic tests. |
Type Definitions
MonitorMsg | Experimental |
OptRes | Experimental Result of parsing the options. |