about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2023-07-02 15:07:39 +0200
committerPhilipp Krones <hello@philkrones.com>2023-07-02 15:07:39 +0200
commit4aa4fecf897869b656d91791b8dcb03db189733d (patch)
tree39b0f53db61b8140c8d6afe5eccf8871baeff400
parentba1ffec5b5284bca28c58f18b875b3a8e50a277a (diff)
downloadrust-4aa4fecf897869b656d91791b8dcb03db189733d.tar.gz
rust-4aa4fecf897869b656d91791b8dcb03db189733d.zip
Fix compile-test tests to work with the new ui_test crate
-rw-r--r--tests/compile-test.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/compile-test.rs b/tests/compile-test.rs
index dce6f2fc272..0fd37c640ae 100644
--- a/tests/compile-test.rs
+++ b/tests/compile-test.rs
@@ -31,7 +31,7 @@ fn base_config(test_dir: &str) -> compiletest::Config {
         },
         dependencies_crate_manifest_path: Some("clippy_test_deps/Cargo.toml".into()),
         target: None,
-        out_dir: "target/ui_test".into(),
+        out_dir: PathBuf::from(std::env::var_os("CARGO_TARGET_DIR").unwrap_or("target".into())).join("ui_test"),
         ..compiletest::Config::rustc(Path::new("tests").join(test_dir))
     };
 
@@ -116,10 +116,7 @@ fn run_ui_toml() {
 
     config.stderr_filter(
         &regex::escape(
-            &std::path::Path::new(file!())
-                .parent()
-                .unwrap()
-                .canonicalize()
+            &fs::canonicalize("tests")
                 .unwrap()
                 .parent()
                 .unwrap()
@@ -175,10 +172,7 @@ fn run_ui_cargo() {
 
     config.stderr_filter(
         &regex::escape(
-            &std::path::Path::new(file!())
-                .parent()
-                .unwrap()
-                .canonicalize()
+            &fs::canonicalize("tests")
                 .unwrap()
                 .parent()
                 .unwrap()