aboutsummaryrefslogtreecommitdiff
path: root/src/datacache/perf_datacache.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-10 11:43:20 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-10 11:43:20 +0000
commitdadbf4c950bf4cd459c95ac4ab61a02af7b3668b (patch)
treeddaf0644dcd97fbef7f67a68eff2a5cf204b0bb7 /src/datacache/perf_datacache.c
parent8efaae301b29ec7cbdb921ac5e6b30ae2c143568 (diff)
downloadgnunet-dadbf4c950bf4cd459c95ac4ab61a02af7b3668b.tar.gz
gnunet-dadbf4c950bf4cd459c95ac4ab61a02af7b3668b.zip
-using new testing api to determine plugin name
Diffstat (limited to 'src/datacache/perf_datacache.c')
-rw-r--r--src/datacache/perf_datacache.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c
index 77edbf925..94cd7a58e 100644
--- a/src/datacache/perf_datacache.c
+++ b/src/datacache/perf_datacache.c
@@ -25,9 +25,9 @@
25#include "platform.h" 25#include "platform.h"
26#include "gnunet_util_lib.h" 26#include "gnunet_util_lib.h"
27#include "gnunet_datacache_lib.h" 27#include "gnunet_datacache_lib.h"
28#include "gnunet_testing_lib-new.h"
28#include <gauger.h> 29#include <gauger.h>
29 30
30#define VERBOSE GNUNET_NO
31 31
32#define ASSERT(x) do { if (! (x)) { printf("Error at %s:%d\n", __FILE__, __LINE__); goto FAILURE;} } while (0) 32#define ASSERT(x) do { if (! (x)) { printf("Error at %s:%d\n", __FILE__, __LINE__); goto FAILURE;} } while (0)
33 33
@@ -129,16 +129,11 @@ FAILURE:
129int 129int
130main (int argc, char *argv[]) 130main (int argc, char *argv[])
131{ 131{
132 char *pos;
133 char cfg_name[128]; 132 char cfg_name[128];
134
135 char *const xargv[] = { 133 char *const xargv[] = {
136 "perf-datacache", 134 "perf-datacache",
137 "-c", 135 "-c",
138 cfg_name, 136 cfg_name,
139#if VERBOSE
140 "-L", "DEBUG",
141#endif
142 NULL 137 NULL
143 }; 138 };
144 struct GNUNET_GETOPT_CommandLineOption options[] = { 139 struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -146,25 +141,11 @@ main (int argc, char *argv[])
146 }; 141 };
147 142
148 GNUNET_log_setup ("perf-datacache", 143 GNUNET_log_setup ("perf-datacache",
149#if VERBOSE
150 "DEBUG",
151#else
152 "WARNING", 144 "WARNING",
153#endif
154 NULL); 145 NULL);
155 /* determine name of plugin to use */ 146 plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
156 plugin_name = argv[0];
157 while (NULL != (pos = strstr (plugin_name, "_")))
158 plugin_name = pos + 1;
159 if (NULL != (pos = strstr (plugin_name, ".")))
160 pos[0] = 0;
161 else
162 pos = (char *) plugin_name;
163
164 GNUNET_snprintf (cfg_name, sizeof (cfg_name), "perf_datacache_data_%s.conf", 147 GNUNET_snprintf (cfg_name, sizeof (cfg_name), "perf_datacache_data_%s.conf",
165 plugin_name); 148 plugin_name);
166 if (pos != plugin_name)
167 pos[0] = '.';
168 GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv, 149 GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
169 "perf-datacache", "nohelp", options, &run, NULL); 150 "perf-datacache", "nohelp", options, &run, NULL);
170 if (ok != 0) 151 if (ok != 0)