Files
heltec-repeater/firmware/test/run_tests.sh
T

17 lines
514 B
Bash
Executable File

#!/usr/bin/env bash
# Build and run the host-side wM-Bus frame tests under AddressSanitizer.
# The sanitizer is the point: these tests feed adversarial lengths through
# the CRC walk, and only ASan makes an out-of-bounds read observable.
set -euo pipefail
cd "$(dirname "$0")"
CC=${CC:-gcc}
OUT=$(mktemp -d)
trap 'rm -rf "$OUT"' EXIT
"$CC" -std=c11 -O1 -g -Wall -Wextra -Werror \
-fsanitize=address,undefined -fno-omit-frame-pointer \
-o "$OUT/test_wmbus" test_wmbus.c ../main/wmbus.c
"$OUT/test_wmbus"