[glib] tests/gsubprocess: Locate test child binary for installed tests too



commit ebd098155b45d87cbf5ca1d3abdac526a51cc1c2
Author: Colin Walters <walters verbum org>
Date:   Thu Oct 17 22:39:48 2013 +0100

    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.

 gio/tests/gsubprocess.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/gio/tests/gsubprocess.c b/gio/tests/gsubprocess.c
index 716ce06..1d692f8 100644
--- a/gio/tests/gsubprocess.c
+++ b/gio/tests/gsubprocess.c
@@ -17,25 +17,21 @@ get_test_subprocess_args (const char *mode,
                           ...)
 {
   GPtrArray *ret;
-  char *cwd;
-  char *cwd_path;
+  char *path;
   const char *binname;
   va_list args;
   gpointer arg;
 
   ret = g_ptr_array_new_with_free_func (g_free);
 
-  cwd = g_get_current_dir ();
-
 #ifdef G_OS_WIN32
   binname = "gsubprocess-testprog.exe";
 #else
   binname = "gsubprocess-testprog";
 #endif
 
-  cwd_path = g_build_filename (cwd, binname, NULL);
-  g_free (cwd);
-  g_ptr_array_add (ret, cwd_path);
+  path = g_test_build_filename (G_TEST_BUILT, binname, NULL);
+  g_ptr_array_add (ret, path);
   g_ptr_array_add (ret, g_strdup (mode));
 
   va_start (args, mode);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]