2 This file is part of GNUnet.
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
21 * @file sensor/test_sensor_api.c
22 * @brief testcase for sensor_api.c
25 #include "gnunet_util_lib.h"
26 #include "gnunet_sensor_service.h"
33 run (void *cls, char *const *args, const char *cfgfile,
34 const struct GNUNET_CONFIGURATION_Handle *cfg)
43 char *const argv[] = { "test-sensor-api", NULL };
44 struct GNUNET_GETOPT_CommandLineOption options[] = {
45 GNUNET_GETOPT_OPTION_END
47 struct GNUNET_OS_Process *proc;
48 char *path = GNUNET_OS_get_libexec_binary_path ("gnunet-service-sensor");
52 fprintf (stderr, "Service executable not found `%s'\n",
53 "gnunet-service-sensor");
58 GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_ALL, NULL, NULL,
59 NULL, path, "gnunet-service-sensor", NULL);
62 GNUNET_assert (NULL != proc);
63 GNUNET_PROGRAM_run (1, argv, "test-sensor-api", "nohelp", options, &run, &ok);
64 if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
66 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
69 GNUNET_OS_process_wait (proc);
70 GNUNET_OS_process_destroy (proc);
76 main (int argc, char *argv[])
78 GNUNET_log_setup ("test_statistics_api", "WARNING", NULL);
82 /* end of test_sensor_api.c */