Commit 6eb1c2cd authored by Simon McVittie's avatar Simon McVittie

test_get_helper_executable: Add function

This is basically the same as get_test_exec() in dbus-spawn-test.c,
but GLib-flavoured.
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 2a2c6e67
......@@ -890,3 +890,23 @@ test_incomplete (const gchar *message)
g_test_skip (message);
}
}
/*
* Return location of @exe test helper executable, or NULL if unknown.
*
* @exe must already include %DBUS_EXEEXT if appropriate.
*
* Returns: (transfer full) (nullable): an absolute path or NULL.
*/
gchar *
test_get_helper_executable (const gchar *exe)
{
const char *dbus_test_exec;
dbus_test_exec = _dbus_getenv ("DBUS_TEST_EXEC");
if (dbus_test_exec == NULL)
return NULL;
return g_build_filename (dbus_test_exec, exe, NULL);
}
......@@ -129,4 +129,6 @@ void test_store_result_cb (GObject *source_object,
void test_incomplete (const gchar *message);
gchar *test_get_helper_executable (const gchar *exe);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment