Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Run A Single Unit Test With Rust cargo watch

This is what I'm using for a script to run a single test whenever there are code changes.

Code

#!/bin/bash

TEST_NAME=test_posts_basic
cargo watch -i "site" -x "test --lib $TEST_NAME --color always -- --nocapture"
  • Write up the individual parts

  • Write a post about just running integration tests with `--test``

  • Write up about about using all `--lib`` tests

References