提交 399ab460 编写于 作者: B bors

Auto merge of #87851 - JohnTitor:rollup-odvmr47, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #87744 (Add x.py option to --force-rerun compiletest tests)
 - #87789 (Make vec-shrink-panic test compatible with v0 mangling)
 - #87833 (Fix typo -- "The" -> "They")
 - #87834 (Fix small typo)
 - #87838 (Document that fs::read_dir skips . and ..)
 - #87842 (Fix intra doc link in hidden doc of Iterator::__iterator_get_unchecked)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
...@@ -3452,7 +3452,7 @@ fn is_sorted_by_key<F, K>(self, f: F) -> bool ...@@ -3452,7 +3452,7 @@ fn is_sorted_by_key<F, K>(self, f: F) -> bool
self.map(f).is_sorted() self.map(f).is_sorted()
} }
/// See [TrustedRandomAccess] /// See [TrustedRandomAccess][super::super::TrustedRandomAccess]
// The unusual name is to avoid name collisions in method resolution // The unusual name is to avoid name collisions in method resolution
// see #76479. // see #76479.
#[inline] #[inline]
......
...@@ -2039,6 +2039,8 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> { ...@@ -2039,6 +2039,8 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
/// ///
/// The iterator will yield instances of [`io::Result`]`<`[`DirEntry`]`>`. /// The iterator will yield instances of [`io::Result`]`<`[`DirEntry`]`>`.
/// New errors may be encountered after an iterator is initially constructed. /// New errors may be encountered after an iterator is initially constructed.
/// Entries for the current and parent directories (typically `.` and `..`) are
/// skipped.
/// ///
/// # Platform-specific behavior /// # Platform-specific behavior
/// ///
......
...@@ -486,6 +486,7 @@ fn test_with_no_doc_stage0() { ...@@ -486,6 +486,7 @@ fn test_with_no_doc_stage0() {
fail_fast: true, fail_fast: true,
doc_tests: DocTests::No, doc_tests: DocTests::No,
bless: false, bless: false,
force_rerun: false,
compare_mode: None, compare_mode: None,
rustfix_coverage: false, rustfix_coverage: false,
pass: None, pass: None,
...@@ -527,6 +528,7 @@ fn test_exclude() { ...@@ -527,6 +528,7 @@ fn test_exclude() {
fail_fast: true, fail_fast: true,
doc_tests: DocTests::No, doc_tests: DocTests::No,
bless: false, bless: false,
force_rerun: false,
compare_mode: None, compare_mode: None,
rustfix_coverage: false, rustfix_coverage: false,
pass: None, pass: None,
...@@ -583,6 +585,7 @@ fn test_docs() { ...@@ -583,6 +585,7 @@ fn test_docs() {
fail_fast: true, fail_fast: true,
doc_tests: DocTests::Yes, doc_tests: DocTests::Yes,
bless: false, bless: false,
force_rerun: false,
compare_mode: None, compare_mode: None,
rustfix_coverage: false, rustfix_coverage: false,
pass: None, pass: None,
......
...@@ -102,6 +102,7 @@ pub enum Subcommand { ...@@ -102,6 +102,7 @@ pub enum Subcommand {
paths: Vec<PathBuf>, paths: Vec<PathBuf>,
/// Whether to automatically update stderr/stdout files /// Whether to automatically update stderr/stdout files
bless: bool, bless: bool,
force_rerun: bool,
compare_mode: Option<String>, compare_mode: Option<String>,
pass: Option<String>, pass: Option<String>,
run: Option<String>, run: Option<String>,
...@@ -284,6 +285,7 @@ pub fn parse(args: &[String]) -> Flags { ...@@ -284,6 +285,7 @@ pub fn parse(args: &[String]) -> Flags {
opts.optflag("", "no-doc", "do not run doc tests"); opts.optflag("", "no-doc", "do not run doc tests");
opts.optflag("", "doc", "only run doc tests"); opts.optflag("", "doc", "only run doc tests");
opts.optflag("", "bless", "update all stderr/stdout files of failing ui tests"); opts.optflag("", "bless", "update all stderr/stdout files of failing ui tests");
opts.optflag("", "force-rerun", "rerun tests even if the inputs are unchanged");
opts.optopt( opts.optopt(
"", "",
"compare-mode", "compare-mode",
...@@ -558,6 +560,7 @@ pub fn parse(args: &[String]) -> Flags { ...@@ -558,6 +560,7 @@ pub fn parse(args: &[String]) -> Flags {
"test" | "t" => Subcommand::Test { "test" | "t" => Subcommand::Test {
paths, paths,
bless: matches.opt_present("bless"), bless: matches.opt_present("bless"),
force_rerun: matches.opt_present("force-rerun"),
compare_mode: matches.opt_str("compare-mode"), compare_mode: matches.opt_str("compare-mode"),
pass: matches.opt_str("pass"), pass: matches.opt_str("pass"),
run: matches.opt_str("run"), run: matches.opt_str("run"),
...@@ -726,6 +729,13 @@ pub fn bless(&self) -> bool { ...@@ -726,6 +729,13 @@ pub fn bless(&self) -> bool {
} }
} }
pub fn force_rerun(&self) -> bool {
match *self {
Subcommand::Test { force_rerun, .. } => force_rerun,
_ => false,
}
}
pub fn rustfix_coverage(&self) -> bool { pub fn rustfix_coverage(&self) -> bool {
match *self { match *self {
Subcommand::Test { rustfix_coverage, .. } => rustfix_coverage, Subcommand::Test { rustfix_coverage, .. } => rustfix_coverage,
......
...@@ -1315,6 +1315,10 @@ fn run(self, builder: &Builder<'_>) { ...@@ -1315,6 +1315,10 @@ fn run(self, builder: &Builder<'_>) {
cmd.arg("--bless"); cmd.arg("--bless");
} }
if builder.config.cmd.force_rerun() {
cmd.arg("--force-rerun");
}
let compare_mode = let compare_mode =
builder.config.cmd.compare_mode().or_else(|| { builder.config.cmd.compare_mode().or_else(|| {
if builder.config.test_compare_mode { self.compare_mode } else { None } if builder.config.test_compare_mode { self.compare_mode } else { None }
......
...@@ -1937,7 +1937,7 @@ impl Visibility { ...@@ -1937,7 +1937,7 @@ impl Visibility {
Struct(VariantStruct), Struct(VariantStruct),
} }
/// Small wrapper around [`rustc_span::Span]` that adds helper methods /// Small wrapper around [`rustc_span::Span`] that adds helper methods
/// and enforces calling [`rustc_span::Span::source_callsite()`]. /// and enforces calling [`rustc_span::Span::source_callsite()`].
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
crate struct Span(rustc_span::Span); crate struct Span(rustc_span::Span);
......
...@@ -362,6 +362,9 @@ pub struct Config { ...@@ -362,6 +362,9 @@ pub struct Config {
pub nodejs: Option<String>, pub nodejs: Option<String>,
/// Path to a npm executable. Used for rustdoc GUI tests /// Path to a npm executable. Used for rustdoc GUI tests
pub npm: Option<String>, pub npm: Option<String>,
/// Whether to rerun tests even if the inputs are unchanged.
pub force_rerun: bool,
} }
impl Config { impl Config {
......
...@@ -144,6 +144,7 @@ pub fn parse_config(args: Vec<String>) -> Config { ...@@ -144,6 +144,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
"enable this to generate a Rustfix coverage file, which is saved in \ "enable this to generate a Rustfix coverage file, which is saved in \
`./<build_base>/rustfix_missing_coverage.txt`", `./<build_base>/rustfix_missing_coverage.txt`",
) )
.optflag("", "force-rerun", "rerun tests even if the inputs are unchanged")
.optflag("h", "help", "show this message") .optflag("h", "help", "show this message")
.reqopt("", "channel", "current Rust channel", "CHANNEL"); .reqopt("", "channel", "current Rust channel", "CHANNEL");
...@@ -289,6 +290,8 @@ fn make_absolute(path: PathBuf) -> PathBuf { ...@@ -289,6 +290,8 @@ fn make_absolute(path: PathBuf) -> PathBuf {
llvm_components: matches.opt_str("llvm-components").unwrap(), llvm_components: matches.opt_str("llvm-components").unwrap(),
nodejs: matches.opt_str("nodejs"), nodejs: matches.opt_str("nodejs"),
npm: matches.opt_str("npm"), npm: matches.opt_str("npm"),
force_rerun: matches.opt_present("force-rerun"),
} }
} }
...@@ -644,13 +647,15 @@ fn make_test(config: &Config, testpaths: &TestPaths, inputs: &Stamp) -> Vec<test ...@@ -644,13 +647,15 @@ fn make_test(config: &Config, testpaths: &TestPaths, inputs: &Stamp) -> Vec<test
let test_name = crate::make_test_name(config, testpaths, revision); let test_name = crate::make_test_name(config, testpaths, revision);
let mut desc = make_test_description(config, test_name, &test_path, src_file, cfg); let mut desc = make_test_description(config, test_name, &test_path, src_file, cfg);
// Ignore tests that already run and are up to date with respect to inputs. // Ignore tests that already run and are up to date with respect to inputs.
desc.ignore |= is_up_to_date( if !config.force_rerun {
config, desc.ignore |= is_up_to_date(
testpaths, config,
&early_props, testpaths,
revision.map(|s| s.as_str()), &early_props,
inputs, revision.map(|s| s.as_str()),
); inputs,
);
}
test::TestDescAndFn { desc, testfn: make_test_closure(config, testpaths, revision) } test::TestDescAndFn { desc, testfn: make_test_closure(config, testpaths, revision) }
}) })
.collect() .collect()
......
...@@ -129,7 +129,7 @@ enum FileEntry { ...@@ -129,7 +129,7 @@ enum FileEntry {
/// An HTML file. /// An HTML file.
/// ///
/// This includes the contents of the HTML file, and an optional set of /// This includes the contents of the HTML file, and an optional set of
/// HTML IDs. The IDs are used for checking fragments. The are computed /// HTML IDs. The IDs are used for checking fragments. They are computed
/// as-needed. The source is discarded (replaced with an empty string) /// as-needed. The source is discarded (replaced with an empty string)
/// after the file has been checked, to conserve on memory. /// after the file has been checked, to conserve on memory.
HtmlFile { source: Rc<String>, ids: RefCell<HashSet<String>> }, HtmlFile { source: Rc<String>, ids: RefCell<HashSet<String>> },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册