2013-05-30 12:22:22 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
TEST_BINARY=$1
|
|
|
|
shift
|
|
|
|
|
|
|
|
SYMBOL_PREFIX=$1
|
|
|
|
shift
|
|
|
|
|
|
|
|
UNIT_TEST=$1
|
|
|
|
shift
|
|
|
|
|
2018-12-01 05:48:38 +00:00
|
|
|
test -z "${UNIT_TEST}" && {
|
2013-05-30 12:22:22 +00:00
|
|
|
echo "Usage: $0 UNIT_TEST"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2018-12-01 05:48:38 +00:00
|
|
|
BINARY_NAME=$(basename "$TEST_BINARY")
|
|
|
|
UNIT_TEST=$(echo "$UNIT_TEST"|sed 's/-/_/g')
|
2013-05-30 12:22:22 +00:00
|
|
|
|
2018-12-01 05:48:38 +00:00
|
|
|
echo "Running: ./$BINARY_NAME ${UNIT_TEST} $*"
|
2013-05-30 12:22:22 +00:00
|
|
|
echo ""
|
2018-12-01 05:48:38 +00:00
|
|
|
COGL_TEST_VERBOSE=1 "$TEST_BINARY" "${UNIT_TEST}" "$@"
|
2013-05-30 12:22:22 +00:00
|
|
|
exit_val=$?
|
|
|
|
|
2018-12-01 05:48:38 +00:00
|
|
|
if test "$exit_val" -eq 0; then
|
2013-05-30 12:22:22 +00:00
|
|
|
echo "OK"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "NOTE: For debugging purposes, you can run this single test as follows:"
|
|
|
|
echo "$ libtool --mode=execute \\"
|
|
|
|
echo " gdb --eval-command=\"start\" --eval-command=\"b ${UNIT_TEST#${SYMBOL_PREFIX}}\" \\"
|
|
|
|
echo " --args ./$BINARY_NAME ${UNIT_TEST}"
|
|
|
|
echo "or:"
|
|
|
|
echo "$ env G_SLICE=always-malloc \\"
|
|
|
|
echo " libtool --mode=execute \\"
|
|
|
|
echo " valgrind ./$BINARY_NAME ${UNIT_TEST}"
|
|
|
|
|
2018-12-01 05:48:38 +00:00
|
|
|
exit "$exit_val"
|