aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_bank_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-02-04 21:59:43 +0100
committerChristian Grothoff <christian@grothoff.org>2020-02-04 21:59:43 +0100
commit42bc31744b9810509aef344c54bfee2f4e2a7ccb (patch)
tree92ece6674b23f5e985755992a2ddb840cdd2de7f /src/testing/test_bank_api.c
parente6d6987e5685b35f6c3137f59894a02a63d09766 (diff)
implement /config in fakebank and taler_bank_lib.h (#6066)
Diffstat (limited to 'src/testing/test_bank_api.c')
-rw-r--r--src/testing/test_bank_api.c36
1 files changed, 29 insertions, 7 deletions
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)
{