Skip to content

Commit 4aa4fec

Browse files
committed
Fix compile-test tests to work with the new ui_test crate
1 parent ba1ffec commit 4aa4fec

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

tests/compile-test.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn base_config(test_dir: &str) -> compiletest::Config {
3131
},
3232
dependencies_crate_manifest_path: Some("clippy_test_deps/Cargo.toml".into()),
3333
target: None,
34-
out_dir: "target/ui_test".into(),
34+
out_dir: PathBuf::from(std::env::var_os("CARGO_TARGET_DIR").unwrap_or("target".into())).join("ui_test"),
3535
..compiletest::Config::rustc(Path::new("tests").join(test_dir))
3636
};
3737

@@ -116,10 +116,7 @@ fn run_ui_toml() {
116116

117117
config.stderr_filter(
118118
&regex::escape(
119-
&std::path::Path::new(file!())
120-
.parent()
121-
.unwrap()
122-
.canonicalize()
119+
&fs::canonicalize("tests")
123120
.unwrap()
124121
.parent()
125122
.unwrap()
@@ -175,10 +172,7 @@ fn run_ui_cargo() {
175172

176173
config.stderr_filter(
177174
&regex::escape(
178-
&std::path::Path::new(file!())
179-
.parent()
180-
.unwrap()
181-
.canonicalize()
175+
&fs::canonicalize("tests")
182176
.unwrap()
183177
.parent()
184178
.unwrap()

0 commit comments

Comments
 (0)