libmpdserver

Parser combinator library for MPD client commands

git clone https://git.8pit.net/libmpdserver.git

 1#!/bin/sh
 2
 3TESTRUNNER="$(pwd)/../cmd2yaml"
 4
 5logfile="${TMPDIR:-/tmp}/libmpdserver-valgrind"
 6trap "rm -f '${logfile}' 2>/dev/null" INT EXIT
 7
 8for test in *; do
 9	[ -d "${test}" ] || continue
10
11	name=${test##*/}
12	printf "Checking test input '%s': " "${name}"
13
14	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/null
18
19	if [ $? -eq 42 ]; then
20		printf "valgrind failed.\n"
21		cat "${logfile}"
22		exit 1
23	fi
24
25	printf "OK.\n"
26done