Agent ran out of API credits before committing. Files staged + committed by orchestrator. Coverage:
- tests/cpp/ml_golden_vectors.cpp: fixed-seed regression tests for MLP determinism
- tests/cpp/engine_impulse.cpp: white-noise impulse responses with binary baseline
- tests/cpp/parity_check.cpp + parity_wasm.mjs + parity_diff.mjs: native vs WASM bit-equivalence
- scripts/build-cpp-tests.sh, lint-cpp.sh, parity-check.sh, run-all-tests.sh
- playground/tests/e2e/{ml-engine,modes,persistence,ui-interactions}.spec.ts (+helpers)
- .github/workflows/ci.yml
(meml-x06)
48 lines
1.7 KiB
Bash
Executable file
48 lines
1.7 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# scripts/build-cpp-tests.sh — configure + build the host C++ test suite.
|
|
#
|
|
# Output: nisps/build/{nisps_core_tests,nisps_dsp_engine_tests,
|
|
# nisps_modes_tests,nisps_golden_tests,nisps_parity_check}
|
|
#
|
|
# Adds CTest registration for the first four. parity_check is invoked by
|
|
# scripts/parity-check.sh (orchestrates native+WASM together) and is NOT
|
|
# part of the ctest pipeline.
|
|
#
|
|
# Honours these env vars:
|
|
# CMAKE_BUILD_TYPE default Release; pass Debug for stepping
|
|
# NISPS_BUILD_DIR default nisps/build; override for clean builds
|
|
# NISPS_RUN_TESTS if "1", run ctest after the build (default 1)
|
|
#
|
|
# Returns nonzero on configure or build failure, or on test failure when
|
|
# NISPS_RUN_TESTS=1.
|
|
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
BUILD_DIR="${NISPS_BUILD_DIR:-$ROOT/nisps/build}"
|
|
BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}"
|
|
RUN_TESTS="${NISPS_RUN_TESTS:-1}"
|
|
|
|
# Pick a generator. Ninja is fastest; fall back to Make if unavailable.
|
|
GENERATOR="Unix Makefiles"
|
|
if command -v ninja >/dev/null 2>&1; then
|
|
GENERATOR="Ninja"
|
|
fi
|
|
|
|
echo "[build-cpp-tests] root=$ROOT"
|
|
echo "[build-cpp-tests] build_dir=$BUILD_DIR generator=$GENERATOR build_type=$BUILD_TYPE"
|
|
|
|
cmake -S "$ROOT/nisps" -B "$BUILD_DIR" \
|
|
-G "$GENERATOR" \
|
|
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
|
|
|
|
cmake --build "$BUILD_DIR" --parallel
|
|
|
|
if [[ "$RUN_TESTS" == "1" ]]; then
|
|
echo "[build-cpp-tests] running ctest..."
|
|
# CTest's default output is terse; --output-on-failure surfaces details
|
|
# only when something breaks. The progress flag keeps CI logs scannable.
|
|
(cd "$BUILD_DIR" && ctest --output-on-failure --progress)
|
|
fi
|
|
|
|
echo "[build-cpp-tests] done."
|