GNUnet 0.21.0
gnunet_testing_ng_lib.h
Go to the documentation of this file.
1/*
2 This file is part of GNUnet
3 Copyright (C) 2021, 2023 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
27#ifndef GNUNET_TESTING_NG_LIB_H
28#define GNUNET_TESTING_NG_LIB_H
29
30
31#include "gnunet_util_lib.h"
32
33/* FIXME: legacy test header, to be removed!! */
34#include "gnunet_testing_lib.h"
35
39
40
51 const char *process_label,
52 int signal);
53
54
65
66
76const struct GNUNET_TESTING_Command
78 const char *script,
79 char *const script_argv[],
80 // FIXME: wtf are these two args here for!?
81 int argc,
83
84
85
86/* ****** Specific traits needed by this component ******* */
87
88
92#define GNUNET_TESTING_SIMPLE_TRAITS(op, prefix) \
93 op (prefix, process, struct GNUNET_OS_Process *)
94
95
97
98
101#define GNUNET_TESTING_INDEXED_TRAITS(op, prefix) \
102 op (prefix, uint32, const uint32_t) \
103 op (prefix, uint64, const uint64_t) \
104 op (prefix, int64, const int64_t) \
105 op (prefix, uint, const unsigned int) \
106 op (prefix, string, const char) \
107 op (prefix, uuid, const struct GNUNET_Uuid) \
108 op (prefix, time, const struct GNUNET_TIME_Absolute) \
109 op (prefix, absolute_time, const struct GNUNET_TIME_Absolute) \
110 op (prefix, relative_time, const struct GNUNET_TIME_Relative)
111
113
114
115#endif
static struct GNUNET_TIME_Relative duration
Option '-d': duration of the mapping.
Definition: gnunet-vpn.c:90
Convenience API for writing testcases for GNUnet.
#define GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT(prefix, name, type)
Create headers for a trait with name name for statically allocated data of type type.
#define GNUNET_TESTING_MAKE_DECL_INDEXED_TRAIT(prefix, name, type)
Create headers for a trait with name name for statically allocated data of type type.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_sleep(const char *label, struct GNUNET_TIME_Relative duration)
Sleep for duration.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_signal(const char *label, const char *process_label, int signal)
Meta-header for next-generation testing logic.
const struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_exec_bash_script(const char *label, const char *script, char *const script_argv[], int argc, GNUNET_ChildCompletedCallback cb)
Command to execute a script synchronously.
#define GNUNET_TESTING_INDEXED_TRAITS(op, prefix)
Call op on all indexed traits.
#define GNUNET_TESTING_SIMPLE_TRAITS(op, prefix)
Call op on all simple traits.
void(* GNUNET_ChildCompletedCallback)(void *cls, enum GNUNET_OS_ProcessStatusType type, long unsigned int exit_code)
Defines a GNUNET_ChildCompletedCallback which is sent back upon death or completion of a child proces...
A command to be run by the interpreter.
struct GNUNET_TESTING_CommandLabel label
Label for the command.
Time for relative time used by GNUnet, in microseconds.