Skip to content

Commit

Permalink
Auto merge of #13635 - Alexendoo:cargo-dev-serve-watch-test, r=blyxyas
Browse files Browse the repository at this point in the history
Watch `tests/compile-test.rs` in `cargo dev serve`

Changes to `compile-test.rs` will also need a rerun of `collect-metadata`

changelog: none
  • Loading branch information
bors committed Nov 1, 2024
2 parents e4dc892 + a7aa8bf commit 9d03956
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clippy_dev/src/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,14 @@ pub fn run(port: u16, lint: Option<String>) -> ! {

loop {
let index_time = mtime("util/gh-pages/index.html");
let times = [
"clippy_lints/src",
"util/gh-pages/index_template.html",
"tests/compile-test.rs",
]
.map(mtime);

if index_time < mtime("clippy_lints/src") || index_time < mtime("util/gh-pages/index_template.html") {
if times.iter().any(|&time| index_time < time) {
Command::new(env::var("CARGO").unwrap_or("cargo".into()))
.arg("collect-metadata")
.spawn()
Expand Down

0 comments on commit 9d03956

Please sign in to comment.