From 55c7cc4ce969d597387090d2221ae495f943c152 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Wed, 28 Nov 2012 13:50:10 +0000 Subject: [PATCH] add a test for glibtop --- src/sysmon/Makefile.am | 14 +++++++++++++- src/sysmon/gnunet-daemon-sysmon.c | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/sysmon/Makefile.am b/src/sysmon/Makefile.am index 4fed26a3e..4c4cb1a5b 100644 --- a/src/sysmon/Makefile.am +++ b/src/sysmon/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = -I$(top_srcdir)/src/include +INCLUDES = -I$(top_srcdir)/src/include -I/usr/include/glib-2.0 -I/usr/include -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ -I/usr/include/libgtop-2.0/ pkgcfgdir= $(pkgdatadir)/config.d/ @@ -18,6 +18,9 @@ endif libexec_PROGRAMS = \ gnunet_daemon_sysmon +check_PROGRAMS = \ + test_glibtop + gnunet_daemon_sysmon_SOURCES = \ gnunet-daemon-sysmon.c gnunet_daemon_sysmon_LDADD = \ @@ -25,6 +28,15 @@ gnunet_daemon_sysmon_LDADD = \ $(top_builddir)/src/statistics/libgnunetstatistics.la \ $(GN_LIBINTL) +test_glibtop_SOURCES = \ + test_glibtop.c +test_glibtop_LDADD = \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + -lgtop-2.0 \ + $(GN_LIBINTL) + + if ENABLE_TEST_RUN TESTS = $(check_PROGRAMS) endif diff --git a/src/sysmon/gnunet-daemon-sysmon.c b/src/sysmon/gnunet-daemon-sysmon.c index 4926a3c1d..387c4bd2e 100644 --- a/src/sysmon/gnunet-daemon-sysmon.c +++ b/src/sysmon/gnunet-daemon-sysmon.c @@ -224,6 +224,7 @@ static void exec_cmd_proc (void *cls, const char *line) { struct SysmonProperty *sp = cls; + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Property output: `%s'\n", line); if (NULL == line) { GNUNET_OS_command_stop (sp->cmd_exec_handle); @@ -264,6 +265,7 @@ exec_cmd (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) sp->cmd_exec_handle = NULL; GNUNET_break (0); } + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Property `%s': command `%s' `%s'\n", sp->desc, sp->cmd, sp->cmd_args); if (NULL == (sp->cmd_exec_handle = GNUNET_OS_command_run (&exec_cmd_proc, sp, GNUNET_TIME_UNIT_SECONDS, sp->cmd, sp->cmd, -- 2.25.1