Skip to content

Commit

Permalink
s/display-diff-tool/compiletest-diff-tool/
Browse files Browse the repository at this point in the history
  • Loading branch information
Orion Gonzalez committed Oct 22, 2024
1 parent 37ffb94 commit c8de61b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
#jobs = 0

# What custom diff tool to use for displaying compiletest tests.
#display-diff-tool = "difft --color=always --background=light --display=side-by-side"
#compiletest-diff-tool = "difft --color=always --background=light --display=side-by-side"

# =============================================================================
# General install configuration options
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1834,8 +1834,8 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
if builder.config.cmd.only_modified() {
cmd.arg("--only-modified");
}
if let Some(display_diff_tool) = &builder.config.display_diff_tool {
cmd.arg("--display-diff-tool").arg(display_diff_tool);
if let Some(compiletest_diff_tool) = &builder.config.compiletest_diff_tool {
cmd.arg("--compiletest-diff-tool").arg(compiletest_diff_tool);
}

let mut flags = if is_rustdoc { Vec::new() } else { vec!["-Crpath".to_string()] };
Expand Down
10 changes: 5 additions & 5 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ pub struct Config {
/// `paths=["foo", "bar"]`.
pub paths: Vec<PathBuf>,

/// What custom diff tool to use for displaying compiletest tests.
pub display_diff_tool: Option<String>,
/// Command for visual diff display, e.g. `diff-tool --color=always`.
pub compiletest_diff_tool: Option<String>,
}

#[derive(Clone, Debug, Default)]
Expand Down Expand Up @@ -895,7 +895,7 @@ define_config! {
android_ndk: Option<PathBuf> = "android-ndk",
optimized_compiler_builtins: Option<bool> = "optimized-compiler-builtins",
jobs: Option<u32> = "jobs",
display_diff_tool: Option<String> = "display-diff-tool",
compiletest_diff_tool: Option<String> = "compiletest-diff-tool",
}
}

Expand Down Expand Up @@ -1516,7 +1516,7 @@ impl Config {
android_ndk,
optimized_compiler_builtins,
jobs,
display_diff_tool,
compiletest_diff_tool,
} = toml.build.unwrap_or_default();

config.jobs = Some(threads_from_config(flags.jobs.unwrap_or(jobs.unwrap_or(0))));
Expand Down Expand Up @@ -2163,7 +2163,7 @@ impl Config {
config.rust_debuginfo_level_tests = debuginfo_level_tests.unwrap_or(DebuginfoLevel::None);
config.optimized_compiler_builtins =
optimized_compiler_builtins.unwrap_or(config.channel != "dev");
config.display_diff_tool = display_diff_tool;
config.compiletest_diff_tool = compiletest_diff_tool;

let download_rustc = config.download_rustc_commit.is_some();
// See https://github.com/rust-lang/compiler-team/issues/326
Expand Down
1 change: 1 addition & 0 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ pub struct Config {
/// Used by the "needs-profiler-runtime" directive in test files.
pub profiler_runtime: bool,

/// Command for visual diff display, e.g. `diff-tool --color=always`.
pub diff_command: Option<String>,
}

Expand Down
4 changes: 2 additions & 2 deletions src/tools/compiletest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
)
.optopt(
"",
"display-diff-tool",
"compiletest-diff-tool",
"What custom diff tool to use for displaying compiletest tests.",
"COMMAND",
);
Expand Down Expand Up @@ -370,7 +370,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
git_merge_commit_email: matches.opt_str("git-merge-commit-email").unwrap(),

profiler_runtime: matches.opt_present("profiler-runtime"),
diff_command: matches.opt_str("display-diff-tool"),
diff_command: matches.opt_str("compiletest-diff-tool"),
}
}

Expand Down

0 comments on commit c8de61b

Please sign in to comment.