diff options
author | Ted Gould <ted@gould.cx> | 2010-06-28 21:47:43 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-06-28 21:47:43 -0500 |
commit | cba3c47e7fe383c6c3496a55158a86fe6994dd35 (patch) | |
tree | e805a8c1d237ff86fe25546ada3db9b231e67462 | |
parent | dce233d4c70e90cfb0f3862ba66538222ffbb7d6 (diff) | |
download | libdbusmenu-cba3c47e7fe383c6c3496a55158a86fe6994dd35.tar.gz libdbusmenu-cba3c47e7fe383c6c3496a55158a86fe6994dd35.tar.bz2 libdbusmenu-cba3c47e7fe383c6c3496a55158a86fe6994dd35.zip |
Redirecting output to a file.
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | tests/Makefile.am | 1 | ||||
-rw-r--r-- | tests/test-json-client.c | 11 |
3 files changed, 13 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index fdc76fb..598df4a 100644 --- a/configure.ac +++ b/configure.ac @@ -62,8 +62,10 @@ AC_SUBST(DBUSMENUGTK_LIBS) ########################### JSON_GLIB_REQUIRED_VERSION=0.6.0 +GIO_UNIX_REQUIRED_VERSION=2.24 -PKG_CHECK_MODULES(DBUSMENUTESTS, json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION) +PKG_CHECK_MODULES(DBUSMENUTESTS, json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION + gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION) AC_SUBST(DBUSMENUTESTS_CFLAGS) AC_SUBST(DBUSMENUTESTS_LIBS) diff --git a/tests/Makefile.am b/tests/Makefile.am index 3cd4380..1f7e36e 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -155,6 +155,7 @@ test_json_client_CFLAGS = \ test_json_client_LDADD = \ ../libdbusmenu-glib/libdbusmenu-glib.la \ + $(DBUSMENUTESTS_LIBS) \ $(DBUSMENUGLIB_LIBS) ###################### diff --git a/tests/test-json-client.c b/tests/test-json-client.c index 7208fa8..62eb87c 100644 --- a/tests/test-json-client.c +++ b/tests/test-json-client.c @@ -1,4 +1,5 @@ #include <glib.h> +#include <gio/gio.h> #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-bindings.h> #include <dbus/dbus-glib-lowlevel.h> @@ -36,10 +37,16 @@ main (int argv, char ** argc) g_debug("Initing"); - gchar * command = g_strdup_printf("%s --dbus-name=org.dbusmenu.test --dbus-object=/org/test > %s", argc[1], argc[2]); + gchar * command = g_strdup_printf("%s --dbus-name=org.dbusmenu.test --dbus-object=/org/test", argc[1]); g_debug("Executing: %s", command); - g_spawn_command_line_sync(command, NULL, NULL, NULL, NULL); + gchar * output; + g_spawn_command_line_sync(command, &output, NULL, NULL, NULL); + + GFile * ofile = g_file_new_for_commandline_arg(argc[2]); + if (ofile != NULL) { + g_file_replace_contents(ofile, output, g_utf8_strlen(output, -1), NULL, FALSE, 0, NULL, NULL, NULL); + } g_debug("Exiting"); |