donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit a953722238bb97470deb674355e73fe629a772af
parent 2a2240f1ac8d397820d70740045da5e634a4fc2d
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date:   Tue,  9 Jan 2024 10:09:17 +0100

[header] testing

Diffstat:
Msrc/include/Makefile.am | 4+++-
Asrc/include/donau_testing_lib.h | 75+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+), 1 deletion(-)

diff --git a/src/include/Makefile.am b/src/include/Makefile.am @@ -5,5 +5,7 @@ talerinclude_HEADERS = \ donau_service.h \ donau_signatures.h \ donaudb_lib.h \ - donaudb_plugin.h + donaudb_plugin.h \ + donau_testing_lib.h \ + donau_json_lib.h diff --git a/src/include/donau_testing_lib.h b/src/include/donau_testing_lib.h @@ -0,0 +1,74 @@ +/* + This file is part of TALER + (C) 2018-2023 Taler Systems SA + + TALER is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 3, or + (at your option) any later version. + + TALER is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with TALER; see the file COPYING. If not, see + <http://www.gnu.org/licenses/> +*/ + +/** + * @file include/donau_testing_lib.h + * @brief API for writing an interpreter to test Taler components + * @author Christian Grothoff <christian@grothoff.org> + * @author Marcello Stanisci + * + */ +#ifndef TALER_TESTING_LIB_H +#define TALER_TESTING_LIB_H + +#include "taler/taler_util.h" +#include <microhttpd.h> +#include <gnunet/gnunet_json_lib.h> +#include "taler/taler_json_lib.h" +#include "donau_service.h" +#include "taler/taler_testing_lib.h" + + + +/** + * Connects to the exchange. + * + * @param label command label + * @param cfg configuration to use + * @param last_keys_ref reference to command with prior /keys response, NULL for none + * @param wait_for_keys block until we got /keys + * @param load_private_key obtain private key from file indicated in @a cfg + * @return the command. + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_get_donau ( + const char *label, + const struct GNUNET_CONFIGURATION_Handle *cfg, + //const char *last_keys_ref, + bool wait_for_keys, + bool load_private_key); + + /** + * Convenience function to run a test. + * + * @param argv command-line arguments given + * @param loglevel log level to use + * @param cfg_file configuration file to use + * @param[in,out] cred global credentials to initialize + * @param main_cb main test function to run + * @param main_cb_cls closure for @a main_cb + * @return 0 on success, 77 on setup trouble, non-zero process status code otherwise + */ +int +DONAU_TESTING_main (char *const *argv, + const char *loglevel, + const char *cfg_file, + struct TALER_TESTING_Credentials *cred, + TALER_TESTING_Main main_cb, + void *main_cb_cls); +\ No newline at end of file