s/DocTestsOption/DocTests/g

This commit is contained in:
kennytm 2018-05-06 03:30:42 +08:00
parent 169f58b712
commit 05af55bd80
No known key found for this signature in database
GPG Key ID: FEF6C8051D0E013C
4 changed files with 16 additions and 16 deletions

View File

@ -25,7 +25,7 @@ use compile;
use install;
use dist;
use util::{exe, libdir, add_lib_path};
use {Build, Mode, DocTestsOption};
use {Build, Mode, DocTests};
use cache::{INTERNER, Interned, Cache};
use check;
use test;
@ -591,7 +591,7 @@ impl<'a> Builder<'a> {
format!("{} {}", env::var("RUSTFLAGS").unwrap_or_default(), extra_args));
}
let want_rustdoc = self.doc_tests != DocTestsOption::No;
let want_rustdoc = self.doc_tests != DocTests::No;
// Customize the compiler we're running. Specify the compiler to cargo
// as our shim and then pass it some various options used to configure
@ -1415,7 +1415,7 @@ mod __test {
test_args: vec![],
rustc_args: vec![],
fail_fast: true,
doc_tests: DocTestsOption::No,
doc_tests: DocTests::No,
};
let build = Build::new(config);

View File

@ -19,7 +19,7 @@ use std::process;
use getopts::Options;
use {Build, DocTestsOption};
use {Build, DocTests};
use config::Config;
use metadata;
use builder::Builder;
@ -62,7 +62,7 @@ pub enum Subcommand {
test_args: Vec<String>,
rustc_args: Vec<String>,
fail_fast: bool,
doc_tests: DocTestsOption,
doc_tests: DocTests,
},
Bench {
paths: Vec<PathBuf>,
@ -326,11 +326,11 @@ Arguments:
rustc_args: matches.opt_strs("rustc-args"),
fail_fast: !matches.opt_present("no-fail-fast"),
doc_tests: if matches.opt_present("doc") {
DocTestsOption::Only
DocTests::Only
} else if matches.opt_present("no-doc") {
DocTestsOption::No
DocTests::No
} else {
DocTestsOption::Yes
DocTests::Yes
}
}
}
@ -418,10 +418,10 @@ impl Subcommand {
}
}
pub fn doc_tests(&self) -> DocTestsOption {
pub fn doc_tests(&self) -> DocTests {
match *self {
Subcommand::Test { doc_tests, .. } => doc_tests,
_ => DocTestsOption::Yes,
_ => DocTests::Yes,
}
}
}

View File

@ -211,7 +211,7 @@ pub struct Compiler {
}
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub enum DocTestsOption {
pub enum DocTests {
// Default, run normal tests and doc tests.
Yes,
// Do not run any doc tests.
@ -243,7 +243,7 @@ pub struct Build {
rustfmt_info: channel::GitInfo,
local_rebuild: bool,
fail_fast: bool,
doc_tests: DocTestsOption,
doc_tests: DocTests,
verbosity: usize,
// Targets for which to build.

View File

@ -32,7 +32,7 @@ use dist;
use native;
use tool::{self, Tool};
use util::{self, dylib_path, dylib_path_var};
use {Mode, DocTestsOption};
use {Mode, DocTests};
use toolstate::ToolState;
const ADB_TEST_DIR: &str = "/data/tmp/work";
@ -1520,13 +1520,13 @@ impl Step for Crate {
cargo.arg("--no-fail-fast");
}
match builder.doc_tests {
DocTestsOption::Only => {
DocTests::Only => {
cargo.arg("--doc");
}
DocTestsOption::No => {
DocTests::No => {
cargo.args(&["--lib", "--bins", "--examples", "--tests", "--benches"]);
}
DocTestsOption::Yes => {}
DocTests::Yes => {}
}
cargo.arg("-p").arg(krate);