]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/test.rs
Various minor/cosmetic improvements to code
[rust.git] / src / bootstrap / test.rs
index c50e6a270339f8354b63eaf6a8eef748e7e70bbb..eaffc9df1f03139f2ef7e083570a3121847609ce 100644 (file)
@@ -839,12 +839,6 @@ fn run(self, builder: &Builder) {
     suite: "compile-fail-fulldeps"
 });
 
-host_test!(IncrementalFullDeps {
-    path: "src/test/incremental-fulldeps",
-    mode: "incremental",
-    suite: "incremental-fulldeps"
-});
-
 host_test!(Rustdoc {
     path: "src/test/rustdoc",
     mode: "rustdoc",
@@ -977,11 +971,16 @@ fn run(self, builder: &Builder) {
         }
 
         if builder.no_std(target) == Some(true) {
-            // for no_std run-make (e.g. thumb*),
+            // for no_std run-make (e.g., thumb*),
             // we need a host compiler which is called by cargo.
             builder.ensure(compile::Std { compiler, target: compiler.host });
         }
 
+        // HACK(eddyb) ensure that `libproc_macro` is available on the host.
+        builder.ensure(compile::Test { compiler, target: compiler.host });
+        // Also provide `rust_test_helpers` for the host.
+        builder.ensure(native::TestHelpers { target: compiler.host });
+
         builder.ensure(native::TestHelpers { target });
         builder.ensure(RemoteCopyLibs { compiler, target });
 
@@ -1023,7 +1022,13 @@ fn run(self, builder: &Builder) {
             cmd.arg("--bless");
         }
 
-        let compare_mode = builder.config.cmd.compare_mode().or(self.compare_mode);
+        let compare_mode = builder.config.cmd.compare_mode().or_else(|| {
+            if builder.config.test_compare_mode {
+                self.compare_mode
+            } else {
+                None
+            }
+        });
 
         if let Some(ref nodejs) = builder.config.nodejs {
             cmd.arg("--nodejs").arg(nodejs);
@@ -1049,7 +1054,11 @@ fn run(self, builder: &Builder) {
             cmd.arg("--linker").arg(linker);
         }
 
-        let hostflags = flags.clone();
+        let mut hostflags = flags.clone();
+        hostflags.push(format!(
+            "-Lnative={}",
+            builder.test_helpers_out(compiler.host).display()
+        ));
         cmd.arg("--host-rustcflags").arg(hostflags.join(" "));
 
         let mut targetflags = flags;
@@ -1268,7 +1277,7 @@ fn should_run(run: ShouldRun) -> ShouldRun {
 
     /// Run `rustdoc --test` for all documentation in `src/doc`.
     ///
-    /// This will run all tests in our markdown documentation (e.g. the book)
+    /// This will run all tests in our markdown documentation (e.g., the book)
     /// located in `src/doc`. The `rustdoc` that's run is the one that sits next to
     /// `compiler`.
     fn run(self, builder: &Builder) {
@@ -1934,7 +1943,6 @@ fn run(self, builder: &Builder) {
                 .arg("generate-lockfile")
                 .arg("--manifest-path")
                 .arg(&toml)
-                .env("__CARGO_TEST_ROOT", &dir)
                 .current_dir(&dir),
         );
     }