#!/bin/bash

# Test All CI Scripts
# Quick test runner for all CI scripts

set -e

echo "🧪 Testing All CI Scripts"
echo "========================="

# Check if we're in the right directory
if [ ! -f "Cargo.toml" ]; then
    echo "❌ Error: This script must be run from the project root directory"
    exit 1
fi

echo "🔧 Running basic tests..."
cargo test --quiet

echo "✅ Basic tests passed!"
echo ""

echo "🔍 Testing linter (quick run)..."
# Run a quick linter test with basic checks only
cargo fmt --all -- --check
cargo clippy -- -D warnings

echo "✅ Linter checks passed!"
echo ""

echo "📊 Testing throughput performance..."
./scripts/test_throughput.sh
echo ""

echo "🎯 All CI scripts are ready!"
echo "=========================="
echo ""
echo "📋 Available scripts:"
echo "   ./scripts/ci/test_coverage.sh   - Generate test coverage report"
echo "   ./scripts/ci/fuzzer.sh          - Run fuzz testing"
echo "   ./scripts/ci/mutation_test.sh   - Run mutation testing"
echo "   ./scripts/ci/linter.sh          - Run comprehensive linting"
echo "   ./scripts/ci/fix_all.sh         - Auto-fix all linter errors"
echo ""
echo "🔧 Quick usage examples:"
echo "   ./scripts/ci/fuzzer.sh 10       - Run fuzzer for 10 seconds"
echo "   ./scripts/ci/test_coverage.sh   - Generate coverage report"
echo ""