tests/gsubprocess: Locate test child binary for installed tests too

Just use the new g_test_build_filename() rather than assuming
it's in cwd.
This commit is contained in:
Colin Walters 2013-10-17 22:39:48 +01:00
parent f7e2190e74
commit ebd098155b

View File

@ -17,25 +17,21 @@ get_test_subprocess_args (const char *mode,
...) ...)
{ {
GPtrArray *ret; GPtrArray *ret;
char *cwd; char *path;
char *cwd_path;
const char *binname; const char *binname;
va_list args; va_list args;
gpointer arg; gpointer arg;
ret = g_ptr_array_new_with_free_func (g_free); ret = g_ptr_array_new_with_free_func (g_free);
cwd = g_get_current_dir ();
#ifdef G_OS_WIN32 #ifdef G_OS_WIN32
binname = "gsubprocess-testprog.exe"; binname = "gsubprocess-testprog.exe";
#else #else
binname = "gsubprocess-testprog"; binname = "gsubprocess-testprog";
#endif #endif
cwd_path = g_build_filename (cwd, binname, NULL); path = g_test_build_filename (G_TEST_BUILT, binname, NULL);
g_free (cwd); g_ptr_array_add (ret, path);
g_ptr_array_add (ret, cwd_path);
g_ptr_array_add (ret, g_strdup (mode)); g_ptr_array_add (ret, g_strdup (mode));
va_start (args, mode); va_start (args, mode);