Crate test

source ·
🔬This is a nightly-only experimental API. (test)
Expand description

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

Modules

  • benchExperimental
    Benchmarking module.
  • cli 🔒 Experimental
    Module converting command-line arguments into test configuration.
  • console 🔒 Experimental
    Module providing interface for running tests in the console.
  • event 🔒 Experimental
    Module containing different events that can occur during tests execution process.
  • formatters 🔒 Experimental
  • helpers 🔒 Experimental
    Module with common helpers not directly related to tests but used in libtest.
  • options 🔒 Experimental
    Enums denoting options for test execution.
  • statsExperimental
  • term 🔒 Experimental
    Terminal formatting module.
  • testExperimental
  • test_result 🔒 Experimental
  • time 🔒 Experimental
    Module time contains everything related to the time measurement of unit tests execution. The purposes of this module:
  • types 🔒 Experimental
    Common types used by libtest.

Structs

  • FilteredTests 🔒 Experimental
  • OptionsExperimental
    Options for the test run defined by the caller (instead of CLI arguments). In case we want to add other options as well, just add them in this struct.
  • TestDescExperimental
  • TestDescAndFnExperimental
  • TestIdExperimental
  • TestOptsExperimental

Enums

Constants

Functions