Rename RustdocTestOptions into IndividualTestOptions

This commit is contained in:
Guillaume Gomez 2024-03-23 15:00:37 +01:00
parent 86fe40021f
commit 773084ff2f

View File

@ -382,7 +382,7 @@ fn run_test(
test: &str, test: &str,
crate_name: &str, crate_name: &str,
line: usize, line: usize,
rustdoc_options: RustdocTestOptions, rustdoc_options: IndividualTestOptions,
mut lang_string: LangString, mut lang_string: LangString,
no_run: bool, no_run: bool,
opts: &GlobalTestOptions, opts: &GlobalTestOptions,
@ -936,7 +936,7 @@ enum PartitionState {
(before, after, crates) (before, after, crates)
} }
pub(crate) struct RustdocTestOptions { pub(crate) struct IndividualTestOptions {
test_builder: Option<PathBuf>, test_builder: Option<PathBuf>,
test_builder_wrappers: Vec<PathBuf>, test_builder_wrappers: Vec<PathBuf>,
is_json_unused_externs_enabled: bool, is_json_unused_externs_enabled: bool,
@ -952,7 +952,7 @@ pub(crate) struct RustdocTestOptions {
test_id: String, test_id: String,
} }
impl RustdocTestOptions { impl IndividualTestOptions {
fn new(options: &RustdocOptions, arg_file: &Path, test_id: String) -> Self { fn new(options: &RustdocOptions, arg_file: &Path, test_id: String) -> Self {
let outdir = if let Some(ref path) = options.persist_doctests { let outdir = if let Some(ref path) = options.persist_doctests {
let mut path = path.clone(); let mut path = path.clone();
@ -1139,7 +1139,7 @@ fn add_test(&mut self, test: String, config: LangString, line: usize) {
); );
let rustdoc_test_options = let rustdoc_test_options =
RustdocTestOptions::new(&self.rustdoc_options, &self.arg_file, test_id); IndividualTestOptions::new(&self.rustdoc_options, &self.arg_file, test_id);
debug!("creating test {name}: {test}"); debug!("creating test {name}: {test}");
self.tests.push(test::TestDescAndFn { self.tests.push(test::TestDescAndFn {