diff options
author | Alban Crequy <alban.crequy@collabora.co.uk> | 2011-11-01 11:24:56 +0000 |
---|---|---|
committer | Alban Crequy <alban.crequy@collabora.co.uk> | 2011-11-04 16:44:25 +0000 |
commit | d2e6b77f34cf74cbaa8ec8f352ff7b7d9be117d4 (patch) | |
tree | f2f4cd55f2818c98cdf3576ad6fff6d59b9aa503 | |
parent | e745c29573950efcb7ffd7c0b6184582c4365c05 (diff) |
test example-no-protocols: fix the test when it is installed
https://bugs.freedesktop.org/show_bug.cgi?id=41455
-rw-r--r-- | tests/dbus/example-no-protocols.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/tests/dbus/example-no-protocols.c b/tests/dbus/example-no-protocols.c index f3a89c53..321c8afc 100644 --- a/tests/dbus/example-no-protocols.c +++ b/tests/dbus/example-no-protocols.c @@ -11,14 +11,23 @@ prepare (void) { GError *error = NULL; const gchar *abs_top_builddir = g_getenv ("abs_top_builddir"); - gchar *command[] = { - g_strdup_printf ("%s/%s", - abs_top_builddir, - "examples/cm/no-protocols/telepathy-example-no-protocols"), - NULL - }; - - g_assert (abs_top_builddir != NULL); + const gchar *libexec = g_getenv ("libexec"); + gchar *command[] = { NULL, NULL }; + + g_assert (abs_top_builddir != NULL || libexec != NULL); + + if (abs_top_builddir != NULL) + { + command[0] = g_strdup_printf ("%s/%s", + abs_top_builddir, + "examples/cm/no-protocols/telepathy-example-no-protocols"); + } + else + { + command[0] = g_strdup_printf ("%s/%s", + libexec, + "telepathy-example-no-protocols"); + } if (!g_spawn_async (NULL, command, NULL, 0, NULL, NULL, NULL, &error)) { |