93 lines
3.5 KiB
Bash
Executable File
93 lines
3.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# run_all_tests.sh - Run all NIP test suites
|
|
|
|
set -e
|
|
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
echo "🧪 NIP Test Suite Runner"
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
echo ""
|
|
|
|
TESTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "$TESTS_DIR/.."
|
|
|
|
FAILED=0
|
|
PASSED=0
|
|
SKIPPED=0
|
|
|
|
run_test() {
|
|
local test_name="$1"
|
|
local test_file="tests/${test_name}.nim"
|
|
|
|
if [ ! -f "$test_file" ]; then
|
|
echo "⚠️ Test not found: $test_file"
|
|
SKIPPED=$((SKIPPED + 1))
|
|
return
|
|
fi
|
|
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
echo "📋 Running: $test_name"
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
echo ""
|
|
|
|
if nim c -r "$test_file" 2>&1; then
|
|
echo ""
|
|
echo "✅ PASSED: $test_name"
|
|
PASSED=$((PASSED + 1))
|
|
else
|
|
echo ""
|
|
echo "❌ FAILED: $test_name"
|
|
FAILED=$((FAILED + 1))
|
|
fi
|
|
|
|
echo ""
|
|
}
|
|
|
|
# Core tests
|
|
echo "🔧 Core Tests"
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
run_test "test_recipes"
|
|
run_test "test_binary_cache"
|
|
run_test "test_remote_cache"
|
|
run_test "test_updates"
|
|
|
|
# Platform tests
|
|
echo ""
|
|
echo "🖥️ Platform Tests"
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
run_test "test_multiplatform"
|
|
|
|
# Container tests (may be skipped if no runtime)
|
|
echo ""
|
|
echo "🐳 Container Tests"
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
run_test "test_container_builds"
|
|
|
|
# Summary
|
|
echo ""
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
echo "📊 Test Summary"
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
echo ""
|
|
echo "✅ Passed: $PASSED"
|
|
echo "❌ Failed: $FAILED"
|
|
echo "⚠️ Skipped: $SKIPPED"
|
|
echo ""
|
|
|
|
TOTAL=$((PASSED + FAILED + SKIPPED))
|
|
echo "Total: $TOTAL tests"
|
|
|
|
if [ $FAILED -eq 0 ]; then
|
|
echo ""
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
echo "🎉 ALL TESTS PASSED!"
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
exit 0
|
|
else
|
|
echo ""
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
echo "⚠️ SOME TESTS FAILED"
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
exit 1
|
|
fi
|