From 42bc31744b9810509aef344c54bfee2f4e2a7ccb Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 4 Feb 2020 21:59:43 +0100 Subject: implement /config in fakebank and taler_bank_lib.h (#6066) --- src/testing/test_bank_api.c | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'src/testing/test_bank_api.c') diff --git a/src/testing/test_bank_api.c b/src/testing/test_bank_api.c index bdafdc5fd..75e22b59e 100644 --- a/src/testing/test_bank_api.c +++ b/src/testing/test_bank_api.c @@ -52,6 +52,7 @@ static struct GNUNET_OS_Process *bankd; */ static int with_fakebank; + /** * Main function that will tell the interpreter what commands to * run. @@ -116,12 +117,32 @@ run (void *cls, } +/** + * Runs #TALER_TESTING_setup() using the configuration. + * + * @param cls unused + * @param cfg configuration to use + * @return status code + */ +static int +setup_with_cfg (void *cls, + const struct GNUNET_CONFIGURATION_Handle *cfg) +{ + (void) cls; + return TALER_TESTING_setup (&run, + NULL, + cfg, + NULL, + GNUNET_NO); +} + + int main (int argc, char *const *argv) { - int rv; const char *cfgfilename; + int rv; /* These environment variables get in the way... */ unsetenv ("XDG_DATA_HOME"); @@ -165,12 +186,13 @@ main (int argc, return 77; } } - - rv = (GNUNET_OK == TALER_TESTING_setup (&run, - NULL, - cfgfilename, - NULL, - GNUNET_NO)) ? 0 : 1; + if (GNUNET_OK != + GNUNET_CONFIGURATION_parse_and_run (cfgfilename, + &setup_with_cfg, + NULL)) + rv = 1; + else + rv = 0; if (GNUNET_NO == with_fakebank) { -- cgit v1.2.3