diff options
author | Colin Walters <walters@verbum.org> | 2013-05-06 09:47:00 -0400 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2013-05-16 08:51:57 -0400 |
commit | ad7959c5b7d484c7d819a15f61cad46b6fab8cfd (patch) | |
tree | ccd480173e6dd8aafbcd9bc2e627d83a8d052313 /glib/tests/protocol.c | |
parent | 91d7c8de6bfa4290006da992ea0ef604ff24b009 (diff) | |
download | glib-ad7959c5b7d484c7d819a15f61cad46b6fab8cfd.tar.gz |
Add --enable-installed-tests configure option
See https://live.gnome.org/GnomeGoals/InstalledTests for more
information.
The tests now support being run both uninstalled and installed, so
'make check' works for those who want it. For tests which need data
files, the way this works is they look in the compiled in value of
SRCDIR by default, and the generated tests use "env G_TEST_DATA=" to
override that.
This patch only converts glib/tests for now; if this patch looks good,
I'll do the rest of the tests.
https://bugzilla.gnome.org/show_bug.cgi?id=699079
Diffstat (limited to 'glib/tests/protocol.c')
-rw-r--r-- | glib/tests/protocol.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/glib/tests/protocol.c b/glib/tests/protocol.c index cad7ed3ae..1783630bf 100644 --- a/glib/tests/protocol.c +++ b/glib/tests/protocol.c @@ -30,6 +30,8 @@ #define pipe(fds) _pipe(fds, 4096, _O_BINARY) #endif +static const char *argv0; + static void debug (void) { @@ -119,7 +121,7 @@ static void test_message (void) { gchar* argv[] = { - "./protocol", + argv0, NULL, "--GTestSubprocess", "-p", "/glib/testing/protocol/debug", @@ -239,7 +241,7 @@ test_error (void) for (i = 0; i < G_N_ELEMENTS (tests); i++) { gchar* argv[] = { - "./protocol", + argv0, NULL, "--GTestSubprocess", "-p", tests[i], @@ -336,6 +338,8 @@ int main (int argc, char**argv) { + argv0 = argv[0]; + g_test_init (&argc, &argv, NULL); /* we use ourself as the testcase, these are the ones we need internally */ |