#!/usr/bin/env bash
# Build and run all C++ unit tests via Catch2 + ctest.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cmake -S "$ROOT" -B "$ROOT/build" -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build "$ROOT/build" -j"$(nproc)"
ctest --test-dir "$ROOT/build" --output-on-failure

# CI gate (issue 0048): toda funcion C++ creada en los ultimos 30 dias debe
# tener tested:true en el .md. No-op si no hay registry.db.
"$ROOT/scripts/check_tested.sh" 30
