#!/bin/bash # This script builds and tests all supported platform targets to ensure # stability before a major commit. # # What it verifies: # 1. Native build (macOS/Linux) with all tests and tools. # 2. All tests pass across all build modes. # 3. All tools compile. # 4. Windows cross-compilation (if mingw-w64 available). # 5. Headless mode build and test execution. # 6. Coverage build and test execution. # # Usage: ./scripts/check_all.sh set -e echo "--- Running Native Build & Tests ---" echo "Configuring with all options enabled (tests + tools)..." cmake -S . -B build -DDEMO_BUILD_TESTS=ON -DDEMO_BUILD_TOOLS=ON echo "Building all targets (demo, tests, and tools)..." cmake --build build -j8 echo "Running test suite..." (cd build && ctest --output-on-failure) echo "Verifying tools compile..." cmake --build build --target test_spectool -j8 echo "" echo "--- Running Headless Build & Tests ---" echo "Configuring for headless mode..." cmake -S . -B build_headless -DDEMO_HEADLESS=ON -DDEMO_BUILD_TESTS=ON echo "Building headless target..." cmake --build build_headless -j8 echo "Running headless test suite..." (cd build_headless && ctest -L audio -L assets -L util --output-on-failure) echo "" echo "--- Running Coverage Build & Tests ---" echo "Configuring for coverage..." cmake -S . -B build_coverage -DCMAKE_BUILD_TYPE=Debug -DDEMO_ENABLE_COVERAGE=ON -DDEMO_BUILD_TESTS=ON echo "Building coverage target..." cmake --build build_coverage -j8 echo "Running coverage test suite..." (cd build_coverage && ctest --output-on-failure) echo "" echo "--- Running Windows Cross-Compilation Build ---" ./scripts/build_win.sh echo "" echo "All checks passed successfully."