From b2192ae157eab3b83d7cbc42d2e08925cbdfd8b6 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 1 Apr 2018 21:06:35 +0200 Subject: Add rustdoc-ui test suite --- src/bootstrap/builder.rs | 2 +- src/bootstrap/test.rs | 28 +++++++++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 7ff64af9196..d30933d2efd 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -326,7 +326,7 @@ impl<'a> Builder<'a> { test::TheBook, test::UnstableBook, test::Rustfmt, test::Miri, test::Clippy, test::RustdocJS, test::RustdocTheme, // Run run-make last, since these won't pass without make on Windows - test::RunMake), + test::RunMake, test::RustdocUi), Kind::Bench => describe!(test::Crate, test::CrateLibrustc), Kind::Doc => describe!(doc::UnstableBook, doc::UnstableBookGen, doc::TheBook, doc::Standalone, doc::Std, doc::Test, doc::WhitelistedRustc, doc::Rustc, diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index e7610976f8e..992dec5217d 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -886,8 +886,12 @@ impl Step for Compiletest { cmd.arg("--run-lib-path").arg(builder.sysroot_libdir(compiler, target)); cmd.arg("--rustc-path").arg(builder.rustc(compiler)); + let is_rustdoc_ui = suite.ends_with("rustdoc-ui"); + // Avoid depending on rustdoc when we don't need it. - if mode == "rustdoc" || (mode == "run-make" && suite.ends_with("fulldeps")) { + if mode == "rustdoc" || + (mode == "run-make" && suite.ends_with("fulldeps")) || + (mode == "ui" && is_rustdoc_ui) { cmd.arg("--rustdoc-path").arg(builder.rustdoc(compiler.host)); } @@ -903,14 +907,24 @@ impl Step for Compiletest { cmd.arg("--nodejs").arg(nodejs); } - let mut flags = vec!["-Crpath".to_string()]; - if build.config.rust_optimize_tests { - flags.push("-O".to_string()); + let mut flags = if is_rustdoc_ui { + Vec::new() + } else { + vec!["-Crpath".to_string()] + }; + if !is_rustdoc_ui { + if build.config.rust_optimize_tests { + flags.push("-O".to_string()); + } + if build.config.rust_debuginfo_tests { + flags.push("-g".to_string()); + } } - if build.config.rust_debuginfo_tests { - flags.push("-g".to_string()); + if !is_rustdoc_ui { + flags.push("-Zmiri -Zunstable-options".to_string()); + } else { + flags.push("-Zunstable-options".to_string()); } - flags.push("-Zunstable-options".to_string()); flags.push(build.config.cmd.rustc_args().join(" ")); if let Some(linker) = build.linker(target) { -- cgit 1.4.1-3-g733a5