[][src]Crate test

🔬 This is a nightly-only experimental API. (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

benchExperimental
statsExperimental
testExperimental

Structs

BenchSamplesExperimental
BencherExperimental

Manager of the benchmarking runs.

MetricExperimental
MetricMapExperimental
OptionsExperimental

In case we want to add other options as well, just add them in this struct.

TestDescExperimental
TestDescAndFnExperimental
TestOptsExperimental

Enums

BenchModeExperimental
ColorConfigExperimental
ConcurrentExperimental

Whether to execute tests concurrently or not

NamePaddingExperimental
OutputFormatExperimental
RunIgnoredExperimental
ShouldPanicExperimental
TestEventExperimental
TestFnExperimental
TestNameExperimental
TestResultExperimental

Traits

TDynBenchFnExperimental

Represents a benchmark function.

Functions

assert_test_resultExperimental

Invoked when unit tests terminate. Should panic if the unit Tests is considered a failure. By default, invokes report() and checks for a 0 result.

black_boxExperimental

An identity function that hints to the compiler to be maximally pessimistic about what black_box could do.

convert_benchmarks_to_testsExperimental
filter_testsExperimental
fmt_bench_samplesExperimental
iterExperimental
list_tests_consoleExperimental
parse_optsExperimental
run_testExperimental
run_testsExperimental
run_tests_consoleExperimental
test_mainExperimental
test_main_staticExperimental

Type Definitions

MonitorMsgExperimental
OptResExperimental

Result of parsing the options.