Fix the compile-test tests when setting Cargo's build.build-dir setting to a path that's distinct from target-dir.

This commit is contained in:
Jacob Adam
2026-02-14 12:01:38 +00:00
parent 0f4f81df13
commit 2737b26c2e
+1 -4
View File
@@ -197,10 +197,6 @@ fn base_config(&self, test_dir: &str, mandatory_annotations: bool) -> Config {
defaults.set_custom("diagnostic-collector", collector);
}
config.with_args(&self.args);
let current_exe_path = env::current_exe().unwrap();
let deps_path = current_exe_path.parent().unwrap();
let profile_path = deps_path.parent().unwrap();
config.program.args.extend(
[
"--emit=metadata",
@@ -224,6 +220,7 @@ fn base_config(&self, test_dir: &str, mandatory_annotations: bool) -> Config {
config.program.args.push(format!("--sysroot={sysroot}").into());
}
let profile_path = target_dir.join(env!("PROFILE"));
config.program.program = profile_path.join(if cfg!(windows) {
"clippy-driver.exe"
} else {