#!/bin/sh TMPDIR="/tmp/lv$$" VALGRIND=`which valgrind` mkdir -p "$TMPDIR" if test -x "$VALGRIND"; then echo "using $VALGRIND" echo else echo "$0: can't find valgrind binary" exit fi cat > "$TMPDIR/testhost.c" < #include int main() { const LADSPA_Descriptor *desc; LADSPA_Handle *handle; unsigned int i, j; LADSPA_Data val; for (i=0; (desc = ladspa_descriptor(i)); i++) { handle = desc->instantiate(desc, 44100); if (desc->activate) { desc->activate(handle); } for (j=0; jPortCount; j++) { desc->connect_port(handle, j, &val); } val = 0.0f; desc->run(handle, 1); if (desc->deactivate) { desc->deactivate(handle); } desc->cleanup(handle); } return 0; } EOB for i in $*; do gcc -g -o "$TMPDIR/vtest.bin" "$TMPDIR/testhost.c" $i $VALGRIND -q --leak-check=yes --show-reachable=yes "$TMPDIR/vtest.bin" 2>&1 | sed 's/^==[0-9]*==//' > "$TMPDIR/test.log" if test `cat "$TMPDIR/test.log" | wc -l` -gt 2; then echo fail: `basename $i` cat "$TMPDIR/test.log" else echo ok: `basename $i` fi done rm -f "$TMPDIR/testhost.c" "$TMPDIR/vtest.bin" "$TMPDIR/test.log" rmdir "$TMPDIR"