Run cargo test And cargo run Together When Files Change With watchexec
May 2024
You can also put it in a script like:
filename: start-test-and-run.bash
#!/bin/bash
Notes
-
There's probably a way to do that directly with
cargo watchbut I haven't figured that out yet -
This also let you add other extensions to watch for (e.g. for template files). I wouldn't be surprised if
cargo watchcan do that too give its use ofwatchexecunder the hood
end of line