Skip to content
Snippets Groups Projects
Commit 7531ff96 authored by Simon McVittie's avatar Simon McVittie
Browse files

test-init: If running in the LD_LIBRARY_PATH runtime, set helpers path


Otherwise, the SrtSystemInfo in test-system-info-cli will be unable to
find the necessary helpers, because its path relative to the runtime
is unlikely to be what it would be when installed "properly" into a
sysroot.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent f605f5c1
No related branches found
No related tags found
1 merge request!492tests: Improve ability to run tests against LD_LIBRARY_PATH Steam Runtime
......@@ -141,6 +141,8 @@ _srt_tests_init (int *argc,
char ***argv,
const char *reserved)
{
const char *env;
g_return_if_fail (!tests_init_done);
g_return_if_fail (reserved == NULL);
tests_init_done = TRUE;
......@@ -152,4 +154,15 @@ _srt_tests_init (int *argc,
/* Do this *after* g_test_init so we can hijack its log handler */
gtest_log_func = g_log_set_default_handler (split_log_func, NULL);
#endif
env = g_getenv ("STEAM_RUNTIME");
if (env != NULL && env[0] == '/')
{
gchar *helpers = g_build_filename (env, "usr", "libexec",
"steam-runtime-tools-0", NULL);
g_setenv ("SRT_HELPERS_PATH", helpers, TRUE);
g_free (helpers);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment