- { GNUNET_GETOPT_OPTION_END };
- pfx = GNUNET_OS_installation_get_path(GNUNET_OS_IPK_BINDIR);
- GNUNET_asprintf(&fn, "%s%cgnunet-service-resolver", pfx, DIR_SEPARATOR);
- GNUNET_free(pfx);
- pid = GNUNET_OS_start_process(NULL, NULL, fn, "gnunet-service-resolver",
-#if VERBOSE
- "-L", "DEBUG",
-#endif
- "-c", "test_resolver_api_data.conf", NULL);
- GNUNET_free(fn);
- GNUNET_assert(GNUNET_OK == GNUNET_PROGRAM_run((sizeof(argv) / sizeof(char *))
- - 1, argv, "test-resolver-api", "nohelp", options, &run, &ok));
- if (0 != PLIBC_KILL(pid, SIGTERM))
- {
- GNUNET_log_strerror(GNUNET_ERROR_TYPE_WARNING, "kill");
- ok = 1;
- }
- GNUNET_OS_process_wait(pid);
- if (ok != 0)
- fprintf(stderr, "Missed some resolutions: %u\n", ok);
+ { GNUNET_GETOPT_OPTION_END };
+
+ GNUNET_log_setup ("test-resolver-api",
+ "WARNING",
+ NULL);
+ fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
+ proc = GNUNET_OS_start_process (GNUNET_YES,
+ GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ NULL, NULL, fn,
+ "gnunet-service-resolver",
+ "-c", "test_resolver_api_data.conf", NULL);
+ GNUNET_assert (NULL != proc);
+ GNUNET_free (fn);
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1,
+ argvx, "test-resolver-api", "nohelp",
+ options, &run, &ok));
+ if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
+ {
+ GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
+ ok = 1;
+ }
+ GNUNET_OS_process_wait (proc);
+ GNUNET_OS_process_destroy (proc);
+ proc = NULL;
+ if (0 != ok)
+ FPRINTF (stderr, "Missed some resolutions: %u\n", ok);