#!/bin/sh # RAM-only cases under valgrind. Definite leaks are fatal (exit code 42). # # GPU finalizers are deliberately excluded: a headless/valgrind process has no # GL context, so those cases would only exercise the "skip" gate. set -u ROOT=$(CDPATH= cd -- "$(dirname "$0")/.." && pwd) cd "$ROOT" || exit 1 export HATE_NO_D_ROOT="$ROOT" if ! command -v valgrind >/dev/null 2>&1; then echo "skip valgrind (not installed)" exit 0 fi if [ ! -x ./hate-no-d ]; then echo "run-valgrind.sh: ./hate-no-d not built (run make)" >&2 exit 1 fi CASES="02_explicit 07_inout 08c_font_atlas 09_pointers 10_ram 11_strings" fail=0 HATE_NO_D_VALGRIND=1 export HATE_NO_D_VALGRIND for name in $CASES; do case="tests/cases/$name.lua" if [ ! -f "$case" ]; then echo "FAIL $name (missing $case)" >&2 fail=1 continue fi echo "valgrind $name" if valgrind --quiet --error-exitcode=42 \ --leak-check=full --show-leak-kinds=definite \ --errors-for-leak-kinds=definite \ --suppressions=tests/valgrind.supp \ ./hate-no-d "$case"; then : else status=$? echo "FAIL $name (valgrind exit $status)" >&2 fail=1 fi done if [ "$fail" -eq 0 ]; then echo "check-valgrind: ok" fi exit "$fail"