[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r21854 - in gnunet/src: datacache datastore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r21854 - in gnunet/src: datacache datastore |
Date: |
Sun, 10 Jun 2012 13:43:21 +0200 |
Author: grothoff
Date: 2012-06-10 13:43:20 +0200 (Sun, 10 Jun 2012)
New Revision: 21854
Modified:
gnunet/src/datacache/Makefile.am
gnunet/src/datacache/perf_datacache.c
gnunet/src/datacache/test_datacache.c
gnunet/src/datacache/test_datacache_quota.c
gnunet/src/datastore/Makefile.am
gnunet/src/datastore/perf_datastore_api.c
gnunet/src/datastore/perf_plugin_datastore.c
gnunet/src/datastore/test_datastore_api.c
gnunet/src/datastore/test_datastore_api_management.c
gnunet/src/datastore/test_plugin_datastore.c
Log:
-using new testing api to determine plugin name
Modified: gnunet/src/datacache/Makefile.am
===================================================================
--- gnunet/src/datacache/Makefile.am 2012-06-10 11:38:46 UTC (rev 21853)
+++ gnunet/src/datacache/Makefile.am 2012-06-10 11:43:20 UTC (rev 21854)
@@ -134,54 +134,63 @@
test_datacache_sqlite_SOURCES = \
test_datacache.c
test_datacache_sqlite_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datacache/libgnunetdatacache.la \
$(top_builddir)/src/util/libgnunetutil.la
test_datacache_quota_sqlite_SOURCES = \
test_datacache_quota.c
test_datacache_quota_sqlite_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datacache/libgnunetdatacache.la \
$(top_builddir)/src/util/libgnunetutil.la
perf_datacache_sqlite_SOURCES = \
perf_datacache.c
perf_datacache_sqlite_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datacache/libgnunetdatacache.la \
$(top_builddir)/src/util/libgnunetutil.la
test_datacache_mysql_SOURCES = \
test_datacache.c
test_datacache_mysql_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datacache/libgnunetdatacache.la \
$(top_builddir)/src/util/libgnunetutil.la
test_datacache_quota_mysql_SOURCES = \
test_datacache_quota.c
test_datacache_quota_mysql_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datacache/libgnunetdatacache.la \
$(top_builddir)/src/util/libgnunetutil.la
perf_datacache_mysql_SOURCES = \
perf_datacache.c
perf_datacache_mysql_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datacache/libgnunetdatacache.la \
$(top_builddir)/src/util/libgnunetutil.la
test_datacache_postgres_SOURCES = \
test_datacache.c
test_datacache_postgres_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datacache/libgnunetdatacache.la \
$(top_builddir)/src/util/libgnunetutil.la
test_datacache_quota_postgres_SOURCES = \
test_datacache_quota.c
test_datacache_quota_postgres_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datacache/libgnunetdatacache.la \
$(top_builddir)/src/util/libgnunetutil.la
perf_datacache_postgres_SOURCES = \
perf_datacache.c
perf_datacache_postgres_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/datacache/libgnunetdatacache.la \
$(top_builddir)/src/util/libgnunetutil.la
Modified: gnunet/src/datacache/perf_datacache.c
===================================================================
--- gnunet/src/datacache/perf_datacache.c 2012-06-10 11:38:46 UTC (rev
21853)
+++ gnunet/src/datacache/perf_datacache.c 2012-06-10 11:43:20 UTC (rev
21854)
@@ -25,9 +25,9 @@
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_datacache_lib.h"
+#include "gnunet_testing_lib-new.h"
#include <gauger.h>
-#define VERBOSE GNUNET_NO
#define ASSERT(x) do { if (! (x)) { printf("Error at %s:%d\n", __FILE__,
__LINE__); goto FAILURE;} } while (0)
@@ -129,16 +129,11 @@
int
main (int argc, char *argv[])
{
- char *pos;
char cfg_name[128];
-
char *const xargv[] = {
"perf-datacache",
"-c",
cfg_name,
-#if VERBOSE
- "-L", "DEBUG",
-#endif
NULL
};
struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -146,25 +141,11 @@
};
GNUNET_log_setup ("perf-datacache",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
- /* determine name of plugin to use */
- plugin_name = argv[0];
- while (NULL != (pos = strstr (plugin_name, "_")))
- plugin_name = pos + 1;
- if (NULL != (pos = strstr (plugin_name, ".")))
- pos[0] = 0;
- else
- pos = (char *) plugin_name;
-
+ plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
GNUNET_snprintf (cfg_name, sizeof (cfg_name), "perf_datacache_data_%s.conf",
plugin_name);
- if (pos != plugin_name)
- pos[0] = '.';
GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
"perf-datacache", "nohelp", options, &run, NULL);
if (ok != 0)
Modified: gnunet/src/datacache/test_datacache.c
===================================================================
--- gnunet/src/datacache/test_datacache.c 2012-06-10 11:38:46 UTC (rev
21853)
+++ gnunet/src/datacache/test_datacache.c 2012-06-10 11:43:20 UTC (rev
21854)
@@ -25,6 +25,7 @@
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_datacache_lib.h"
+#include "gnunet_testing_lib-new.h"
#define ASSERT(x) do { if (! (x)) { printf("Error at %s:%d\n", __FILE__,
__LINE__); goto FAILURE;} } while (0)
@@ -114,9 +115,7 @@
int
main (int argc, char *argv[])
{
- char *pos;
char cfg_name[128];
-
char *const xargv[] = {
"test-datacache",
"-c",
@@ -130,22 +129,12 @@
GNUNET_log_setup ("test-datacache",
"WARNING",
NULL);
- /* determine name of plugin to use */
- plugin_name = argv[0];
- while (NULL != (pos = strstr (plugin_name, "_")))
- plugin_name = pos + 1;
- if (NULL != (pos = strstr (plugin_name, ".")))
- pos[0] = 0;
- else
- pos = (char *) plugin_name;
-
+ plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
GNUNET_snprintf (cfg_name, sizeof (cfg_name), "test_datacache_data_%s.conf",
plugin_name);
- if (pos != plugin_name)
- pos[0] = '.';
GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
"test-datacache", "nohelp", options, &run, NULL);
- if (ok != 0)
+ if (0 != ok)
FPRINTF (stderr, "Missed some testcases: %d\n", ok);
return ok;
}
Modified: gnunet/src/datacache/test_datacache_quota.c
===================================================================
--- gnunet/src/datacache/test_datacache_quota.c 2012-06-10 11:38:46 UTC (rev
21853)
+++ gnunet/src/datacache/test_datacache_quota.c 2012-06-10 11:43:20 UTC (rev
21854)
@@ -25,9 +25,8 @@
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_datacache_lib.h"
+#include "gnunet_testing_lib-new.h"
-#define VERBOSE GNUNET_NO
-
#define ASSERT(x) do { if (! (x)) { printf("Error at %s:%d\n", __FILE__,
__LINE__); goto FAILURE;} } while (0)
static int ok;
@@ -104,16 +103,11 @@
int
main (int argc, char *argv[])
{
- char *pos;
char cfg_name[128];
-
char *const xargv[] = {
"test-datacache-quota",
"-c",
cfg_name,
-#if VERBOSE
- "-L", "DEBUG",
-#endif
NULL
};
struct GNUNET_GETOPT_CommandLineOption options[] = {
@@ -121,29 +115,15 @@
};
GNUNET_log_setup ("test-datacache-quota",
-#if VERBOSE
- "DEBUG",
-#else
"WARNING",
-#endif
NULL);
- /* determine name of plugin to use */
- plugin_name = argv[0];
- while (NULL != (pos = strstr (plugin_name, "_")))
- plugin_name = pos + 1;
- if (NULL != (pos = strstr (plugin_name, ".")))
- pos[0] = 0;
- else
- pos = (char *) plugin_name;
-
+ plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
GNUNET_snprintf (cfg_name, sizeof (cfg_name), "test_datacache_data_%s.conf",
plugin_name);
- if (pos != plugin_name)
- pos[0] = '.';
GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
"test-datacache-quota", "nohelp", options, &run, NULL);
- if (ok != 0)
+ if (0 != ok)
FPRINTF (stderr, "Missed some testcases: %d\n", ok);
return ok;
}
Modified: gnunet/src/datastore/Makefile.am
===================================================================
--- gnunet/src/datastore/Makefile.am 2012-06-10 11:38:46 UTC (rev 21853)
+++ gnunet/src/datastore/Makefile.am 2012-06-10 11:43:20 UTC (rev 21854)
@@ -162,11 +162,13 @@
perf_plugin_datastore_sqlite_SOURCES = \
perf_plugin_datastore.c
perf_plugin_datastore_sqlite_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/util/libgnunetutil.la
test_plugin_datastore_sqlite_SOURCES = \
test_plugin_datastore.c
test_plugin_datastore_sqlite_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/util/libgnunetutil.la
@@ -194,11 +196,13 @@
test_plugin_datastore_mysql_SOURCES = \
test_plugin_datastore.c
test_plugin_datastore_mysql_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/util/libgnunetutil.la
perf_plugin_datastore_mysql_SOURCES = \
perf_plugin_datastore.c
perf_plugin_datastore_mysql_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/util/libgnunetutil.la
@@ -226,11 +230,13 @@
test_plugin_datastore_postgres_SOURCES = \
test_plugin_datastore.c
test_plugin_datastore_postgres_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/util/libgnunetutil.la
perf_plugin_datastore_postgres_SOURCES = \
perf_plugin_datastore.c
perf_plugin_datastore_postgres_LDADD = \
+ $(top_builddir)/src/testing/libgnunettesting.la \
$(top_builddir)/src/util/libgnunetutil.la
Modified: gnunet/src/datastore/perf_datastore_api.c
===================================================================
--- gnunet/src/datastore/perf_datastore_api.c 2012-06-10 11:38:46 UTC (rev
21853)
+++ gnunet/src/datastore/perf_datastore_api.c 2012-06-10 11:43:20 UTC (rev
21854)
@@ -322,17 +322,9 @@
int
main (int argc, char *argv[])
{
- char *pos;
char cfg_name[128];
- /* determine name of plugin to use */
- plugin_name = argv[0];
- while (NULL != (pos = strstr (plugin_name, "_")))
- plugin_name = pos + 1;
- if (NULL != (pos = strstr (plugin_name, ".")))
- pos[0] = '\0';
- else
- pos = (char *) plugin_name;
+ plugin_name = GNUNET_TESTING_get_testname_from_underscoare (argv[0]);
GNUNET_snprintf (cfg_name, sizeof (cfg_name),
"test_datastore_api_data_%s.conf", plugin_name);
if (0 !=
Modified: gnunet/src/datastore/perf_plugin_datastore.c
===================================================================
--- gnunet/src/datastore/perf_plugin_datastore.c 2012-06-10 11:38:46 UTC
(rev 21853)
+++ gnunet/src/datastore/perf_plugin_datastore.c 2012-06-10 11:43:20 UTC
(rev 21854)
@@ -27,6 +27,7 @@
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_datastore_plugin.h"
+#include "gnunet_testing_lib-new.h"
#include <gauger.h>
/**
@@ -453,7 +454,6 @@
int
main (int argc, char *argv[])
{
- char *pos;
char dir_name[128];
char cfg_name[128];
char *const argv[] = {
@@ -466,14 +466,7 @@
GNUNET_GETOPT_OPTION_END
};
- /* determine name of plugin to use */
- plugin_name = argv[0];
- while (NULL != (pos = strstr (plugin_name, "_")))
- plugin_name = pos + 1;
- if (NULL != (pos = strstr (plugin_name, ".")))
- pos[0] = 0;
- else
- pos = (char *) plugin_name;
+ plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
GNUNET_snprintf (dir_name, sizeof (dir_name),
"/tmp/perf-gnunet-datastore-%s",
plugin_name);
GNUNET_DISK_directory_remove (dir_name);
@@ -487,8 +480,6 @@
"perf-plugin-datastore", "nohelp", options, &run, NULL);
if (ok != 0)
FPRINTF (stderr, "Missed some testcases: %u\n", ok);
- if (pos != plugin_name)
- pos[0] = '.';
GNUNET_DISK_directory_remove (dir_name);
return ok;
Modified: gnunet/src/datastore/test_datastore_api.c
===================================================================
--- gnunet/src/datastore/test_datastore_api.c 2012-06-10 11:38:46 UTC (rev
21853)
+++ gnunet/src/datastore/test_datastore_api.c 2012-06-10 11:43:20 UTC (rev
21854)
@@ -491,17 +491,9 @@
int
main (int argc, char *argv[])
{
- char *pos;
char cfg_name[128];
- /* determine name of plugin to use */
- plugin_name = argv[0];
- while (NULL != (pos = strstr (plugin_name, "_")))
- plugin_name = pos + 1;
- if (NULL != (pos = strstr (plugin_name, ".")))
- pos[0] = '\0';
- else
- pos = (char *) plugin_name;
+ plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
GNUNET_snprintf (cfg_name, sizeof (cfg_name),
"test_datastore_api_data_%s.conf", plugin_name);
if (0 !=
Modified: gnunet/src/datastore/test_datastore_api_management.c
===================================================================
--- gnunet/src/datastore/test_datastore_api_management.c 2012-06-10
11:38:46 UTC (rev 21853)
+++ gnunet/src/datastore/test_datastore_api_management.c 2012-06-10
11:43:20 UTC (rev 21854)
@@ -286,17 +286,9 @@
int
main (int argc, char *argv[])
{
- char *pos;
char cfg_name[128];
- /* determine name of plugin to use */
- plugin_name = argv[0];
- while (NULL != (pos = strstr (plugin_name, "_")))
- plugin_name = pos + 1;
- if (NULL != (pos = strstr (plugin_name, ".")))
- pos[0] = 0;
- else
- pos = (char *) plugin_name;
+ plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
GNUNET_snprintf (cfg_name, sizeof (cfg_name),
"test_datastore_api_data_%s.conf", plugin_name);
if (0 !=
Modified: gnunet/src/datastore/test_plugin_datastore.c
===================================================================
--- gnunet/src/datastore/test_plugin_datastore.c 2012-06-10 11:38:46 UTC
(rev 21853)
+++ gnunet/src/datastore/test_plugin_datastore.c 2012-06-10 11:43:20 UTC
(rev 21854)
@@ -27,6 +27,7 @@
#include "gnunet_util_lib.h"
#include "gnunet_protocols.h"
#include "gnunet_datastore_plugin.h"
+#include "gnunet_testing_lib-new.h"
/**
* Number of put operations to perform.
@@ -349,11 +350,9 @@
}
-
int
main (int argc, char *argv[])
{
- char *pos;
char dir_name[128];
char cfg_name[128];
char *const xargv[] = {
@@ -367,14 +366,7 @@
};
/* determine name of plugin to use */
- plugin_name = argv[0];
- while (NULL != (pos = strstr (plugin_name, "_")))
- plugin_name = pos + 1;
- if (NULL != (pos = strstr (plugin_name, ".")))
- pos[0] = 0;
- else
- pos = (char *) plugin_name;
-
+ plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
GNUNET_snprintf (dir_name, sizeof (dir_name),
"/tmp/test-gnunet-datastore-plugin-%s", plugin_name);
GNUNET_DISK_directory_remove (dir_name);
@@ -385,10 +377,8 @@
"test_plugin_datastore_data_%s.conf", plugin_name);
GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv,
"test-plugin-datastore", "nohelp", options, &run, NULL);
- if (ok != 0)
+ if (0 != ok)
FPRINTF (stderr, "Missed some testcases: %u\n", ok);
- if (pos != plugin_name)
- pos[0] = '.';
GNUNET_DISK_directory_remove (dir_name);
return ok;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r21854 - in gnunet/src: datacache datastore,
gnunet <=