#!/usr/bin/env bash # # testall.sh -- run every test suite available on this machine. # # * CMake + ctest (host build of the C core + the codec unit test) # * pio test -e native (the same unit test via PlatformIO's native env) # * pio ci (compile an Arduino example for an ESP32-S3 board) # # Each suite is optional: if a tool is missing the suite is skipped with a # warning, so this works on a cmake-only box, a PlatformIO-only box, or both. # Exit status is non-zero if any suite that DID run failed (or if nothing could # run at all). # # ./testall.sh # ARDUINO_BOARD=esp32dev ./testall.sh # override the board # # SPDX-License-Identifier: MIT set -u cd "$(dirname "$0")" || exit 2 ARDUINO_BOARD="${ARDUINO_BOARD:-esp32-s3-devkitc-1}" ARDUINO_EXAMPLE="examples/SensorChannelBridge/SensorChannelBridge.ino" ran=0 failed=0 skipped=0 results=() have() { command -v "$1" >/dev/null 2>&1; } section() { printf '\n\033[1m==== %s ====\033[0m\n' "$1"; } warn() { printf '\033[33mWARN:\033[0m %s\n' "$*" >&2; } # run_suite