#!/bin/sh

if [ -z "$expected" ]; then
	echo "invalid test case, missing \$expected variable" >&2
fi
if [ -z "$arguments" ]; then
	echo "invalid test case, missing \$arguments variable" >&2
fi

testquery="${top_builddir}/tests/testquery"
if [ -n "$USE_VALGRIND" ] && (type valgrind 1>/dev/null)
then
	output="`valgrind -q --error-exitcode=1 "$testquery" $arguments`"
else
	output="`"$testquery" $arguments`"
fi
runresult=$?
test x"$expected" = x"$output" -a x"$runresult" = "x0"
result=$?
if [ $# -gt 0 ] && [ x"$1" = x"-d" ]; then
	echo "for $arguments (exit $runresult)"
	echo "expected:"
	echo "$expected"
	echo "got:"
	echo "$output"
	if [ "0" = "$result" ]; then
		echo "result: pass"
	else
		echo "result: fail ($result)"
	fi
fi
exit $result

#!/bin/sh

if [ -z "$expected" ]; then
	echo "invalid test case, missing \$expected variable" >&2
fi
if [ -z "$arguments" ]; then
	echo "invalid test case, missing \$arguments variable" >&2
fi

testquery="${top_builddir}/tests/testquery"
if [ -n "$USE_VALGRIND" ] && (type valgrind 1>/dev/null)
then
	output="`valgrind -q --trace-children=yes --error-exitcode=1 "$testquery" $arguments`"
else
	output="`"$testquery" $arguments`"
fi
runresult=$?
test x"$expected" = x"$output" -a x"$runresult" = "x0"
result=$?
if [ $# -gt 0 ] && [ x"$1" = x"-d" ]; then
	echo "for $arguments (exit $runresult)"
	echo "expected:"
	echo "$expected"
	echo "got:"
	echo "$output"
	if [ "0" = "$result" ]; then
		echo "result: pass"
	else
		echo "result: fail ($result)"
	fi
fi
exit $result

Make sure that libtoolized binaries gets properly tested
Make sure that libtoolized binaries gets properly tested

Add --trace-children=yes to valgrind command which for libxdg-basedir-1.2.0
makes the command `make -C tests check-TESTS USE_VALGRIND=1` find the bug
fixed in commit 14e000f6:

    PASS: testdump
    PASS: querycd.1
    PASS: querycd.2
    PASS: querycd.3
    PASS: querycd.4
    PASS: querycd.5
    FAIL: querycf.1
    FAIL: querycf.2
    FAIL: querycs.1
    PASS: querycs.2
    FAIL: querycs.3
    PASS: querycs.4
    PASS: querycs.5
    PASS: querydd.1
    PASS: querydd.2
    PASS: querydd.3
    PASS: querydd.4
    PASS: querydd.5
    FAIL: querydf.1
    FAIL: querydf.2
    FAIL: querydh.1
    PASS: querydh.2
    PASS: querydh.3
    FAIL: queryds.1
    PASS: queryds.2
    PASS: queryds.3
    FAIL: queryds.4
    PASS: queryds.5
    PASS: queryds.6
    PASS: queryrd.1
    PASS: queryrd.2
    =========================================================
    Testsuite summary for libxdg-basedir 1.2.0
    =========================================================
    # TOTAL: 31
    # PASS:  22
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  9
    # XPASS: 0
    # ERROR: 0
