diff options
author | Aleksey Kladov <[email protected]> | 2021-03-08 18:13:15 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-03-08 18:45:37 +0000 |
commit | 1eb61203b725684fd2c7e25ac7e2d53eef10c64c (patch) | |
tree | aae264078123fc4b9cbe6c9189179f6f147f8a88 /crates/test_utils/src | |
parent | abb6b8f14c4d05cf344048263651d8192997b6cf (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/src')
-rw-r--r-- | crates/test_utils/src/lib.rs | 5 |
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 | ||
20 | use profile::StopWatch; | 20 | use profile::StopWatch; |
21 | use stdx::lines_with_ends; | 21 | use stdx::{is_ci, lines_with_ends}; |
22 | use text_size::{TextRange, TextSize}; | 22 | use text_size::{TextRange, TextSize}; |
23 | 23 | ||
24 | pub use dissimilar::diff as __diff; | 24 | pub 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 | } |