build: add a Makefile with check, test-live and shots targets

make check runs what has to pass before a commit: rustfmt, clippy with
warnings as errors, and the unit tests. make shots screenshots the
main screens against the Navidrome demo server using a scratch config.
This commit is contained in:
Ansho Rei
2026-11-04 01:17:29 +01:00
parent 4105554f68
commit b1914e4ac1
2 changed files with 83 additions and 9 deletions
+13 -9
View File
@@ -41,16 +41,20 @@ With Steam running, remus listens only to Steam's virtual controller, so a pad S
## Development
```
cargo test
REMUS_TEST_URL=https://demo.navidrome.org REMUS_TEST_USER=demo REMUS_TEST_PASS=demo \
cargo test -- --ignored # every API call against a real server
```
`REMUS_DEV_SCRIPT` replays actions and saves screenshots, which is how layouts are checked at different sizes without a controller:
`make` lists the targets. The ones you will use most:
```
REMUS_DEV_SCRIPT="size:full,wait:3000,shot:home.png,right,activate,wait:2000,shot:album.png,quit" cargo run
make check # formatting, clippy with warnings as errors, unit tests
make test-live # every Subsonic call against the Navidrome demo server
make shots # fullscreen screenshots of the main screens into target/shots
```
Steps: `size:WxH`, `size:full`, `wait:MS`, `shot:PATH`, and action names (`up`, `down`, `left`, `right`, `activate`, `back`, `queue`, `next`, `play-pause`, `section-next`, `now-playing`, `search`, `quit`). Point `XDG_CONFIG_HOME` and `XDG_CACHE_HOME` at a scratch directory to keep test runs away from your own config.
`test-live` and `shots` take `DEMO_URL`, `DEMO_USER` and `DEMO_PASS` to point at another server. `shots` runs against a scratch config in `target/scratch`, never your own.
`make shots` is built on `REMUS_DEV_SCRIPT`, which replays actions and saves screenshots so layouts can be checked without a controller:
```
REMUS_DEV_SCRIPT="wait:3000,shot:home.png,right,activate,wait:2000,shot:album.png,quit" cargo run
```
A scripted run starts fullscreen like a normal one, so it also checks that startup reaches fullscreen. Add `--windowed` to capture a window instead. Steps: `size:WxH`, `size:full`, `wait:MS`, `shot:PATH`, and action names (`up`, `down`, `left`, `right`, `activate`, `back`, `queue`, `next`, `play-pause`, `section-next`, `now-playing`, `search`, `quit`). Point `XDG_CONFIG_HOME` and `XDG_CACHE_HOME` at a scratch directory to keep test runs away from your own config.