use std::io::BufReader;
use std::path::{Path, PathBuf};
+use log::*;
+
use crate::common::{self, CompareMode, Config, Mode};
use crate::util;
NoMatch,
/// Match.
Match,
- /// Mode was DebugInfoBoth and this matched gdb.
+ /// Mode was DebugInfoGdbLldb and this matched gdb.
MatchGdb,
- /// Mode was DebugInfoBoth and this matched lldb.
+ /// Mode was DebugInfoGdbLldb and this matched lldb.
MatchLldb,
}
revisions: vec![],
};
- if config.mode == common::DebugInfoBoth {
+ if config.mode == common::DebugInfoGdbLldb {
if config.lldb_python_dir.is_none() {
props.ignore = props.ignore.no_lldb();
}
if config.gdb_version.is_none() {
props.ignore = props.ignore.no_gdb();
}
+ } else if config.mode == common::DebugInfoCdb {
+ if config.cdb.is_none() {
+ props.ignore = Ignore::Ignore;
+ }
}
+ let rustc_has_profiler_support = env::var_os("RUSTC_PROFILER_SUPPORT").is_some();
+ let rustc_has_sanitizer_support = env::var_os("RUSTC_SANITIZER_SUPPORT").is_some();
+
iter_header(testfile, None, &mut |ln| {
// we should check if any only-<platform> exists and if it exists
// and does not matches the current platform, skip the test
config.parse_needs_matching_clang(ln) {
props.ignore = Ignore::Ignore;
}
+
+ if !rustc_has_profiler_support &&
+ config.parse_needs_profiler_support(ln) {
+ props.ignore = Ignore::Ignore;
+ }
+
+ if !rustc_has_sanitizer_support &&
+ config.parse_needs_sanitizer_support(ln) {
+ props.ignore = Ignore::Ignore;
+ }
}
- if (config.mode == common::DebugInfoGdb || config.mode == common::DebugInfoBoth) &&
+ if (config.mode == common::DebugInfoGdb || config.mode == common::DebugInfoGdbLldb) &&
props.ignore.can_run_gdb() && ignore_gdb(config, ln) {
props.ignore = props.ignore.no_gdb();
}
- if (config.mode == common::DebugInfoLldb || config.mode == common::DebugInfoBoth) &&
+ if (config.mode == common::DebugInfoLldb || config.mode == common::DebugInfoGdbLldb) &&
props.ignore.can_run_lldb() && ignore_lldb(config, ln) {
props.ignore = props.ignore.no_lldb();
}
// directory as the test, but for backwards compatibility reasons
// we also check the auxiliary directory)
pub aux_builds: Vec<String>,
+ // A list of crates to pass '--extern-private name:PATH' flags for
+ // This should be a subset of 'aux_build'
+ // FIXME: Replace this with a better solution: https://github.com/rust-lang/rust/pull/54020
+ pub extern_private: Vec<String>,
// Environment settings to use for compiling
pub rustc_env: Vec<(String, String)>,
+ // Environment variables to unset prior to compiling.
+ // Variables are unset before applying 'rustc_env'.
+ pub unset_rustc_env: Vec<String>,
// Environment settings to use during execution
pub exec_env: Vec<(String, String)>,
// Lines to check if they appear in the expected debugger output
run_flags: None,
pp_exact: None,
aux_builds: vec![],
+ extern_private: vec![],
revisions: vec![],
rustc_env: vec![],
+ unset_rustc_env: vec![],
exec_env: vec![],
check_lines: vec![],
build_aux_docs: false,
self.aux_builds.push(ab);
}
+ if let Some(ep) = config.parse_extern_private(ln) {
+ self.extern_private.push(ep);
+ }
+
if let Some(ee) = config.parse_env(ln, "exec-env") {
self.exec_env.push(ee);
}
self.rustc_env.push(ee);
}
+ if let Some(ev) = config.parse_name_value_directive(ln, "unset-rustc-env") {
+ self.unset_rustc_env.push(ev);
+ }
+
if let Some(cl) = config.parse_check_line(ln) {
self.check_lines.push(cl);
}
.map(|r| r.trim().to_string())
}
+ fn parse_extern_private(&self, line: &str) -> Option<String> {
+ self.parse_name_value_directive(line, "extern-private")
+ }
+
fn parse_compile_flags(&self, line: &str) -> Option<String> {
self.parse_name_value_directive(line, "compile-flags")
}
self.parse_name_directive(line, "needs-matching-clang")
}
+ fn parse_needs_profiler_support(&self, line: &str) -> bool {
+ self.parse_name_directive(line, "needs-profiler-support")
+ }
+
+ fn parse_needs_sanitizer_support(&self, line: &str) -> bool {
+ self.parse_name_directive(line, "needs-sanitizer-support")
+ }
+
/// Parses a name-value directive which contains config-specific information, e.g., `ignore-x86`
/// or `normalize-stderr-32bit`.
fn parse_cfg_name_directive(&self, line: &str, prefix: &str) -> ParsedNameDirective {
ParsedNameDirective::Match
} else {
match self.mode {
- common::DebugInfoBoth => {
+ common::DebugInfoGdbLldb => {
if name == "gdb" {
ParsedNameDirective::MatchGdb
} else if name == "lldb" {
ParsedNameDirective::NoMatch
}
},
+ common::DebugInfoCdb => if name == "cdb" {
+ ParsedNameDirective::Match
+ } else {
+ ParsedNameDirective::NoMatch
+ },
common::DebugInfoGdb => if name == "gdb" {
ParsedNameDirective::Match
} else {