}
}
- _=> {
- let rust_src_root = self.find_rust_src_root()
- .expect("Could not find Rust source root");
+ _ => {
+ let rust_src_root = self.config.find_rust_src_root().expect(
+ "Could not find Rust source root",
+ );
let rust_pp_module_rel_path = Path::new("./src/etc");
let rust_pp_module_abs_path = rust_src_root.join(rust_pp_module_rel_path)
.to_str()
self.check_debugger_output(&debugger_run_result, &check_lines);
}
- fn find_rust_src_root(&self) -> Option<PathBuf> {
- let mut path = self.config.src_base.clone();
- let path_postfix = Path::new("src/etc/lldb_batchmode.py");
-
- while path.pop() {
- if path.join(&path_postfix).is_file() {
- return Some(path);
- }
- }
-
- None
- }
-
fn run_debuginfo_lldb_test(&self) {
assert!(self.revision.is_none(), "revisions not relevant here");
script_str.push_str("version\n");
// Switch LLDB into "Rust mode"
- let rust_src_root = self.find_rust_src_root().expect("Could not find Rust source root");
+ let rust_src_root = self.config.find_rust_src_root().expect(
+ "Could not find Rust source root",
+ );
let rust_pp_module_rel_path = Path::new("./src/etc/lldb_rust_formatters.py");
let rust_pp_module_abs_path = rust_src_root.join(rust_pp_module_rel_path)
.to_str()
None => {
if self.is_unexpected_compiler_message(actual_error, expect_help, expect_note) {
self.error(
- &format!("{}:{}: unexpected {:?}: '{}'",
+ &format!("{}:{}: unexpected {}: '{}'",
file_name,
actual_error.line_num,
actual_error.kind.as_ref()
.arg("-o").arg(out_dir)
.arg(&self.testpaths.file)
.args(&self.props.compile_flags);
+ if let Some(ref linker) = self.config.linker {
+ rustdoc.arg("--linker").arg(linker).arg("-Z").arg("unstable-options");
+ }
self.compose_and_run_compiler(rustdoc, None)
}
} else {
rustc.args(self.split_maybe_args(&self.config.target_rustcflags));
}
+ if let Some(ref linker) = self.config.linker {
+ rustc.arg(format!("-Clinker={}", linker));
+ }
rustc.args(&self.props.compile_flags);
if self.props.check_test_line_numbers_match {
self.check_rustdoc_test_option(proc_res);
} else {
- let root = self.find_rust_src_root().unwrap();
- let res = self.cmd2procres(Command::new(&self.config.docck_python)
- .arg(root.join("src/etc/htmldocck.py"))
- .arg(out_dir)
- .arg(&self.testpaths.file));
+ let root = self.config.find_rust_src_root().unwrap();
+ let res = self.cmd2procres(
+ Command::new(&self.config.docck_python)
+ .arg(root.join("src/etc/htmldocck.py"))
+ .arg(out_dir)
+ .arg(&self.testpaths.file),
+ );
if !res.status.success() {
self.fatal_proc_rec("htmldocck failed!", &res);
}
// Add an extra flag pointing at the incremental directory.
let mut revision_props = self.props.clone();
revision_props.incremental_dir = Some(incremental_dir);
- revision_props.compile_flags.push(String::from("-Zincremental-info"));
let revision_cx = TestCx {
config: self.config,
.env("LLVM_COMPONENTS", &self.config.llvm_components)
.env("LLVM_CXXFLAGS", &self.config.llvm_cxxflags);
+ if let Some(ref linker) = self.config.linker {
+ cmd.env("RUSTC_LINKER", linker);
+ }
+
// We don't want RUSTFLAGS set from the outside to interfere with
// compiler flags set in the test cases:
cmd.env_remove("RUSTFLAGS");
.env("CXX", &self.config.cxx);
} else {
cmd.env("CC", format!("{} {}", self.config.cc, self.config.cflags))
- .env("CXX", format!("{} {}", self.config.cxx, self.config.cflags));
+ .env("CXX", format!("{} {}", self.config.cxx, self.config.cflags))
+ .env("AR", &self.config.ar);
if self.config.target.contains("windows") {
cmd.env("IS_WINDOWS", "1");
fn normalize_output(&self, output: &str, custom_rules: &[(String, String)]) -> String {
let parent_dir = self.testpaths.file.parent().unwrap();
- let parent_dir_str = parent_dir.display().to_string();
+ let cflags = self.props.compile_flags.join(" ");
+ let parent_dir_str = if cflags.contains("--error-format json") {
+ parent_dir.display().to_string().replace("\\", "\\\\")
+ } else {
+ parent_dir.display().to_string()
+ };
+
let mut normalized = output.replace(&parent_dir_str, "$DIR")
+ .replace("\\\\", "\\") // denormalize for paths on windows
.replace("\\", "/") // normalize for paths on windows
.replace("\r\n", "\n") // normalize for linebreaks on windows
.replace("\t", "\\t"); // makes tabs visible