self.host,
"test",
"src/tools/cargo",
- SourceType::Submodule);
+ SourceType::Submodule,
+ &[]);
if !builder.fail_fast {
cargo.arg("--no-fail-fast");
host,
"test",
"src/tools/rls",
- SourceType::Submodule);
+ SourceType::Submodule,
+ &[]);
// Copy `src/tools/rls/test_data` to a writable drive.
let test_workspace_path = builder.out.join("rls-test-data");
host,
"test",
"src/tools/rustfmt",
- SourceType::Submodule);
+ SourceType::Submodule,
+ &[]);
let dir = testdir(builder, compiler.host);
t!(fs::create_dir_all(&dir));
host,
"test",
"src/tools/miri",
- SourceType::Submodule);
+ SourceType::Submodule,
+ &[]);
// miri tests need to know about the stage sysroot
cargo.env("MIRI_SYSROOT", builder.sysroot(compiler));
host,
"test",
"src/tools/clippy",
- SourceType::Submodule);
+ SourceType::Submodule,
+ &[]);
// clippy tests need to know about the stage sysroot
cargo.env("SYSROOT", builder.sysroot(compiler));
suite: "compile-fail"
});
-default_test!(ParseFail {
- path: "src/test/parse-fail",
- mode: "parse-fail",
- suite: "parse-fail"
-});
-
default_test!(RunFail {
path: "src/test/run-fail",
mode: "run-fail",
default_test!(Debuginfo {
path: "src/test/debuginfo",
- // What this runs varies depending on the native platform being apple
- mode: "debuginfo-XXX",
+ mode: "debuginfo",
suite: "debuginfo"
});
return;
}
- if mode == "debuginfo-XXX" {
- return if builder.config.build.contains("apple") {
- builder.ensure(Compiletest {
- mode: "debuginfo-lldb",
- ..self
- });
- } else {
- builder.ensure(Compiletest {
- mode: "debuginfo-gdb",
- ..self
- });
- };
+ if mode == "debuginfo" {
+ return builder.ensure(Compiletest {
+ mode: "debuginfo-both",
+ ..self
+ });
}
builder.ensure(dist::DebuggerScripts {
if let Some(ref gdb) = builder.config.gdb {
cmd.arg("--gdb").arg(gdb);
}
- if let Some(ref vers) = builder.lldb_version {
+
+ let run = |cmd: &mut Command| {
+ cmd.output().map(|output| {
+ String::from_utf8_lossy(&output.stdout)
+ .lines().next().unwrap_or_else(|| {
+ panic!("{:?} failed {:?}", cmd, output)
+ }).to_string()
+ })
+ };
+ let lldb_exe = if builder.config.lldb_enabled && !target.contains("emscripten") {
+ // Test against the lldb that was just built.
+ builder.llvm_out(target)
+ .join("bin")
+ .join("lldb")
+ } else {
+ PathBuf::from("lldb")
+ };
+ let lldb_version = Command::new(&lldb_exe)
+ .arg("--version")
+ .output()
+ .map(|output| { String::from_utf8_lossy(&output.stdout).to_string() })
+ .ok();
+ if let Some(ref vers) = lldb_version {
cmd.arg("--lldb-version").arg(vers);
- }
- if let Some(ref dir) = builder.lldb_python_dir {
- cmd.arg("--lldb-python-dir").arg(dir);
+ let lldb_python_dir = run(Command::new(&lldb_exe).arg("-P")).ok();
+ if let Some(ref dir) = lldb_python_dir {
+ cmd.arg("--lldb-python-dir").arg(dir);
+ }
}
// Get paths from cmd args
target,
test_kind.subcommand(),
"src/tools/rustdoc",
- SourceType::InTree);
+ SourceType::InTree,
+ &[]);
if test_kind.subcommand() == "test" && !builder.fail_fast {
cargo.arg("--no-fail-fast");
}