aboutsummaryrefslogtreecommitdiff
path: root/crates/test_utils
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2021-03-08 18:13:15 +0000
committerAleksey Kladov <[email protected]>2021-03-08 18:45:37 +0000
commit1eb61203b725684fd2c7e25ac7e2d53eef10c64c (patch)
treeaae264078123fc4b9cbe6c9189179f6f147f8a88 /crates/test_utils
parentabb6b8f14c4d05cf344048263651d8192997b6cf (diff)
Make `code generation` just work
Contributors don't need to learn about `cargo xtask codegen` if `cargo test` just does the right thing.
Diffstat (limited to 'crates/test_utils')
-rw-r--r--crates/test_utils/src/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs
index 097a54139..dd582c77c 100644
--- a/crates/test_utils/src/lib.rs
+++ b/crates/test_utils/src/lib.rs
@@ -18,7 +18,7 @@ use std::{
18}; 18};
19 19
20use profile::StopWatch; 20use profile::StopWatch;
21use stdx::lines_with_ends; 21use stdx::{is_ci, lines_with_ends};
22use text_size::{TextRange, TextSize}; 22use text_size::{TextRange, TextSize};
23 23
24pub use dissimilar::diff as __diff; 24pub use dissimilar::diff as __diff;
@@ -376,6 +376,9 @@ pub fn try_ensure_file_contents(file: &Path, contents: &str) -> Result<(), ()> {
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()
378 ); 378 );
379 if is_ci() {
380 eprintln!("\n NOTE: run `cargo test` locally and commit the updated files\n");
381 }
379 if let Some(parent) = file.parent() { 382 if let Some(parent) = file.parent() {
380 let _ = std::fs::create_dir_all(parent); 383 let _ = std::fs::create_dir_all(parent);
381 } 384 }