mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-04-28 13:30:49 +02:00
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 <smcv@collabora.com>
This commit is contained in:
parent
2a2c6e6790
commit
6eb1c2cd53
2 changed files with 22 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue