Skip to content

Commit 8320a01

Browse files
committed
Rename profiler_support to profiler_runtime throughout compiletest
1 parent 622d589 commit 8320a01

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

Diff for: src/bootstrap/src/core/build_steps/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
20822082
}
20832083

20842084
if builder.config.profiler_enabled(target) {
2085-
cmd.arg("--profiler-support");
2085+
cmd.arg("--profiler-runtime");
20862086
}
20872087

20882088
cmd.env("RUST_TEST_TMPDIR", builder.tempdir());

Diff for: src/tools/compiletest/src/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ pub struct Config {
386386

387387
/// True if the profiler runtime is enabled for this target.
388388
/// Used by the "needs-profiler-runtime" directive in test files.
389-
pub profiler_support: bool,
389+
pub profiler_runtime: bool,
390390
}
391391

392392
impl Config {

Diff for: src/tools/compiletest/src/header/needs.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub(super) fn handle_needs(
101101
},
102102
Need {
103103
name: "needs-profiler-runtime",
104-
condition: cache.profiler_support,
104+
condition: cache.profiler_runtime,
105105
ignore_reason: "ignored when the profiler runtime is not available",
106106
},
107107
Need {
@@ -220,7 +220,7 @@ pub(super) struct CachedNeedsConditions {
220220
sanitizer_memtag: bool,
221221
sanitizer_shadow_call_stack: bool,
222222
sanitizer_safestack: bool,
223-
profiler_support: bool,
223+
profiler_runtime: bool,
224224
xray: bool,
225225
rust_lld: bool,
226226
dlltool: bool,
@@ -247,7 +247,7 @@ impl CachedNeedsConditions {
247247
sanitizer_memtag: sanitizers.contains(&Sanitizer::Memtag),
248248
sanitizer_shadow_call_stack: sanitizers.contains(&Sanitizer::ShadowCallStack),
249249
sanitizer_safestack: sanitizers.contains(&Sanitizer::Safestack),
250-
profiler_support: config.profiler_support,
250+
profiler_runtime: config.profiler_runtime,
251251
xray: config.target_cfg().xray,
252252

253253
// For tests using the `needs-rust-lld` directive (e.g. for `-Clink-self-contained=+linker`),

Diff for: src/tools/compiletest/src/header/tests.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct ConfigBuilder {
6969
llvm_version: Option<String>,
7070
git_hash: bool,
7171
system_llvm: bool,
72-
profiler_support: bool,
72+
profiler_runtime: bool,
7373
}
7474

7575
impl ConfigBuilder {
@@ -113,8 +113,8 @@ impl ConfigBuilder {
113113
self
114114
}
115115

116-
fn profiler_support(&mut self, s: bool) -> &mut Self {
117-
self.profiler_support = s;
116+
fn profiler_runtime(&mut self, is_available: bool) -> &mut Self {
117+
self.profiler_runtime = is_available;
118118
self
119119
}
120120

@@ -162,8 +162,8 @@ impl ConfigBuilder {
162162
if self.system_llvm {
163163
args.push("--system-llvm".to_owned());
164164
}
165-
if self.profiler_support {
166-
args.push("--profiler-support".to_owned());
165+
if self.profiler_runtime {
166+
args.push("--profiler-runtime".to_owned());
167167
}
168168

169169
args.push("--rustc-path".to_string());
@@ -368,11 +368,11 @@ fn sanitizers() {
368368
}
369369

370370
#[test]
371-
fn profiler_support() {
372-
let config: Config = cfg().profiler_support(false).build();
371+
fn profiler_runtime() {
372+
let config: Config = cfg().profiler_runtime(false).build();
373373
assert!(check_ignore(&config, "//@ needs-profiler-runtime"));
374374

375-
let config: Config = cfg().profiler_support(true).build();
375+
let config: Config = cfg().profiler_runtime(true).build();
376376
assert!(!check_ignore(&config, "//@ needs-profiler-runtime"));
377377
}
378378

@@ -573,12 +573,12 @@ fn families() {
573573

574574
#[test]
575575
fn ignore_coverage() {
576-
// Indicate profiler support so that "coverage-run" tests aren't skipped.
577-
let config = cfg().mode("coverage-map").profiler_support(true).build();
576+
// Indicate profiler runtime availability so that "coverage-run" tests aren't skipped.
577+
let config = cfg().mode("coverage-map").profiler_runtime(true).build();
578578
assert!(check_ignore(&config, "//@ ignore-coverage-map"));
579579
assert!(!check_ignore(&config, "//@ ignore-coverage-run"));
580580

581-
let config = cfg().mode("coverage-run").profiler_support(true).build();
581+
let config = cfg().mode("coverage-run").profiler_runtime(true).build();
582582
assert!(!check_ignore(&config, "//@ ignore-coverage-map"));
583583
assert!(check_ignore(&config, "//@ ignore-coverage-run"));
584584
}

Diff for: src/tools/compiletest/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
153153
.optflag("", "force-rerun", "rerun tests even if the inputs are unchanged")
154154
.optflag("", "only-modified", "only run tests that result been modified")
155155
.optflag("", "nocapture", "")
156-
.optflag("", "profiler-support", "is the profiler runtime enabled for this target")
156+
.optflag("", "profiler-runtime", "is the profiler runtime enabled for this target")
157157
.optflag("h", "help", "show this message")
158158
.reqopt("", "channel", "current Rust channel", "CHANNEL")
159159
.optflag(
@@ -355,7 +355,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
355355
nightly_branch: matches.opt_str("nightly-branch").unwrap(),
356356
git_merge_commit_email: matches.opt_str("git-merge-commit-email").unwrap(),
357357

358-
profiler_support: matches.opt_present("profiler-support"),
358+
profiler_runtime: matches.opt_present("profiler-runtime"),
359359
}
360360
}
361361

Diff for: src/tools/compiletest/src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn main() {
2222
eprintln!("warning: `tidy` is not installed; diffs will not be generated");
2323
}
2424

25-
if !config.profiler_support && config.mode == Mode::CoverageRun {
25+
if !config.profiler_runtime && config.mode == Mode::CoverageRun {
2626
let actioned = if config.bless { "blessed" } else { "checked" };
2727
eprintln!(
2828
r#"

0 commit comments

Comments
 (0)