aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/test_utils/src/lib.rs')
-rw-r--r--crates/test_utils/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs
index 7f122b13e..097a54139 100644
--- a/crates/test_utils/src/lib.rs
+++ b/crates/test_utils/src/lib.rs
@@ -288,14 +288,14 @@ pub fn skip_slow_tests() -> bool {
288 if should_skip { 288 if should_skip {
289 eprintln!("ignoring slow test") 289 eprintln!("ignoring slow test")
290 } else { 290 } else {
291 let path = project_dir().join("./target/.slow_tests_cookie"); 291 let path = project_root().join("./target/.slow_tests_cookie");
292 fs::write(&path, ".").unwrap(); 292 fs::write(&path, ".").unwrap();
293 } 293 }
294 should_skip 294 should_skip
295} 295}
296 296
297/// Returns the path to the root directory of `rust-analyzer` project. 297/// Returns the path to the root directory of `rust-analyzer` project.
298pub fn project_dir() -> PathBuf { 298pub fn project_root() -> PathBuf {
299 let dir = env!("CARGO_MANIFEST_DIR"); 299 let dir = env!("CARGO_MANIFEST_DIR");
300 PathBuf::from(dir).parent().unwrap().parent().unwrap().to_owned() 300 PathBuf::from(dir).parent().unwrap().parent().unwrap().to_owned()
301} 301}
@@ -371,7 +371,7 @@ pub fn try_ensure_file_contents(file: &Path, contents: &str) -> Result<(), ()> {
371 } 371 }
372 _ => (), 372 _ => (),
373 } 373 }
374 let display_path = file.strip_prefix(&project_dir()).unwrap_or(file); 374 let display_path = file.strip_prefix(&project_root()).unwrap_or(file);
375 eprintln!( 375 eprintln!(
376 "\n\x1b[31;1merror\x1b[0m: {} was not up-to-date, updating\n", 376 "\n\x1b[31;1merror\x1b[0m: {} was not up-to-date, updating\n",
377 display_path.display() 377 display_path.display()