aboutsummaryrefslogtreecommitdiff
path: root/src/mint/test_mint_db.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <sreeharsha@totakura.in>2015-03-26 18:31:59 +0100
committerSree Harsha Totakura <sreeharsha@totakura.in>2015-03-26 18:31:59 +0100
commitc53a4d5b82b7235734b21481305932a031ef7822 (patch)
treeb2b4c5ea1122542e3c8cdabd1e065d65d2c4afa3 /src/mint/test_mint_db.c
parentf94bb0a3a076caab71597b32963fd2815b8446f9 (diff)
db: pick the right plugin in the DB testcase
Diffstat (limited to 'src/mint/test_mint_db.c')
-rw-r--r--src/mint/test_mint_db.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/mint/test_mint_db.c b/src/mint/test_mint_db.c
index ef882b90a..4f41cdc23 100644
--- a/src/mint/test_mint_db.c
+++ b/src/mint/test_mint_db.c
@@ -354,13 +354,34 @@ main (int argc,
static const struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
+ const char *argv2[] = {
+ "test-mint-db-<plugin_name>", /* will be replaced later */
+ "-c", "test-mint-db-<plugin_name>.conf", /* will be replaced later */
+ NULL,
+ };
+ const char *plugin_name;
+ char *config_filename;
result = -1;
+ if (NULL == (plugin_name = strrchr (argv[0], (int) '-')))
+ {
+ GNUNET_break (0);
+ return -1;
+ }
+ plugin_name++;
+ (void) GNUNET_asprintf (&config_filename,
+ "test-mint-db-%s.conf", plugin_name);
+ argv2[0] = argv[0];
+ argv2[2] = config_filename;
if (GNUNET_OK !=
- GNUNET_PROGRAM_run (argc, argv,
- "test-mint-db",
+ GNUNET_PROGRAM_run ((sizeof (argv2)/sizeof (char *)) - 1, argv2,
+ "test-mint-db-postgres",
"Test cases for mint database helper functions.",
options, &run, NULL))
+ {
+ GNUNET_free (config_filename);
return 3;
+ }
+ GNUNET_free (config_filename);
return result;
}