diff options
| author | Philipp Krones <hello@philkrones.com> | 2023-07-02 15:07:39 +0200 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2023-07-02 15:07:39 +0200 |
| commit | 4aa4fecf897869b656d91791b8dcb03db189733d (patch) | |
| tree | 39b0f53db61b8140c8d6afe5eccf8871baeff400 | |
| parent | ba1ffec5b5284bca28c58f18b875b3a8e50a277a (diff) | |
| download | rust-4aa4fecf897869b656d91791b8dcb03db189733d.tar.gz rust-4aa4fecf897869b656d91791b8dcb03db189733d.zip | |
Fix compile-test tests to work with the new ui_test crate
| -rw-r--r-- | tests/compile-test.rs | 12 |
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( ®ex::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( ®ex::escape( - &std::path::Path::new(file!()) - .parent() - .unwrap() - .canonicalize() + &fs::canonicalize("tests") .unwrap() .parent() .unwrap() |
