2026-07-23 15:34:05 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
# ============================================================
|
|
|
|
|
# HCIE-Rust v3.05 — Categorized Test Runner (Linux shell)
|
|
|
|
|
# Usage: bash run_tests_categorized.sh [--no-io] [--no-4k] [--ignored]
|
|
|
|
|
# ============================================================
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
ROOT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
|
cd "$ROOT_DIR"
|
|
|
|
|
|
|
|
|
|
PASS=0
|
|
|
|
|
FAIL=0
|
|
|
|
|
SKIP=0
|
2026-07-23 16:34:05 +03:00
|
|
|
FAILED_CRATES=()
|
|
|
|
|
SKIPPED_CRATES=()
|
2026-07-23 15:34:05 +03:00
|
|
|
SKIP_IO=false
|
|
|
|
|
SKIP_4K=false
|
|
|
|
|
INCLUDE_IGNORED=false
|
2026-07-23 16:34:05 +03:00
|
|
|
CARGO_ARGS=()
|
|
|
|
|
TEST_ARGS=()
|
|
|
|
|
PARSING_TEST_ARGS=false
|
2026-07-23 15:34:05 +03:00
|
|
|
|
|
|
|
|
for arg in "$@"; do
|
2026-07-23 16:34:05 +03:00
|
|
|
if [ "$PARSING_TEST_ARGS" = true ]; then
|
|
|
|
|
TEST_ARGS+=("$arg")
|
|
|
|
|
continue
|
|
|
|
|
fi
|
2026-07-23 15:34:05 +03:00
|
|
|
case "$arg" in
|
|
|
|
|
--no-io) SKIP_IO=true ;;
|
|
|
|
|
--no-4k) SKIP_4K=true ;;
|
|
|
|
|
--ignored) INCLUDE_IGNORED=true ;;
|
2026-07-23 16:34:05 +03:00
|
|
|
--) PARSING_TEST_ARGS=true ;;
|
|
|
|
|
*) CARGO_ARGS+=("$arg") ;;
|
2026-07-23 15:34:05 +03:00
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
SEPARATOR() { printf '%*s\n' 80 '' | tr ' ' '='; }
|
|
|
|
|
|
|
|
|
|
run_crate() {
|
|
|
|
|
local crate="$1"
|
|
|
|
|
local label="$2"
|
2026-07-23 16:34:05 +03:00
|
|
|
shift 2
|
|
|
|
|
local -a crate_test_args=("$@")
|
|
|
|
|
local -a cmd=(cargo test -p "$crate" "${CARGO_ARGS[@]}")
|
|
|
|
|
if (( ${#crate_test_args[@]} > 0 || ${#TEST_ARGS[@]} > 0 )); then
|
|
|
|
|
cmd+=(-- "${crate_test_args[@]}" "${TEST_ARGS[@]}")
|
|
|
|
|
fi
|
2026-07-23 15:34:05 +03:00
|
|
|
|
|
|
|
|
SEPARATOR
|
2026-07-23 16:34:05 +03:00
|
|
|
printf '[%s] Running:' "$label"
|
|
|
|
|
printf ' %q' "${cmd[@]}"
|
|
|
|
|
printf '\n'
|
2026-07-23 15:34:05 +03:00
|
|
|
SEPARATOR
|
|
|
|
|
|
2026-07-23 16:34:05 +03:00
|
|
|
if "${cmd[@]}" 2>&1; then
|
2026-07-23 15:34:05 +03:00
|
|
|
PASS=$((PASS + 1))
|
|
|
|
|
else
|
|
|
|
|
FAIL=$((FAIL + 1))
|
2026-07-23 16:34:05 +03:00
|
|
|
FAILED_CRATES+=("$crate")
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
run_ignored_tests() {
|
|
|
|
|
local crate="$1"
|
|
|
|
|
local -a cmd=(cargo test -p "$crate" "${CARGO_ARGS[@]}" -- --ignored "${TEST_ARGS[@]}")
|
|
|
|
|
|
|
|
|
|
if "${cmd[@]}" 2>&1; then
|
|
|
|
|
PASS=$((PASS + 1))
|
|
|
|
|
else
|
|
|
|
|
FAIL=$((FAIL + 1))
|
|
|
|
|
FAILED_CRATES+=("${crate}[ignored]")
|
2026-07-23 15:34:05 +03:00
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# ── Layer 1: DATA ──────────────────────────────────────────
|
|
|
|
|
run_crate "hcie-protocol" "DATA"
|
|
|
|
|
run_crate "hcie-color" "DATA"
|
|
|
|
|
|
|
|
|
|
# ── Layer 2: ENGINE CORE ───────────────────────────────────
|
|
|
|
|
run_crate "hcie-blend" "CORE"
|
|
|
|
|
run_crate "hcie-brush-engine" "CORE"
|
|
|
|
|
run_crate "hcie-draw" "CORE"
|
|
|
|
|
run_crate "hcie-composite" "CORE"
|
|
|
|
|
run_crate "hcie-filter" "CORE"
|
|
|
|
|
run_crate "hcie-selection" "CORE"
|
|
|
|
|
run_crate "hcie-vector" "CORE"
|
|
|
|
|
run_crate "hcie-history" "CORE"
|
|
|
|
|
|
|
|
|
|
if [ "$SKIP_IO" = true ]; then
|
|
|
|
|
echo "[SKIP] hcie-io"
|
|
|
|
|
SKIP=$((SKIP + 1))
|
2026-07-23 16:34:05 +03:00
|
|
|
SKIPPED_CRATES+=("hcie-io")
|
2026-07-23 15:34:05 +03:00
|
|
|
else
|
|
|
|
|
run_crate "hcie-io" "CORE"
|
|
|
|
|
fi
|
2026-07-23 16:34:05 +03:00
|
|
|
run_crate "psd" "CORE"
|
2026-07-23 15:34:05 +03:00
|
|
|
run_crate "hcie-vision" "CORE"
|
|
|
|
|
run_crate "hcie-build-info" "CORE"
|
|
|
|
|
|
|
|
|
|
# ── Layer 4: ENGINE API ────────────────────────────────────
|
|
|
|
|
if [ "$SKIP_4K" = true ]; then
|
2026-07-23 16:34:05 +03:00
|
|
|
run_crate "hcie-engine-api" "ENGINE-API" --skip benchmark_4k_stroke_on_multilayer_document
|
2026-07-23 15:34:05 +03:00
|
|
|
else
|
|
|
|
|
run_crate "hcie-engine-api" "ENGINE-API"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# ── Layer 6: GUI ───────────────────────────────────────────
|
|
|
|
|
run_crate "hcie-gui-egui" "GUI-egui"
|
|
|
|
|
run_crate "hcie-iced-gui" "GUI-iced"
|
|
|
|
|
|
|
|
|
|
# ── Brush Catalogs ─────────────────────────────────────────
|
|
|
|
|
run_crate "hcie-dry-media-brushes" "Brushes"
|
|
|
|
|
run_crate "hcie-paint-brushes" "Brushes"
|
|
|
|
|
run_crate "hcie-digital-brushes" "Brushes"
|
|
|
|
|
run_crate "hcie-watercolor-brushes" "Brushes"
|
|
|
|
|
run_crate "hcie-ink-brushes" "Brushes"
|
|
|
|
|
|
|
|
|
|
# ── Ignored tests (visual checks, benchmarks) ──────────────
|
|
|
|
|
if [ "$INCLUDE_IGNORED" = true ]; then
|
|
|
|
|
echo ""
|
|
|
|
|
SEPARATOR
|
|
|
|
|
echo "Running IGNORED tests (visual checks, benchmarks)"
|
|
|
|
|
SEPARATOR
|
2026-07-23 16:34:05 +03:00
|
|
|
run_ignored_tests hcie-engine-api
|
|
|
|
|
run_ignored_tests hcie-brush-engine
|
|
|
|
|
run_ignored_tests hcie-iced-gui
|
|
|
|
|
run_ignored_tests hcie-fx
|
2026-07-23 15:34:05 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
SEPARATOR
|
2026-07-23 16:34:05 +03:00
|
|
|
echo "CATEGORIZED TEST RUN COMPLETE: $PASS test runs passed, $FAIL failed, $SKIP crates skipped"
|
|
|
|
|
if (( ${#FAILED_CRATES[@]} > 0 )); then
|
|
|
|
|
echo "Failed crates: ${FAILED_CRATES[*]}"
|
|
|
|
|
fi
|
|
|
|
|
if (( ${#SKIPPED_CRATES[@]} > 0 )); then
|
|
|
|
|
echo "Skipped crates: ${SKIPPED_CRATES[*]}"
|
|
|
|
|
fi
|
2026-07-23 15:34:05 +03:00
|
|
|
SEPARATOR
|
|
|
|
|
exit "$FAIL"
|