mirror of
https://github.com/PR0M3TH3AN/Marlin.git
synced 2025-09-08 07:08:44 +00:00

- Updated Cargo.lock and Cargo.toml to include new dependencies - Added new files for backup and watcher functionality in libmarlin - Introduced integration tests and documentation updates - Set workspace resolver to version 2 for better dependency resolution
1.7 KiB
1.7 KiB
Testing
Below is a repeat-able 3-step flow you can use every time you pull fresh code.
0 Prepare once
# Run once (or add to ~/.bashrc) so debug + release artefacts land
# in the same predictable place. Speeds-up future builds.
export CARGO_TARGET_DIR=target
1 Build the new binary
git pull # grab the latest commit
cargo build --release
sudo install -Dm755 target/release/marlin /usr/local/bin/marlin
cargo build --release
– builds the optimised binary.install …
– copies it into your$PATH
somarlin
on the CLI is the fresh one.
2 Run the smoke-test suite
# Runs the end-to-end test we added in tests/e2e.rs
cargo test --test e2e -- --nocapture
--test e2e
– compiles and runs onlytests/e2e.rs
; other unit-tests are skipped (add them later if you like).--nocapture
– streams stdout/stderr so you can watch each CLI step in real time.- Exit-code 0 ➜ everything passed. Any non-zero exit or a red ✗ line means a step failed; the assert’s diff will show the command and its output.
3 (Optionally) run all tests
cargo test --all -- --nocapture
This will execute:
- unit tests in
src/**
- every file in
tests/
- doc-tests
If you wire “cargo test --all” into CI (GitHub Actions, GitLab, etc.), pushes that break a workflow will be rejected automatically.
One-liner helper (copy/paste)
cargo build --release &&
sudo install -Dm755 target/release/marlin /usr/local/bin/marlin &&
cargo test --all -- --nocapture
or
./run_all_tests.sh
Stick that in a shell alias (alias marlin-ci='…'
) and you’ve got a 5-second upgrade-and-verify loop.