TypeDialog/justfiles/test.just
2025-12-18 01:18:59 +00:00

122 lines
3.9 KiB
Plaintext

# ╔══════════════════════════════════════════════════════════════════════╗
# ║ TEST RECIPES ║
# ║ Test workspace with different feature flags ║
# ╚══════════════════════════════════════════════════════════════════════╝
# === FEATURE FLAGS ===
FEATURES_CLI := "cli,i18n,templates"
FEATURES_TUI := "tui,i18n,templates"
FEATURES_WEB := "web,i18n,templates"
# Help for test module
help:
@echo "TEST MODULE"
@echo ""
@echo "Run all tests:"
@echo " just test::all All tests (default features)"
@echo " just test::all-features All tests with all features"
@echo ""
@echo "Test specific backends:"
@echo " just test::cli Test CLI backend features"
@echo " just test::tui Test TUI backend features"
@echo " just test::web Test Web backend features"
@echo ""
@echo "Test by crate:"
@echo " just test::core Test TypeDialog core"
@echo " just test::bins Test all binaries"
@echo ""
@echo "Integration & docs:"
@echo " just test::integration Run integration tests only"
@echo " just test::doc Test documentation examples"
# === FULL TEST SUITES ===
# Run all tests (default features)
[doc("Run all tests with default features")]
all:
@echo "=== Testing workspace (default features) ==="
cargo test --workspace --lib
@echo "✓ All tests passed"
# Run all tests with all features enabled
[doc("Run all tests with all features")]
all-features:
@echo "=== Testing workspace (all features) ==="
cargo test --workspace --all-features
@echo "✓ All tests passed (all features)"
# === BACKEND-SPECIFIC TESTS ===
# Test CLI backend features
[doc("Test CLI backend")]
cli:
@echo "=== Testing CLI backend ==="
cargo test -p typedialog-core --features "{{ FEATURES_CLI }}" --lib
cargo test -p typedialog --lib
@echo "✓ CLI tests passed"
# Test TUI backend features
[doc("Test TUI backend")]
tui:
@echo "=== Testing TUI backend ==="
cargo test -p typedialog-core --features "{{ FEATURES_TUI }}" --lib
cargo test -p typedialog-tui --lib
@echo "✓ TUI tests passed"
# Test Web backend features
[doc("Test Web backend")]
web:
@echo "=== Testing Web backend ==="
cargo test -p typedialog-core --features "{{ FEATURES_WEB }}" --lib
cargo test -p typedialog-web --lib
@echo "✓ Web tests passed"
# === CRATE-SPECIFIC TESTS ===
# Test core library only
[doc("Test typedialog-core")]
core:
@echo "=== Testing TypeDialog core ==="
cargo test -p typedialog-core --lib
@echo "✓ Core tests passed"
# Test all binaries
[doc("Test all binaries")]
bins:
@echo "=== Testing binaries ==="
cargo test -p typedialog --lib
cargo test -p typedialog-tui --lib
cargo test -p typedialog-web --lib
@echo "✓ Binary tests passed"
# === INTEGRATION & DOCS ===
# Run integration tests only
[doc("Run integration tests")]
integration:
@echo "=== Running integration tests ==="
cargo test --test '*' --all-features
@echo "✓ Integration tests passed"
# Test documentation examples
[doc("Test documentation code examples")]
doc:
@echo "=== Testing documentation examples ==="
cargo test --doc --all-features
@echo "✓ Doc tests passed"
# === TEST COVERAGE & ANALYSIS ===
# Run tests with output
[doc("Run tests with output")]
verbose:
@echo "=== Testing with output ==="
cargo test --all-features -- --nocapture
@echo "✓ Tests complete"
# Show test list without running
[doc("List all tests without running")]
list:
@echo "=== Available tests ==="
cargo test --all-features -- --list