Skip to main contentModule doctest
Source use std::fs::File; π use std::hash::Hash; π use std::hash::Hash; π use std::hash::Hasher; π use std::io; π use std::io::Write; π use std::path::Path; π use std::path::PathBuf; π use std::process; π use std::process::Command; π use std::process::Stdio; π use std::str::FromStr; π use std::sync::atomic::AtomicUsize; π use std::sync::atomic::Ordering; π use std::sync::Arc; π use std::sync::Mutex; π use std::time::Duration; π use std::time::Instant; π use std::panic; π use std::panic; π use std::str; π pub(crate) use make::BuildDocTestBuilder; π pub(crate) use make::DocTestBuilder; π pub(crate) use markdown::test as test_markdown; π use proc_macro2::TokenStream; π use proc_macro2::TokenTree; π use rustc_attr_ir::Attribute; π use rustc_attr_ir::AttributeKind; π use rustc_data_structures::fx::FxHashMap; π use rustc_data_structures::fx::FxHashSet; π use rustc_data_structures::fx::FxHasher; π use rustc_data_structures::fx::FxIndexMap; π use rustc_data_structures::fx::FxIndexSet; π use rustc_errors::emitter::HumanReadableErrorType; π use rustc_errors::ColorConfig; π use rustc_errors::DiagCtxtHandle; π use rustc_hir::CRATE_HIR_ID; π use rustc_hir::def_id::LOCAL_CRATE; π use rustc_interface::interface; π use rustc_lint as lint; π use rustc_middle::ty::TyCtxt; π use rustc_session::config; π use rustc_session::config::ErrorOutputType; π use rustc_session::config::Input; π use rustc_span::edition::Edition; π use rustc_span::FileName; π use rustc_span::RemapPathScopeComponents; π use rustc_span::Span; π use rustc_structures::CrateType; π use rustc_target::spec::Target; π use rustc_target::spec::TargetTuple; π use tempfile::Builder as TempFileBuilder; π use tempfile::TempDir; π use tracing::debug; π use tracing::info; π use self::rust::HirCollector; π use crate::config::MergeDoctests; π use crate::config::Options as RustdocOptions; π use crate::config::OutputFormat; π use crate::html::markdown::CodeBlockPosition; π use crate::html::markdown::CodeLineMapping; π use crate::html::markdown::ErrorCodes; π use crate::html::markdown::Ignore; π use crate::html::markdown::LangString; π use crate::lint::init_lints; π
- extracted π
- Rustdocβs doctest extraction.
- make π
- Logic for transforming the raw code given by the user into something actually
runnable, e.g. by adding a
main function if it doesnβt already exist. - markdown π
- Doctest functionality used only for doctests in
.md Markdown files. - runner π
- rust π
- Doctest functionality used only for doctests in
.rs source files.
- CreateRunnableDocTests π
- GlobalTestOptions π
- Options that apply to all doctests in a crate or Markdown file (for
rustdoc foo.md). - IndividualTestOptions π
- MergeableTestKey π
- MergedDoctestTimes π
- Type used to display times (compilation and total) information for merged doctests.
- RunnableDocTest π
- Information needed for running a bundle of doctests.
- ScrapedDocTest π
- A doctest scraped from the code, ready to be turned into a runnable test.
- UnusedExterns π
- DirState π
- TestFailure π
- Documentation test failure modes.
- DocTestVisitor π
- add_exe_suffix π
- doctest_run_fn π
- generate_args_file π
- generate_test_desc_and_fn π
- get_doctest_dir π
- make_maybe_absolute_path π
- Converts a path intended to use as a command to absolute if it is
relative, and not a single component.
- run π
- run_test π
- Execute a
RunnableDoctest. - run_tests π
- scrape_test_config π
- wrapped_rustc_command π