about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-04-05 11:34:23 -0700
committerAlex Crichton <alex@alexcrichton.com>2016-04-18 16:30:01 -0700
commitb325baf0ae838c16eb554185bb8653189561dbc8 (patch)
tree637ca631b07fcdf5df610505ea62b51dc96736e2 /src/bootstrap
parentd00782494b47ca7a4ae8e665f99ab10012b45f9c (diff)
rustbuild: Add support for compiletest test suites
This commit adds support in rustbuild for running all of the compiletest test
suites as part of `make check`. The `compiletest` program was moved to
`src/tools` (like `rustbook` and others) and is now just compiled like any other
old tool. Each test suite has a pretty standard set of dependencies and just
tweaks various parameters to the final compiletest executable.

Note that full support is lacking in terms of:

* Once a test suite has passed, that's not remembered. When a test suite is
  requested to be run, it's always run.
* The arguments to compiletest probably don't work for every possible
  combination of platforms and testing environments just yet. There will likely
  need to be future updates to tweak various pieces here and there.
* Cross compiled test suites probably don't work just yet, support for that will
  come in a follow-up patch.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bootstrap.py2
-rw-r--r--src/bootstrap/build/check.rs53
-rw-r--r--src/bootstrap/build/clean.rs2
-rw-r--r--src/bootstrap/build/compile.rs9
-rw-r--r--src/bootstrap/build/dist.rs53
-rw-r--r--src/bootstrap/build/flags.rs5
-rw-r--r--src/bootstrap/build/mod.rs117
-rw-r--r--src/bootstrap/build/native.rs27
-rw-r--r--src/bootstrap/build/sanity.rs19
-rw-r--r--src/bootstrap/build/step.rs68
10 files changed, 309 insertions, 46 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 84b8ad333c1..d852bd82416 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -335,11 +335,11 @@ sys.stdout.flush()
 
 # Run the bootstrap
 args = [os.path.join(rb.build_dir, "bootstrap/debug/bootstrap")]
-args.extend(sys.argv[1:])
 args.append('--src')
 args.append(rb.rust_root)
 args.append('--build')
 args.append(rb.build)
+args.extend(sys.argv[1:])
 env = os.environ.copy()
 env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
 rb.run(args, env)
diff --git a/src/bootstrap/build/check.rs b/src/bootstrap/build/check.rs
index 6aad49bc988..f145a7149fb 100644
--- a/src/bootstrap/build/check.rs
+++ b/src/bootstrap/build/check.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 use std::fs;
+use std::path::PathBuf;
 
 use build::{Build, Compiler};
 
@@ -49,3 +50,55 @@ pub fn tidy(build: &Build, stage: u32, host: &str) {
     build.run(build.tool_cmd(&compiler, "tidy")
                    .arg(build.src.join("src")));
 }
+
+fn testdir(build: &Build, host: &str) -> PathBuf {
+    build.out.join(host).join("test")
+}
+
+pub fn compiletest(build: &Build,
+                   compiler: &Compiler,
+                   target: &str,
+                   mode: &str,
+                   suite: &str) {
+    let mut cmd = build.tool_cmd(compiler, "compiletest");
+
+    cmd.arg("--compile-lib-path").arg(build.rustc_libdir(compiler));
+    cmd.arg("--run-lib-path").arg(build.sysroot_libdir(compiler, target));
+    cmd.arg("--rustc-path").arg(build.compiler_path(compiler));
+    cmd.arg("--rustdoc-path").arg(build.rustdoc(compiler));
+    cmd.arg("--src-base").arg(build.src.join("src/test").join(suite));
+    cmd.arg("--aux-base").arg(build.src.join("src/test/auxiliary"));
+    cmd.arg("--build-base").arg(testdir(build, compiler.host).join(suite));
+    cmd.arg("--stage-id").arg(format!("stage{}-{}", compiler.stage, target));
+    cmd.arg("--mode").arg(mode);
+    cmd.arg("--target").arg(target);
+    cmd.arg("--host").arg(compiler.host);
+    cmd.arg("--llvm-filecheck").arg(build.llvm_filecheck(&build.config.build));
+
+    let linkflag = format!("-Lnative={}", build.test_helpers_out(target).display());
+    cmd.arg("--host-rustcflags").arg("-Crpath");
+    cmd.arg("--target-rustcflags").arg(format!("-Crpath {}", linkflag));
+
+    // FIXME: needs android support
+    cmd.arg("--android-cross-path").arg("");
+    // FIXME: CFG_PYTHON should probably be detected more robustly elsewhere
+    cmd.arg("--python").arg("python");
+
+    if let Some(ref vers) = build.gdb_version {
+        cmd.arg("--gdb-version").arg(vers);
+    }
+    if let Some(ref vers) = build.lldb_version {
+        cmd.arg("--lldb-version").arg(vers);
+    }
+    if let Some(ref dir) = build.lldb_python_dir {
+        cmd.arg("--lldb-python-dir").arg(dir);
+    }
+
+    cmd.args(&build.flags.args);
+
+    if build.config.verbose || build.flags.verbose {
+        cmd.arg("--verbose");
+    }
+
+    build.run(&mut cmd);
+}
diff --git a/src/bootstrap/build/clean.rs b/src/bootstrap/build/clean.rs
index 796d70bdecf..1f6538f5eae 100644
--- a/src/bootstrap/build/clean.rs
+++ b/src/bootstrap/build/clean.rs
@@ -25,8 +25,8 @@ pub fn clean(build: &Build) {
             rm_rf(build, &out.join(format!("stage{}", stage)));
             rm_rf(build, &out.join(format!("stage{}-std", stage)));
             rm_rf(build, &out.join(format!("stage{}-rustc", stage)));
-            rm_rf(build, &out.join(format!("stage{}-test", stage)));
             rm_rf(build, &out.join(format!("stage{}-tools", stage)));
+            rm_rf(build, &out.join(format!("stage{}-test", stage)));
         }
     }
 }
diff --git a/src/bootstrap/build/compile.rs b/src/bootstrap/build/compile.rs
index a67f1ba48b5..7a582d853d8 100644
--- a/src/bootstrap/build/compile.rs
+++ b/src/bootstrap/build/compile.rs
@@ -191,14 +191,7 @@ pub fn rustc<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
     if !build.unstable_features {
         cargo.env("CFG_DISABLE_UNSTABLE_FEATURES", "1");
     }
-    let target_config = build.config.target_config.get(target);
-    if let Some(ref s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
-        cargo.env("LLVM_CONFIG", s);
-    } else {
-        let llvm_config = build.llvm_out(&build.config.build).join("bin")
-                               .join(exe("llvm-config", target));
-        cargo.env("LLVM_CONFIG", llvm_config);
-    }
+    cargo.env("LLVM_CONFIG", build.llvm_config(target));
     if build.config.llvm_static_stdcpp {
         cargo.env("LLVM_STATIC_STDCPP",
                   compiler_file(build.cxx(target), "libstdc++.a"));
diff --git a/src/bootstrap/build/dist.rs b/src/bootstrap/build/dist.rs
index 6ae652bd66d..f2e3117fa97 100644
--- a/src/bootstrap/build/dist.rs
+++ b/src/bootstrap/build/dist.rs
@@ -195,29 +195,7 @@ pub fn rustc(build: &Build, stage: u32, host: &str) {
         cp_r(&build.src.join("man"), &image.join("share/man/man1"));
 
         // Debugger scripts
-        let cp_debugger_script = |file: &str| {
-            let dst = image.join("lib/rustlib/etc");
-            t!(fs::create_dir_all(&dst));
-            install(&build.src.join("src/etc/").join(file), &dst, 0o644);
-        };
-        if host.contains("windows") {
-            // no debugger scripts
-        } else if host.contains("darwin") {
-            // lldb debugger scripts
-            install(&build.src.join("src/etc/rust-lldb"), &image.join("bin"),
-                    0o755);
-
-            cp_debugger_script("lldb_rust_formatters.py");
-            cp_debugger_script("debugger_pretty_printers_common.py");
-        } else {
-            // gdb debugger scripts
-            install(&build.src.join("src/etc/rust-gdb"), &image.join("bin"),
-                    0o755);
-
-            cp_debugger_script("gdb_load_rust_pretty_printers.py");
-            cp_debugger_script("gdb_rust_pretty_printing.py");
-            cp_debugger_script("debugger_pretty_printers_common.py");
-        }
+        debugger_scripts(build, &image, host);
 
         // Misc license info
         let cp = |file: &str| {
@@ -231,6 +209,35 @@ pub fn rustc(build: &Build, stage: u32, host: &str) {
     }
 }
 
+pub fn debugger_scripts(build: &Build,
+                        sysroot: &Path,
+                        host: &str) {
+    let cp_debugger_script = |file: &str| {
+        let dst = sysroot.join("lib/rustlib/etc");
+        t!(fs::create_dir_all(&dst));
+        install(&build.src.join("src/etc/").join(file), &dst, 0o644);
+    };
+    if host.contains("windows") {
+        // no debugger scripts
+    } else if host.contains("darwin") {
+        // lldb debugger scripts
+        install(&build.src.join("src/etc/rust-lldb"), &sysroot.join("bin"),
+                0o755);
+
+        cp_debugger_script("lldb_rust_formatters.py");
+        cp_debugger_script("debugger_pretty_printers_common.py");
+    } else {
+        // gdb debugger scripts
+        install(&build.src.join("src/etc/rust-gdb"), &sysroot.join("bin"),
+                0o755);
+
+        cp_debugger_script("gdb_load_rust_pretty_printers.py");
+        cp_debugger_script("gdb_rust_pretty_printing.py");
+        cp_debugger_script("debugger_pretty_printers_common.py");
+    }
+}
+
+
 pub fn std(build: &Build, compiler: &Compiler, target: &str) {
     println!("Dist std stage{} ({} -> {})", compiler.stage, compiler.host,
              target);
diff --git a/src/bootstrap/build/flags.rs b/src/bootstrap/build/flags.rs
index d91dfe0903d..67f33e29cae 100644
--- a/src/bootstrap/build/flags.rs
+++ b/src/bootstrap/build/flags.rs
@@ -62,11 +62,6 @@ impl Flags {
             usage(0);
         }
 
-        if m.free.len() > 0 {
-            println!("free arguments are not currently accepted");
-            usage(1);
-        }
-
         let cfg_file = m.opt_str("config").map(PathBuf::from).or_else(|| {
             if fs::metadata("config.toml").is_ok() {
                 Some(PathBuf::from("config.toml"))
diff --git a/src/bootstrap/build/mod.rs b/src/bootstrap/build/mod.rs
index 4f0bfb84344..e755416f17f 100644
--- a/src/bootstrap/build/mod.rs
+++ b/src/bootstrap/build/mod.rs
@@ -80,6 +80,11 @@ pub struct Build {
     package_vers: String,
     bootstrap_key: String,
 
+    // Probed tools at runtime
+    gdb_version: Option<String>,
+    lldb_version: Option<String>,
+    lldb_python_dir: Option<String>,
+
     // Runtime state filled in later on
     cc: HashMap<String, (gcc::Tool, PathBuf)>,
     cxx: HashMap<String, gcc::Tool>,
@@ -128,6 +133,9 @@ impl Build {
             cc: HashMap::new(),
             cxx: HashMap::new(),
             compiler_rt_built: RefCell::new(HashMap::new()),
+            gdb_version: None,
+            lldb_version: None,
+            lldb_python_dir: None,
         }
     }
 
@@ -160,6 +168,9 @@ impl Build {
                 CompilerRt { _dummy } => {
                     native::compiler_rt(self, target.target);
                 }
+                TestHelpers { _dummy } => {
+                    native::test_helpers(self, target.target);
+                }
                 Libstd { compiler } => {
                     compile::std(self, target.target, &compiler);
                 }
@@ -200,6 +211,9 @@ impl Build {
                 ToolTidy { stage } => {
                     compile::tool(self, stage, target.target, "tidy");
                 }
+                ToolCompiletest { stage } => {
+                    compile::tool(self, stage, target.target, "compiletest");
+                }
                 DocBook { stage } => {
                     doc::rustbook(self, stage, target.target, "book", &doc_out);
                 }
@@ -236,12 +250,75 @@ impl Build {
                 CheckTidy { stage } => {
                     check::tidy(self, stage, target.target);
                 }
+                CheckRPass { compiler } => {
+                    check::compiletest(self, &compiler, target.target,
+                                       "run-pass", "run-pass");
+                }
+                CheckCFail { compiler } => {
+                    check::compiletest(self, &compiler, target.target,
+                                       "compile-fail", "compile-fail");
+                }
+                CheckPFail { compiler } => {
+                    check::compiletest(self, &compiler, target.target,
+                                       "parse-fail", "parse-fail");
+                }
+                CheckRFail { compiler } => {
+                    check::compiletest(self, &compiler, target.target,
+                                       "run-fail", "run-fail");
+                }
+                CheckPretty { compiler } => {
+                    check::compiletest(self, &compiler, target.target,
+                                       "pretty", "pretty");
+                }
+                CheckCodegen { compiler } => {
+                    check::compiletest(self, &compiler, target.target,
+                                       "codegen", "codegen");
+                }
+                CheckCodegenUnits { compiler } => {
+                    check::compiletest(self, &compiler, target.target,
+                                       "codegen-units", "codegen-units");
+                }
+                CheckDebuginfo { compiler } => {
+                    if target.target.contains("msvc") ||
+                       target.target.contains("android") {
+                        // nothing to do
+                    } else if target.target.contains("apple") {
+                        check::compiletest(self, &compiler, target.target,
+                                           "debuginfo-lldb", "debuginfo");
+                    } else {
+                        check::compiletest(self, &compiler, target.target,
+                                           "debuginfo-gdb", "debuginfo");
+                    }
+                }
+                CheckRustdoc { compiler } => {
+                    check::compiletest(self, &compiler, target.target,
+                                       "rustdoc", "rustdoc");
+                }
+                CheckRPassValgrind { compiler } => {
+                    check::compiletest(self, &compiler, target.target,
+                                       "run-pass-valgrind", "run-pass-valgrind");
+                }
+                CheckRPassFull { compiler } => {
+                    check::compiletest(self, &compiler, target.target,
+                                       "run-pass", "run-pass-fulldeps");
+                }
+                CheckCFailFull { compiler } => {
+                    check::compiletest(self, &compiler, target.target,
+                                       "compile-fail", "compile-fail-fulldeps")
+                }
 
                 DistDocs { stage } => dist::docs(self, stage, target.target),
                 DistMingw { _dummy } => dist::mingw(self, target.target),
                 DistRustc { stage } => dist::rustc(self, stage, target.target),
                 DistStd { compiler } => dist::std(self, &compiler, target.target),
 
+                DebuggerScripts { stage } => {
+                    let compiler = Compiler::new(stage, target.target);
+                    dist::debugger_scripts(self,
+                                           &self.sysroot(&compiler),
+                                           target.target);
+                }
+
                 Dist { .. } |
                 Doc { .. } | // pseudo-steps
                 Check { .. } => {}
@@ -388,6 +465,7 @@ impl Build {
             self.cargo_out(compiler, Mode::Libstd, host).join("deps"),
             self.cargo_out(compiler, Mode::Libtest, host).join("deps"),
             self.cargo_out(compiler, Mode::Librustc, host).join("deps"),
+            self.cargo_out(compiler, Mode::Tool, host).join("deps"),
         ];
         add_lib_path(paths, &mut cmd);
         return cmd
@@ -442,7 +520,8 @@ impl Build {
         let suffix = match mode {
             Mode::Libstd => "-std",
             Mode::Libtest => "-test",
-            Mode::Tool | Mode::Librustc => "-rustc",
+            Mode::Tool => "-tools",
+            Mode::Librustc => "-rustc",
         };
         self.out.join(compiler.host)
                 .join(format!("stage{}{}", compiler.stage, suffix))
@@ -463,11 +542,44 @@ impl Build {
         self.out.join(target).join("llvm")
     }
 
+    /// Returns the path to `llvm-config` for the specified target
+    fn llvm_config(&self, target: &str) -> PathBuf {
+        let target_config = self.config.target_config.get(target);
+        if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
+            s.clone()
+        } else {
+            self.llvm_out(&self.config.build).join("bin")
+                .join(exe("llvm-config", target))
+        }
+    }
+
+    /// Returns the path to `llvm-config` for the specified target
+    fn llvm_filecheck(&self, target: &str) -> PathBuf {
+        let target_config = self.config.target_config.get(target);
+        if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
+            s.parent().unwrap().join(exe("FileCheck", target))
+        } else {
+            let base = self.llvm_out(&self.config.build).join("build");
+            let exe = exe("FileCheck", target);
+            if self.config.build.contains("msvc") {
+                base.join("Release/bin").join(exe)
+            } else {
+                base.join("bin").join(exe)
+            }
+        }
+    }
+
     /// Root output directory for compiler-rt compiled for `target`
     fn compiler_rt_out(&self, target: &str) -> PathBuf {
         self.out.join(target).join("compiler-rt")
     }
 
+    /// Root output directory for rust_test_helpers library compiled for
+    /// `target`
+    fn test_helpers_out(&self, target: &str) -> PathBuf {
+        self.out.join(target).join("rust-test-helpers")
+    }
+
     fn add_rustc_lib_path(&self, compiler: &Compiler, cmd: &mut Command) {
         // Windows doesn't need dylib path munging because the dlls for the
         // compiler live next to the compiler and the system will find them
@@ -510,8 +622,11 @@ impl Build {
     }
 
     fn cflags(&self, target: &str) -> Vec<String> {
+        // Filter out -O and /O (the optimization flags) that we picked up from
+        // gcc-rs because the build scripts will determine that for themselves.
         let mut base = self.cc[target].0.args().iter()
                            .map(|s| s.to_string_lossy().into_owned())
+                           .filter(|s| !s.starts_with("-O") && !s.starts_with("/O"))
                            .collect::<Vec<_>>();
 
         // If we're compiling on OSX then we add a few unconditional flags
diff --git a/src/bootstrap/build/native.rs b/src/bootstrap/build/native.rs
index 91bc0924b1f..59c928ab7b7 100644
--- a/src/bootstrap/build/native.rs
+++ b/src/bootstrap/build/native.rs
@@ -14,9 +14,10 @@ use std::fs;
 
 use build_helper::output;
 use cmake;
+use gcc;
 
 use build::Build;
-use build::util::{exe, staticlib};
+use build::util::{exe, staticlib, up_to_date};
 
 pub fn llvm(build: &Build, target: &str) {
     // If we're using a custom LLVM bail out here, but we can only use a
@@ -152,9 +153,7 @@ pub fn compiler_rt(build: &Build, target: &str) {
     }
     let _ = fs::remove_dir_all(&dst);
     t!(fs::create_dir_all(&dst));
-    let build_llvm_config = build.llvm_out(&build.config.build)
-                                 .join("bin")
-                                 .join(exe("llvm-config", &build.config.build));
+    let build_llvm_config = build.llvm_config(&build.config.build);
     let mut cfg = cmake::Config::new(build.src.join("src/compiler-rt"));
     cfg.target(target)
        .host(&build.config.build)
@@ -171,3 +170,23 @@ pub fn compiler_rt(build: &Build, target: &str) {
        .build_target(&build_target);
     cfg.build();
 }
+
+pub fn test_helpers(build: &Build, target: &str) {
+    let dst = build.test_helpers_out(target);
+    let src = build.src.join("src/rt/rust_test_helpers.c");
+    if up_to_date(&src, &dst.join("librust_test_helpers.a")) {
+        return
+    }
+
+    println!("Building test helpers");
+    t!(fs::create_dir_all(&dst));
+    let mut cfg = gcc::Config::new();
+    cfg.cargo_metadata(false)
+       .out_dir(&dst)
+       .target(target)
+       .host(&build.config.build)
+       .opt_level(0)
+       .debug(false)
+       .file(build.src.join("src/rt/rust_test_helpers.c"))
+       .compile("librust_test_helpers.a");
+}
diff --git a/src/bootstrap/build/sanity.rs b/src/bootstrap/build/sanity.rs
index 50fd9c24538..09e6e467b06 100644
--- a/src/bootstrap/build/sanity.rs
+++ b/src/bootstrap/build/sanity.rs
@@ -66,6 +66,12 @@ pub fn check(build: &mut Build) {
         need_cmd(build.cxx(host).as_ref());
     }
 
+    // Externally configured LLVM requires FileCheck to exist
+    let filecheck = build.llvm_filecheck(&build.config.build);
+    if !filecheck.starts_with(&build.out) && !filecheck.exists() {
+        panic!("filecheck executable {:?} does not exist", filecheck);
+    }
+
     for target in build.config.target.iter() {
         // Either can't build or don't want to run jemalloc on these targets
         if target.contains("rumprun") ||
@@ -134,4 +140,17 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
                    target);
         }
     }
+
+    let run = |cmd: &mut Command| {
+        cmd.output().map(|output| {
+            String::from_utf8_lossy(&output.stdout)
+                   .lines().next().unwrap()
+                   .to_string()
+        })
+    };
+    build.gdb_version = run(Command::new("gdb").arg("--version")).ok();
+    build.lldb_version = run(Command::new("lldb").arg("--version")).ok();
+    if build.lldb_version.is_some() {
+        build.lldb_python_dir = run(Command::new("lldb").arg("-P")).ok();
+    }
 }
diff --git a/src/bootstrap/build/step.rs b/src/bootstrap/build/step.rs
index 07cfb96c30d..a22b28a6cdd 100644
--- a/src/bootstrap/build/step.rs
+++ b/src/bootstrap/build/step.rs
@@ -52,6 +52,7 @@ macro_rules! targets {
             (tool_error_index, ToolErrorIndex { stage: u32 }),
             (tool_cargotest, ToolCargoTest { stage: u32 }),
             (tool_tidy, ToolTidy { stage: u32 }),
+            (tool_compiletest, ToolCompiletest { stage: u32 }),
 
             // Steps for long-running native builds. Ideally these wouldn't
             // actually exist and would be part of build scripts, but for now
@@ -61,6 +62,8 @@ macro_rules! targets {
             // with braces are unstable so we just pick something that works.
             (llvm, Llvm { _dummy: () }),
             (compiler_rt, CompilerRt { _dummy: () }),
+            (test_helpers, TestHelpers { _dummy: () }),
+            (debugger_scripts, DebuggerScripts { stage: u32 }),
 
             // Steps for various pieces of documentation that we can generate,
             // the 'doc' step is just a pseudo target to depend on a bunch of
@@ -81,6 +84,18 @@ macro_rules! targets {
             (check_linkcheck, CheckLinkcheck { stage: u32 }),
             (check_cargotest, CheckCargoTest { stage: u32 }),
             (check_tidy, CheckTidy { stage: u32 }),
+            (check_rpass, CheckRPass { compiler: Compiler<'a> }),
+            (check_rfail, CheckRFail { compiler: Compiler<'a> }),
+            (check_cfail, CheckCFail { compiler: Compiler<'a> }),
+            (check_pfail, CheckPFail { compiler: Compiler<'a> }),
+            (check_codegen, CheckCodegen { compiler: Compiler<'a> }),
+            (check_codegen_units, CheckCodegenUnits { compiler: Compiler<'a> }),
+            (check_debuginfo, CheckDebuginfo { compiler: Compiler<'a> }),
+            (check_rustdoc, CheckRustdoc { compiler: Compiler<'a> }),
+            (check_pretty, CheckPretty { compiler: Compiler<'a> }),
+            (check_rpass_valgrind, CheckRPassValgrind { compiler: Compiler<'a> }),
+            (check_rpass_full, CheckRPassFull { compiler: Compiler<'a> }),
+            (check_cfail_full, CheckCFailFull { compiler: Compiler<'a> }),
 
             // Distribution targets, creating tarballs
             (dist, Dist { stage: u32 }),
@@ -278,6 +293,8 @@ impl<'a> Step<'a> {
                 vec![self.llvm(()).target(&build.config.build)]
             }
             Source::Llvm { _dummy } => Vec::new(),
+            Source::TestHelpers { _dummy } => Vec::new(),
+            Source::DebuggerScripts { stage: _ } => Vec::new(),
 
             // Note that all doc targets depend on artifacts from the build
             // architecture, not the target (which is where we're generating
@@ -310,9 +327,23 @@ impl<'a> Step<'a> {
                      self.doc_std(stage),
                      self.doc_error_index(stage)]
             }
-            Source::Check { stage, compiler: _ } => {
-                vec![self.check_linkcheck(stage),
-                     self.dist(stage)]
+            Source::Check { stage, compiler } => {
+                vec![
+                    self.check_rpass(compiler),
+                    self.check_cfail(compiler),
+                    self.check_rfail(compiler),
+                    self.check_pfail(compiler),
+                    self.check_codegen(compiler),
+                    self.check_codegen_units(compiler),
+                    self.check_debuginfo(compiler),
+                    self.check_rustdoc(compiler),
+                    self.check_pretty(compiler),
+                    self.check_rpass_valgrind(compiler),
+                    self.check_rpass_full(compiler),
+                    self.check_cfail_full(compiler),
+                    self.check_linkcheck(stage),
+                    self.dist(stage),
+                ]
             }
             Source::CheckLinkcheck { stage } => {
                 vec![self.tool_linkchecker(stage), self.doc(stage)]
@@ -324,6 +355,34 @@ impl<'a> Step<'a> {
             Source::CheckTidy { stage } => {
                 vec![self.tool_tidy(stage)]
             }
+            Source::CheckRFail { compiler } |
+            Source::CheckPFail { compiler } |
+            Source::CheckCodegen { compiler } |
+            Source::CheckCodegenUnits { compiler } |
+            Source::CheckRustdoc { compiler } |
+            Source::CheckPretty { compiler } |
+            Source::CheckCFail { compiler } |
+            Source::CheckRPassValgrind { compiler } |
+            Source::CheckRPass { compiler } => {
+                vec![
+                    self.libtest(compiler),
+                    self.tool_compiletest(compiler.stage),
+                    self.test_helpers(()),
+                ]
+            }
+            Source::CheckDebuginfo { compiler } => {
+                vec![
+                    self.libtest(compiler),
+                    self.tool_compiletest(compiler.stage),
+                    self.test_helpers(()),
+                    self.debugger_scripts(compiler.stage),
+                ]
+            }
+            Source::CheckRPassFull { compiler } |
+            Source::CheckCFailFull { compiler } => {
+                vec![self.librustc(compiler),
+                     self.tool_compiletest(compiler.stage)]
+            }
 
             Source::ToolLinkchecker { stage } |
             Source::ToolTidy { stage } => {
@@ -336,6 +395,9 @@ impl<'a> Step<'a> {
             Source::ToolCargoTest { stage } => {
                 vec![self.libstd(self.compiler(stage))]
             }
+            Source::ToolCompiletest { stage } => {
+                vec![self.libtest(self.compiler(stage))]
+            }
 
             Source::DistDocs { stage } => vec![self.doc(stage)],
             Source::DistMingw { _dummy: _ } => Vec::new(),