85 lines
2.2 KiB
Plaintext
Raw Normal View History

2025-12-22 21:34:01 +00:00
# Test recipes for SecretumVault
[doc("Show test help")]
help:
@echo "TEST COMMANDS"; \
echo ""; \
echo "Suites:"; \
echo " just test::unit Unit tests"; \
echo " just test::integration Integration tests"; \
echo " just test::all All tests"; \
echo " just test::with-all-features Tests with all features"; \
echo ""; \
echo "Options:"; \
echo " just test::filter PATTERN Run tests matching pattern"; \
echo " just test::nocapture Run with output"; \
echo ""
# Unit tests
[doc("Run unit tests")]
unit:
cargo test --lib --all-features
# Integration tests
[doc("Run integration tests")]
integration:
cargo test --test '*' --all-features
# All tests
[doc("Run all tests")]
all:
cargo test --all-features
# Tests with minimal features
[doc("Run tests with minimal features")]
minimal:
cargo test --lib --no-default-features
# Run tests matching pattern
[doc("Run tests matching pattern")]
filter PATTERN:
cargo test --all-features {{ PATTERN }}
# Run tests with specific features
[doc("Run tests with specific features")]
with-features FEATURES:
@echo "🧪 Testing with features: {{ FEATURES }}"
cargo test --features {{ FEATURES }}
@echo "✅ Tests with {{ FEATURES }} complete"
# Run tests with output
[doc("Run tests with output (nocapture)")]
nocapture:
cargo test --all-features -- --nocapture
# Doc tests
[doc("Run documentation tests")]
doc:
cargo test --doc --all-features
# Run single test
[doc("Run single test by name")]
one NAME:
cargo test --lib --all-features {{ NAME }} -- --nocapture
# Benchmark tests
[doc("Run benchmarks")]
bench:
cargo bench --all-features
# Test coverage (requires tarpaulin)
[doc("Generate test coverage report")]
coverage:
@command -v cargo-tarpaulin > /dev/null || (echo "Installing cargo-tarpaulin..." && cargo install cargo-tarpaulin)
cargo tarpaulin --all-features --out Html --output-dir coverage
# Memory safety check with MIRI
[doc("Run MIRI (memory safety checks)")]
miri:
cargo +nightly miri test --all-features
# Check test compilation without running
[doc("Check test compilation")]
check-tests:
cargo test --all-features --no-run