ostree/buildutil/tap-test
Colin Walters d25212f04a tests: Port to glib-tap.mk, make make check run all of the tests
OSTree's code for testing predates the `glib-tap.mk` making its
way into GLib.  Let's switch to it, as it provides a number
of advantages.

By far the biggest advantage is that `make check` can start to run
most of the tests *in addition* to having them work installed.

This commit keeps the installed tests working, but `make check` turns
out to be really broken because...our TAP usage has bitrotted to say
the least.  Fix that all up.

Do some hacks so that the tests work uninstalled as well - in
particular, `glib-tap.mk` and the bits encoded into
`g_test_build_filename()` assume *recursive* Automake (blah).  Work
around that by creating a symlink when installed to loop back.
2016-03-03 08:50:19 -05:00

14 lines
248 B
Bash
Executable File

#! /bin/bash
# run a GTest in tap mode. The test binary is passed as $1
srcd=$(cd $(dirname $1) && pwd)
bn=$(basename $1)
tempdir=$(mktemp -d)
function cleanup () {
rm "${tempdir}" -rf
}
trap cleanup EXIT
cd ${tempdir}
${srcd}/${bn} -k --tap