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.
This commit is contained in:
Colin Walters committed 2016-03-03 08:50:19 -05:00
1 parent 6d73a620e1
commit d25212f04a
48 files changed
+980 -173

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
#! /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