2013-05-30 08:22:22 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
TEST_BINARY=$1
|
|
|
|
shift
|
|
|
|
|
|
|
|
SYMBOL_PREFIX=$1
|
|
|
|
shift
|
|
|
|
|
|
|
|
UNIT_TEST=$1
|
|
|
|
shift
|
|
|
|
|
2018-12-01 00:48:38 -05:00
|
|
|
test -z "${UNIT_TEST}" && {
|
2013-05-30 08:22:22 -04:00
|
|
|
echo "Usage: $0 UNIT_TEST"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2018-12-01 00:48:38 -05:00
|
|
|
BINARY_NAME=$(basename "$TEST_BINARY")
|
|
|
|
UNIT_TEST=$(echo "$UNIT_TEST"|sed 's/-/_/g')
|
2013-05-30 08:22:22 -04:00
|
|
|
|
2018-12-01 00:48:38 -05:00
|
|
|
echo "Running: ./$BINARY_NAME ${UNIT_TEST} $*"
|
2013-05-30 08:22:22 -04:00
|
|
|
echo ""
|
2018-12-01 00:48:38 -05:00
|
|
|
COGL_TEST_VERBOSE=1 "$TEST_BINARY" "${UNIT_TEST}" "$@"
|
2013-05-30 08:22:22 -04:00
|
|
|
exit_val=$?
|
|
|
|
|
2018-12-01 00:48:38 -05:00
|
|
|
if test "$exit_val" -eq 0; then
|
2013-05-30 08:22:22 -04: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 00:48:38 -05:00
|
|
|
exit "$exit_val"
|