Skip to main content

Module test_harness

Module test_harness 

Source

Re-exportsยง

use std::mem; ๐Ÿ”’
use std::sync::atomic::Ordering; ๐Ÿ”’
use rustc_ast as ast; ๐Ÿ”’
use rustc_ast::attr::contains_name; ๐Ÿ”’
use rustc_ast::entry::EntryPointType; ๐Ÿ”’
use rustc_ast::visit::Visitor; ๐Ÿ”’
use rustc_ast::GeneratedAttr; ๐Ÿ”’
use rustc_ast::ModKind; ๐Ÿ”’
use rustc_ast::attr; ๐Ÿ”’
use rustc_attr_ir::AttributeKind; ๐Ÿ”’
use rustc_attr_parsing::AttributeParser; ๐Ÿ”’
use rustc_expand::base::ExtCtxt; ๐Ÿ”’
use rustc_expand::base::ResolverExpand; ๐Ÿ”’
use rustc_expand::expand::AstFragment; ๐Ÿ”’
use rustc_expand::expand::ExpansionConfig; ๐Ÿ”’
use rustc_feature::Features; ๐Ÿ”’
use rustc_lint_defs::builtin::UNNAMEABLE_TEST_ITEMS; ๐Ÿ”’
use rustc_session::Session; ๐Ÿ”’
use rustc_span::hygiene::AstPass; ๐Ÿ”’
use rustc_span::hygiene::SyntaxContext; ๐Ÿ”’
use rustc_span::hygiene::Transparency; ๐Ÿ”’
use rustc_span::DUMMY_SP; ๐Ÿ”’
use rustc_span::Ident; ๐Ÿ”’
use rustc_span::Span; ๐Ÿ”’
use rustc_span::Symbol; ๐Ÿ”’
use rustc_span::sym; ๐Ÿ”’
use rustc_target::spec::PanicStrategy; ๐Ÿ”’
use smallvec::smallvec; ๐Ÿ”’
use thin_vec::ThinVec; ๐Ÿ”’
use thin_vec::thin_vec; ๐Ÿ”’
use tracing::debug; ๐Ÿ”’
use crate::diagnostics; ๐Ÿ”’
use rustc_ast::mut_visit::*; ๐Ÿ”’

Structsยง

EntryPointCleaner ๐Ÿ”’
A folder used to remove any entry points (like fn main) because the harness coroutine will provide its own
InnerItemLinter ๐Ÿ”’
Test ๐Ÿ”’
TestCtxt ๐Ÿ”’
TestHarnessGenerator ๐Ÿ”’

Functionsยง

add_main ๐Ÿ”’
Creates a function item for use as the main function of a test build. This function will call the test_runner as specified by the crate attribute
entry_point_type ๐Ÿ”’
generate_test_harness ๐Ÿ”’
Crawl over the crate, inserting test reexports and the test main function
get_test_name ๐Ÿ”’
get_test_runner ๐Ÿ”’
inject
Traverse the crate, collecting all the test functions, eliding any existing main functions, and synthesizing a main test harness
mk_tests_slice ๐Ÿ”’
Creates a slice containing every test like so: &[&test1, &test2]