Rename profiler_support to profiler_runtime throughout compiletest

This commit is contained in:
Zalathar 2024-10-09 14:03:10 +11:00
parent 622d5898c2
commit 8320a0116b
6 changed files with 19 additions and 19 deletions

View File

@ -2082,7 +2082,7 @@ fn run(self, builder: &Builder<'_>) {
} }
if builder.config.profiler_enabled(target) { if builder.config.profiler_enabled(target) {
cmd.arg("--profiler-support"); cmd.arg("--profiler-runtime");
} }
cmd.env("RUST_TEST_TMPDIR", builder.tempdir()); cmd.env("RUST_TEST_TMPDIR", builder.tempdir());

View File

@ -386,7 +386,7 @@ pub struct Config {
/// True if the profiler runtime is enabled for this target. /// True if the profiler runtime is enabled for this target.
/// Used by the "needs-profiler-runtime" directive in test files. /// Used by the "needs-profiler-runtime" directive in test files.
pub profiler_support: bool, pub profiler_runtime: bool,
} }
impl Config { impl Config {

View File

@ -101,7 +101,7 @@ pub(super) fn handle_needs(
}, },
Need { Need {
name: "needs-profiler-runtime", name: "needs-profiler-runtime",
condition: cache.profiler_support, condition: cache.profiler_runtime,
ignore_reason: "ignored when the profiler runtime is not available", ignore_reason: "ignored when the profiler runtime is not available",
}, },
Need { Need {
@ -220,7 +220,7 @@ pub(super) struct CachedNeedsConditions {
sanitizer_memtag: bool, sanitizer_memtag: bool,
sanitizer_shadow_call_stack: bool, sanitizer_shadow_call_stack: bool,
sanitizer_safestack: bool, sanitizer_safestack: bool,
profiler_support: bool, profiler_runtime: bool,
xray: bool, xray: bool,
rust_lld: bool, rust_lld: bool,
dlltool: bool, dlltool: bool,
@ -247,7 +247,7 @@ pub(super) fn load(config: &Config) -> Self {
sanitizer_memtag: sanitizers.contains(&Sanitizer::Memtag), sanitizer_memtag: sanitizers.contains(&Sanitizer::Memtag),
sanitizer_shadow_call_stack: sanitizers.contains(&Sanitizer::ShadowCallStack), sanitizer_shadow_call_stack: sanitizers.contains(&Sanitizer::ShadowCallStack),
sanitizer_safestack: sanitizers.contains(&Sanitizer::Safestack), sanitizer_safestack: sanitizers.contains(&Sanitizer::Safestack),
profiler_support: config.profiler_support, profiler_runtime: config.profiler_runtime,
xray: config.target_cfg().xray, xray: config.target_cfg().xray,
// For tests using the `needs-rust-lld` directive (e.g. for `-Clink-self-contained=+linker`), // For tests using the `needs-rust-lld` directive (e.g. for `-Clink-self-contained=+linker`),

View File

@ -69,7 +69,7 @@ struct ConfigBuilder {
llvm_version: Option<String>, llvm_version: Option<String>,
git_hash: bool, git_hash: bool,
system_llvm: bool, system_llvm: bool,
profiler_support: bool, profiler_runtime: bool,
} }
impl ConfigBuilder { impl ConfigBuilder {
@ -113,8 +113,8 @@ fn system_llvm(&mut self, s: bool) -> &mut Self {
self self
} }
fn profiler_support(&mut self, s: bool) -> &mut Self { fn profiler_runtime(&mut self, is_available: bool) -> &mut Self {
self.profiler_support = s; self.profiler_runtime = is_available;
self self
} }
@ -162,8 +162,8 @@ fn build(&mut self) -> Config {
if self.system_llvm { if self.system_llvm {
args.push("--system-llvm".to_owned()); args.push("--system-llvm".to_owned());
} }
if self.profiler_support { if self.profiler_runtime {
args.push("--profiler-support".to_owned()); args.push("--profiler-runtime".to_owned());
} }
args.push("--rustc-path".to_string()); args.push("--rustc-path".to_string());
@ -368,11 +368,11 @@ fn sanitizers() {
} }
#[test] #[test]
fn profiler_support() { fn profiler_runtime() {
let config: Config = cfg().profiler_support(false).build(); let config: Config = cfg().profiler_runtime(false).build();
assert!(check_ignore(&config, "//@ needs-profiler-runtime")); assert!(check_ignore(&config, "//@ needs-profiler-runtime"));
let config: Config = cfg().profiler_support(true).build(); let config: Config = cfg().profiler_runtime(true).build();
assert!(!check_ignore(&config, "//@ needs-profiler-runtime")); assert!(!check_ignore(&config, "//@ needs-profiler-runtime"));
} }
@ -573,12 +573,12 @@ fn families() {
#[test] #[test]
fn ignore_coverage() { fn ignore_coverage() {
// Indicate profiler support so that "coverage-run" tests aren't skipped. // Indicate profiler runtime availability so that "coverage-run" tests aren't skipped.
let config = cfg().mode("coverage-map").profiler_support(true).build(); let config = cfg().mode("coverage-map").profiler_runtime(true).build();
assert!(check_ignore(&config, "//@ ignore-coverage-map")); assert!(check_ignore(&config, "//@ ignore-coverage-map"));
assert!(!check_ignore(&config, "//@ ignore-coverage-run")); assert!(!check_ignore(&config, "//@ ignore-coverage-run"));
let config = cfg().mode("coverage-run").profiler_support(true).build(); let config = cfg().mode("coverage-run").profiler_runtime(true).build();
assert!(!check_ignore(&config, "//@ ignore-coverage-map")); assert!(!check_ignore(&config, "//@ ignore-coverage-map"));
assert!(check_ignore(&config, "//@ ignore-coverage-run")); assert!(check_ignore(&config, "//@ ignore-coverage-run"));
} }

View File

@ -153,7 +153,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
.optflag("", "force-rerun", "rerun tests even if the inputs are unchanged") .optflag("", "force-rerun", "rerun tests even if the inputs are unchanged")
.optflag("", "only-modified", "only run tests that result been modified") .optflag("", "only-modified", "only run tests that result been modified")
.optflag("", "nocapture", "") .optflag("", "nocapture", "")
.optflag("", "profiler-support", "is the profiler runtime enabled for this target") .optflag("", "profiler-runtime", "is the profiler runtime enabled for this target")
.optflag("h", "help", "show this message") .optflag("h", "help", "show this message")
.reqopt("", "channel", "current Rust channel", "CHANNEL") .reqopt("", "channel", "current Rust channel", "CHANNEL")
.optflag( .optflag(
@ -355,7 +355,7 @@ fn make_absolute(path: PathBuf) -> PathBuf {
nightly_branch: matches.opt_str("nightly-branch").unwrap(), nightly_branch: matches.opt_str("nightly-branch").unwrap(),
git_merge_commit_email: matches.opt_str("git-merge-commit-email").unwrap(), git_merge_commit_email: matches.opt_str("git-merge-commit-email").unwrap(),
profiler_support: matches.opt_present("profiler-support"), profiler_runtime: matches.opt_present("profiler-runtime"),
} }
} }

View File

@ -22,7 +22,7 @@ fn main() {
eprintln!("warning: `tidy` is not installed; diffs will not be generated"); eprintln!("warning: `tidy` is not installed; diffs will not be generated");
} }
if !config.profiler_support && config.mode == Mode::CoverageRun { if !config.profiler_runtime && config.mode == Mode::CoverageRun {
let actioned = if config.bless { "blessed" } else { "checked" }; let actioned = if config.bless { "blessed" } else { "checked" };
eprintln!( eprintln!(
r#" r#"