1#!/bin/sh23TESTRUNNER="$(pwd)/../cmd2yaml"45logfile="${TMPDIR:-/tmp}/libmpdserver-valgrind"6trap "rm -f '${logfile}' 2>/dev/null" INT EXIT78for test in *; do9 [ -d "${test}" ] || continue1011 name=${test##*/}12 printf "Checking test input '%s': " "${name}"1314 valgrind --exit-on-first-error=yes --error-exitcode=42 \15 --leak-check=full --show-leak-kinds=all \16 --log-file="${logfile}" \17 "${TESTRUNNER}" < "${test}/input" >/dev/null1819 if [ $? -eq 42 ]; then20 printf "valgrind failed.\n"21 cat "${logfile}"22 exit 123 fi2425 printf "OK.\n"26done