Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
munit.h
Go to the documentation of this file.
1/* µnit Testing Framework
2 * Copyright (c) 2013-2017 Evan Nemerson <evan@nemerson.com>
3 *
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without
7 * restriction, including without limitation the rights to use, copy,
8 * modify, merge, publish, distribute, sublicense, and/or sell copies
9 * of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 */
24// clang-format off
25
26#if !defined(MUNIT_H)
27#define MUNIT_H
28
29#include <stdarg.h>
30#include <stdlib.h>
31
32#define MUNIT_VERSION(major, minor, revision) \
33 (((major) << 16) | ((minor) << 8) | (revision))
34
35#define MUNIT_CURRENT_VERSION MUNIT_VERSION(0, 4, 1)
36
37#if defined(_MSC_VER) && (_MSC_VER < 1600)
38# define munit_int8_t __int8
39# define munit_uint8_t unsigned __int8
40# define munit_int16_t __int16
41# define munit_uint16_t unsigned __int16
42# define munit_int32_t __int32
43# define munit_uint32_t unsigned __int32
44# define munit_int64_t __int64
45# define munit_uint64_t unsigned __int64
46#else
47
48# include <stdint.h>
49
50# define munit_int8_t int8_t
51# define munit_uint8_t uint8_t
52# define munit_int16_t int16_t
53# define munit_uint16_t uint16_t
54# define munit_int32_t int32_t
55# define munit_uint32_t uint32_t
56# define munit_int64_t int64_t
57# define munit_uint64_t uint64_t
58#endif
59
60#if defined(_MSC_VER) && (_MSC_VER < 1800)
61# if !defined(PRIi8)
62# define PRIi8 "i"
63# endif
64# if !defined(PRIi16)
65# define PRIi16 "i"
66# endif
67# if !defined(PRIi32)
68# define PRIi32 "i"
69# endif
70# if !defined(PRIi64)
71# define PRIi64 "I64i"
72# endif
73# if !defined(PRId8)
74# define PRId8 "d"
75# endif
76# if !defined(PRId16)
77# define PRId16 "d"
78# endif
79# if !defined(PRId32)
80# define PRId32 "d"
81# endif
82# if !defined(PRId64)
83# define PRId64 "I64d"
84# endif
85# if !defined(PRIx8)
86# define PRIx8 "x"
87# endif
88# if !defined(PRIx16)
89# define PRIx16 "x"
90# endif
91# if !defined(PRIx32)
92# define PRIx32 "x"
93# endif
94# if !defined(PRIx64)
95# define PRIx64 "I64x"
96# endif
97# if !defined(PRIu8)
98# define PRIu8 "u"
99# endif
100# if !defined(PRIu16)
101# define PRIu16 "u"
102# endif
103# if !defined(PRIu32)
104# define PRIu32 "u"
105# endif
106# if !defined(PRIu64)
107# define PRIu64 "I64u"
108# endif
109#else
110
111# include <inttypes.h>
112
113#endif
114
115#if !defined(munit_bool)
116# if defined(bool)
117# define munit_bool bool
118# elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
119# define munit_bool _Bool
120# else
121# define munit_bool int
122# endif
123#endif
124
125#if defined(__cplusplus)
126extern "C" {
127#endif
128
129#if defined(__GNUC__)
130# define MUNIT_LIKELY(expr) (__builtin_expect ((expr), 1))
131# define MUNIT_UNLIKELY(expr) (__builtin_expect ((expr), 0))
132# define MUNIT_UNUSED __attribute__((__unused__))
133#else
134# define MUNIT_LIKELY(expr) (expr)
135# define MUNIT_UNLIKELY(expr) (expr)
136# define MUNIT_UNUSED
137#endif
138
139#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__PGI)
140# define MUNIT_ARRAY_PARAM(name) name
141#else
142# define MUNIT_ARRAY_PARAM(name)
143#endif
144
145#if !defined(_WIN32)
146# define MUNIT_SIZE_MODIFIER "z"
147# define MUNIT_CHAR_MODIFIER "hh"
148# define MUNIT_SHORT_MODIFIER "h"
149#else
150# if defined(_M_X64) || defined(__amd64__)
151# define MUNIT_SIZE_MODIFIER "I64"
152# else
153# define MUNIT_SIZE_MODIFIER ""
154# endif
155# define MUNIT_CHAR_MODIFIER ""
156# define MUNIT_SHORT_MODIFIER ""
157#endif
158
159#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
160# define MUNIT_NO_RETURN _Noreturn
161#elif defined(__GNUC__)
162# define MUNIT_NO_RETURN __attribute__((__noreturn__))
163#elif defined(_MSC_VER)
164# define MUNIT_NO_RETURN __declspec(noreturn)
165#else
166# define MUNIT_NO_RETURN
167#endif
168
169#if defined(_MSC_VER) && (_MSC_VER >= 1500)
170# define MUNIT_PUSH_DISABLE_MSVC_C4127_ __pragma(warning(push)) __pragma(warning(disable:4127))
171# define MUNIT_POP_DISABLE_MSVC_C4127_ __pragma(warning(pop))
172#else
173# define MUNIT_PUSH_DISABLE_MSVC_C4127_
174# define MUNIT_POP_DISABLE_MSVC_C4127_
175#endif
176
183
184#if defined(__GNUC__) && !defined(__MINGW32__)
185# define MUNIT_PRINTF(string_index, first_to_check) __attribute__((format (printf, string_index, first_to_check)))
186#else
187# define MUNIT_PRINTF(string_index, first_to_check)
188#endif
189
190MUNIT_PRINTF(4, 5)
191void munit_logf_ex(MunitLogLevel level, const char *filename, int line, const char *format, ...);
192
193#define munit_logf(level, format, ...) \
194 munit_logf_ex(level, __FILE__, __LINE__, format, __VA_ARGS__)
195
196#define munit_log(level, msg) \
197 munit_logf(level, "%s", msg)
198
200MUNIT_PRINTF(3, 4)
201void munit_errorf_ex(const char *filename, int line, const char *format, ...);
202
203#define munit_errorf(format, ...) \
204 munit_errorf_ex(__FILE__, __LINE__, format, __VA_ARGS__)
205
206#define munit_error(msg) \
207 munit_errorf("%s", msg)
208
209#define munit_assert(expr) \
210 do { \
211 if (!MUNIT_LIKELY(expr)) { \
212 munit_error("assertion failed: " #expr); \
213 } \
214 MUNIT_PUSH_DISABLE_MSVC_C4127_ \
215 } while (0) \
216 MUNIT_POP_DISABLE_MSVC_C4127_
217
218#define munit_assert_true(expr) \
219 do { \
220 if (!MUNIT_LIKELY(expr)) { \
221 munit_error("assertion failed: " #expr " is not true"); \
222 } \
223 MUNIT_PUSH_DISABLE_MSVC_C4127_ \
224 } while (0) \
225 MUNIT_POP_DISABLE_MSVC_C4127_
226
227#define munit_assert_false(expr) \
228 do { \
229 if (!MUNIT_LIKELY(!(expr))) { \
230 munit_error("assertion failed: " #expr " is not false"); \
231 } \
232 MUNIT_PUSH_DISABLE_MSVC_C4127_ \
233 } while (0) \
234 MUNIT_POP_DISABLE_MSVC_C4127_
235
236#define munit_assert_type_full(prefix, suffix, T, fmt, a, op, b) \
237 do { \
238 T munit_tmp_a_ = (a); \
239 T munit_tmp_b_ = (b); \
240 if (!(munit_tmp_a_ op munit_tmp_b_)) { \
241 munit_errorf("assertion failed: %s %s %s (" prefix "%" fmt suffix " %s " prefix "%" fmt suffix ")", \
242 #a, #op, #b, munit_tmp_a_, #op, munit_tmp_b_); \
243 } \
244 MUNIT_PUSH_DISABLE_MSVC_C4127_ \
245 } while (0) \
246 MUNIT_POP_DISABLE_MSVC_C4127_
247
248#define munit_assert_type(T, fmt, a, op, b) \
249 munit_assert_type_full("", "", T, fmt, a, op, b)
250
251#define munit_assert_char(a, op, b) \
252 munit_assert_type_full("'\\x", "'", char, "02" MUNIT_CHAR_MODIFIER "x", a, op, b)
253#define munit_assert_uchar(a, op, b) \
254 munit_assert_type_full("'\\x", "'", unsigned char, "02" MUNIT_CHAR_MODIFIER "x", a, op, b)
255#define munit_assert_short(a, op, b) \
256 munit_assert_type(short, MUNIT_SHORT_MODIFIER "d", a, op, b)
257#define munit_assert_ushort(a, op, b) \
258 munit_assert_type(unsigned short, MUNIT_SHORT_MODIFIER "u", a, op, b)
259#define munit_assert_int(a, op, b) \
260 munit_assert_type(int, "d", a, op, b)
261#define munit_assert_uint(a, op, b) \
262 munit_assert_type(unsigned int, "u", a, op, b)
263#define munit_assert_long(a, op, b) \
264 munit_assert_type(long int, "ld", a, op, b)
265#define munit_assert_ulong(a, op, b) \
266 munit_assert_type(unsigned long int, "lu", a, op, b)
267#define munit_assert_llong(a, op, b) \
268 munit_assert_type(long long int, "lld", a, op, b)
269#define munit_assert_ullong(a, op, b) \
270 munit_assert_type(unsigned long long int, "llu", a, op, b)
271
272#define munit_assert_size(a, op, b) \
273 munit_assert_type(size_t, MUNIT_SIZE_MODIFIER "u", a, op, b)
274
275#define munit_assert_float(a, op, b) \
276 munit_assert_type(float, "f", a, op, b)
277#define munit_assert_double(a, op, b) \
278 munit_assert_type(double, "g", a, op, b)
279#define munit_assert_ptr(a, op, b) \
280 munit_assert_type(const void*, "p", a, op, b)
281
282#define munit_assert_int8(a, op, b) \
283 munit_assert_type(munit_int8_t, PRIi8, a, op, b)
284#define munit_assert_uint8(a, op, b) \
285 munit_assert_type(munit_uint8_t, PRIu8, a, op, b)
286#define munit_assert_int16(a, op, b) \
287 munit_assert_type(munit_int16_t, PRIi16, a, op, b)
288#define munit_assert_uint16(a, op, b) \
289 munit_assert_type(munit_uint16_t, PRIu16, a, op, b)
290#define munit_assert_int32(a, op, b) \
291 munit_assert_type(munit_int32_t, PRIi32, a, op, b)
292#define munit_assert_uint32(a, op, b) \
293 munit_assert_type(munit_uint32_t, PRIu32, a, op, b)
294#define munit_assert_int64(a, op, b) \
295 munit_assert_type(munit_int64_t, PRIi64, a, op, b)
296#define munit_assert_uint64(a, op, b) \
297 munit_assert_type(munit_uint64_t, PRIu64, a, op, b)
298
299#define munit_assert_double_equal(a, b, precision) \
300 do { \
301 const double munit_tmp_a_ = (a); \
302 const double munit_tmp_b_ = (b); \
303 const double munit_tmp_diff_ = ((munit_tmp_a_ - munit_tmp_b_) < 0) ? \
304 -(munit_tmp_a_ - munit_tmp_b_) : \
305 (munit_tmp_a_ - munit_tmp_b_); \
306 if (MUNIT_UNLIKELY(munit_tmp_diff_ > 1e-##precision)) { \
307 munit_errorf("assertion failed: %s == %s (%0." #precision "g == %0." #precision "g)", \
308 #a, #b, munit_tmp_a_, munit_tmp_b_); \
309 } \
310 MUNIT_PUSH_DISABLE_MSVC_C4127_ \
311 } while (0) \
312 MUNIT_POP_DISABLE_MSVC_C4127_
313
314#include <string.h>
315
316#define munit_assert_string_equal(a, b) \
317 do { \
318 const char* munit_tmp_a_ = a; \
319 const char* munit_tmp_b_ = b; \
320 if (MUNIT_UNLIKELY(strcmp(munit_tmp_a_, munit_tmp_b_) != 0)) { \
321 munit_errorf("assertion failed: string %s == %s (\"%s\" == \"%s\")", \
322 #a, #b, munit_tmp_a_, munit_tmp_b_); \
323 } \
324 MUNIT_PUSH_DISABLE_MSVC_C4127_ \
325 } while (0) \
326 MUNIT_POP_DISABLE_MSVC_C4127_
327
328#define munit_assert_string_not_equal(a, b) \
329 do { \
330 const char* munit_tmp_a_ = a; \
331 const char* munit_tmp_b_ = b; \
332 if (MUNIT_UNLIKELY(strcmp(munit_tmp_a_, munit_tmp_b_) == 0)) { \
333 munit_errorf("assertion failed: string %s != %s (\"%s\" == \"%s\")", \
334 #a, #b, munit_tmp_a_, munit_tmp_b_); \
335 } \
336 MUNIT_PUSH_DISABLE_MSVC_C4127_ \
337 } while (0) \
338 MUNIT_POP_DISABLE_MSVC_C4127_
339
340#define munit_assert_memory_equal(size, a, b) \
341 do { \
342 const unsigned char* munit_tmp_a_ = (const unsigned char*) (a); \
343 const unsigned char* munit_tmp_b_ = (const unsigned char*) (b); \
344 const size_t munit_tmp_size_ = (size); \
345 if (MUNIT_UNLIKELY(memcmp(munit_tmp_a_, munit_tmp_b_, munit_tmp_size_)) != 0) { \
346 size_t munit_tmp_pos_; \
347 for (munit_tmp_pos_ = 0 ; munit_tmp_pos_ < munit_tmp_size_ ; munit_tmp_pos_++) { \
348 if (munit_tmp_a_[munit_tmp_pos_] != munit_tmp_b_[munit_tmp_pos_]) { \
349 munit_errorf("assertion failed: memory %s == %s, at offset %" MUNIT_SIZE_MODIFIER "u", \
350 #a, #b, munit_tmp_pos_); \
351 break; \
352 } \
353 } \
354 } \
355 MUNIT_PUSH_DISABLE_MSVC_C4127_ \
356 } while (0) \
357 MUNIT_POP_DISABLE_MSVC_C4127_
358
359#define munit_assert_memory_not_equal(size, a, b) \
360 do { \
361 const unsigned char* munit_tmp_a_ = (const unsigned char*) (a); \
362 const unsigned char* munit_tmp_b_ = (const unsigned char*) (b); \
363 const size_t munit_tmp_size_ = (size); \
364 if (MUNIT_UNLIKELY(memcmp(munit_tmp_a_, munit_tmp_b_, munit_tmp_size_)) == 0) { \
365 munit_errorf("assertion failed: memory %s != %s (%zu bytes)", \
366 #a, #b, munit_tmp_size_); \
367 } \
368 MUNIT_PUSH_DISABLE_MSVC_C4127_ \
369 } while (0) \
370 MUNIT_POP_DISABLE_MSVC_C4127_
371
372#define munit_assert_ptr_equal(a, b) \
373 munit_assert_ptr(a, ==, b)
374#define munit_assert_ptr_not_equal(a, b) \
375 munit_assert_ptr(a, !=, b)
376#define munit_assert_null(ptr) \
377 munit_assert_ptr(ptr, ==, NULL)
378#define munit_assert_not_null(ptr) \
379 munit_assert_ptr(ptr, !=, NULL)
380#define munit_assert_ptr_null(ptr) \
381 munit_assert_ptr(ptr, ==, NULL)
382#define munit_assert_ptr_not_null(ptr) \
383 munit_assert_ptr(ptr, !=, NULL)
384
385/*** Memory allocation ***/
386
387void *munit_malloc_ex(const char *filename, int line, size_t size);
388
389#define munit_malloc(size) \
390 munit_malloc_ex(__FILE__, __LINE__, (size))
391
392#define munit_new(type) \
393 ((type*) munit_malloc(sizeof(type)))
394
395#define munit_calloc(nmemb, size) \
396 munit_malloc((nmemb) * (size))
397
398#define munit_newa(type, nmemb) \
399 ((type*) munit_calloc((nmemb), sizeof(type)))
400
401/*** Random number generation ***/
402
404
406
407int munit_rand_int_range(int min, int max);
408
409double munit_rand_double(void);
410
411void munit_rand_memory(size_t size, munit_uint8_t buffer[MUNIT_ARRAY_PARAM(size)]);
412
413/*** Tests and Suites ***/
414
415typedef enum {
416 /* Test successful */
418 /* Test failed */
420 /* Test was skipped */
422 /* Test failed due to circumstances not intended to be tested
423 * (things like network errors, invalid parameter value, failure to
424 * allocate memory in the test harness, etc.). */
427
428typedef struct {
429 char *name;
430 char **values;
432
433typedef struct {
434 char *name;
435 char *value;
437
438const char *munit_parameters_get(const MunitParameter params[], const char *key);
439
445
446typedef MunitResult (*MunitTestFunc)(const MunitParameter params[], void *user_data_or_fixture);
447
448typedef void *(*MunitTestSetup)(const MunitParameter params[], void *user_data);
449
450typedef void (*MunitTestTearDown)(void *fixture);
451
460
464
465typedef struct MunitSuite_ MunitSuite;
466
474
475int munit_suite_main(const MunitSuite *suite, void *user_data, int argc, char *const argv[MUNIT_ARRAY_PARAM(argc + 1)]);
476
477/* Note: I'm not very happy with this API; it's likely to change if I
478 * figure out something better. Suggestions welcome. */
479
481
483 char *name;
484
485 munit_bool (*parse_argument)(const MunitSuite *suite, void *user_data, int *arg, int argc,
486 char *const argv[MUNIT_ARRAY_PARAM(argc + 1)]);
487
488 void (*write_help)(const MunitArgument *argument, void *user_data);
489};
490
491int munit_suite_main_custom(const MunitSuite *suite,
492 void *user_data,
493 int argc, char *const argv[MUNIT_ARRAY_PARAM(argc + 1)],
494 const MunitArgument arguments[]);
495
496#if defined(MUNIT_ENABLE_ASSERT_ALIASES)
497
498#define assert_true(expr) munit_assert_true(expr)
499#define assert_false(expr) munit_assert_false(expr)
500#define assert_char(a, op, b) munit_assert_char(a, op, b)
501#define assert_uchar(a, op, b) munit_assert_uchar(a, op, b)
502#define assert_short(a, op, b) munit_assert_short(a, op, b)
503#define assert_ushort(a, op, b) munit_assert_ushort(a, op, b)
504#define assert_int(a, op, b) munit_assert_int(a, op, b)
505#define assert_uint(a, op, b) munit_assert_uint(a, op, b)
506#define assert_long(a, op, b) munit_assert_long(a, op, b)
507#define assert_ulong(a, op, b) munit_assert_ulong(a, op, b)
508#define assert_llong(a, op, b) munit_assert_llong(a, op, b)
509#define assert_ullong(a, op, b) munit_assert_ullong(a, op, b)
510#define assert_size(a, op, b) munit_assert_size(a, op, b)
511#define assert_float(a, op, b) munit_assert_float(a, op, b)
512#define assert_double(a, op, b) munit_assert_double(a, op, b)
513#define assert_ptr(a, op, b) munit_assert_ptr(a, op, b)
514
515#define assert_int8(a, op, b) munit_assert_int8(a, op, b)
516#define assert_uint8(a, op, b) munit_assert_uint8(a, op, b)
517#define assert_int16(a, op, b) munit_assert_int16(a, op, b)
518#define assert_uint16(a, op, b) munit_assert_uint16(a, op, b)
519#define assert_int32(a, op, b) munit_assert_int32(a, op, b)
520#define assert_uint32(a, op, b) munit_assert_uint32(a, op, b)
521#define assert_int64(a, op, b) munit_assert_int64(a, op, b)
522#define assert_uint64(a, op, b) munit_assert_uint64(a, op, b)
523
524#define assert_double_equal(a, b, precision) munit_assert_double_equal(a, b, precision)
525#define assert_string_equal(a, b) munit_assert_string_equal(a, b)
526#define assert_string_not_equal(a, b) munit_assert_string_not_equal(a, b)
527#define assert_memory_equal(size, a, b) munit_assert_memory_equal(size, a, b)
528#define assert_memory_not_equal(size, a, b) munit_assert_memory_not_equal(size, a, b)
529#define assert_ptr_equal(a, b) munit_assert_ptr_equal(a, b)
530#define assert_ptr_not_equal(a, b) munit_assert_ptr_not_equal(a, b)
531#define assert_ptr_null(ptr) munit_assert_null_equal(ptr)
532#define assert_ptr_not_null(ptr) munit_assert_not_null(ptr)
533
534#define assert_null(ptr) munit_assert_null(ptr)
535#define assert_not_null(ptr) munit_assert_not_null(ptr)
536
537#endif /* defined(MUNIT_ENABLE_ASSERT_ALIASES) */
538
539#if defined(__cplusplus)
540}
541#endif
542
543#endif /* !defined(MUNIT_H) */
544
545#if defined(MUNIT_ENABLE_ASSERT_ALIASES)
546# if defined(assert)
547# undef assert
548# endif
549# define assert(expr) munit_assert(expr)
550#endif
void munit_errorf_ex(const char *filename, int line, const char *format,...)
Definition munit.c:238
void munit_logf_ex(MunitLogLevel level, const char *filename, int line, const char *format,...)
Definition munit.c:221
void(* MunitTestTearDown)(void *fixture)
Definition munit.h:450
int munit_rand_int_range(int min, int max)
Definition munit.c:1015
struct MunitSuite_ MunitSuite
Definition munit.h:465
#define munit_bool
Definition munit.h:121
#define MUNIT_ARRAY_PARAM(name)
Definition munit.h:142
#define munit_uint8_t
Definition munit.h:51
MunitResult(* MunitTestFunc)(const MunitParameter params[], void *user_data_or_fixture)
Definition munit.h:446
MunitResult
Definition munit.h:415
@ MUNIT_SKIP
Definition munit.h:421
@ MUNIT_FAIL
Definition munit.h:419
@ MUNIT_OK
Definition munit.h:417
@ MUNIT_ERROR
Definition munit.h:425
int munit_suite_main_custom(const MunitSuite *suite, void *user_data, int argc, char *const argv[MUNIT_ARRAY_PARAM(argc+1)], const MunitArgument arguments[])
Definition munit.c:1867
void munit_rand_seed(munit_uint32_t seed)
Definition munit.c:913
MunitTestOptions
Definition munit.h:440
@ MUNIT_TEST_OPTION_TODO
Definition munit.h:443
@ MUNIT_TEST_OPTION_SINGLE_ITERATION
Definition munit.h:442
@ MUNIT_TEST_OPTION_NONE
Definition munit.h:441
#define MUNIT_NO_RETURN
Definition munit.h:166
void munit_rand_memory(size_t size, munit_uint8_t buffer[MUNIT_ARRAY_PARAM(size)])
Definition munit.c:971
int munit_suite_main(const MunitSuite *suite, void *user_data, int argc, char *const argv[MUNIT_ARRAY_PARAM(argc+1)])
Definition munit.c:2094
#define munit_uint32_t
Definition munit.h:55
struct MunitArgument_ MunitArgument
Definition munit.h:480
munit_uint32_t munit_rand_uint32(void)
Definition munit.c:942
double munit_rand_double(void)
Definition munit.c:1028
void * munit_malloc_ex(const char *filename, int line, size_t size)
Definition munit.c:281
void *(* MunitTestSetup)(const MunitParameter params[], void *user_data)
Definition munit.h:448
MunitLogLevel
Definition munit.h:177
@ MUNIT_LOG_ERROR
Definition munit.h:181
@ MUNIT_LOG_WARNING
Definition munit.h:180
@ MUNIT_LOG_DEBUG
Definition munit.h:178
@ MUNIT_LOG_INFO
Definition munit.h:179
#define MUNIT_PRINTF(string_index, first_to_check)
Definition munit.h:187
MunitSuiteOptions
Definition munit.h:461
@ MUNIT_SUITE_OPTION_NONE
Definition munit.h:462
const char * munit_parameters_get(const MunitParameter params[], const char *key)
Definition munit.c:1075
Definition setup.py:1
Definition tests.py:1
munit_bool(* parse_argument)(const MunitSuite *suite, void *user_data, int *arg, int argc, char *const argv[MUNIT_ARRAY_PARAM(argc+1)])
Definition munit.h:485
char * name
Definition munit.h:483
void(* write_help)(const MunitArgument *argument, void *user_data)
Definition munit.h:488
char ** values
Definition munit.h:430
char * value
Definition munit.h:435
char * name
Definition munit.h:434
MunitSuiteOptions options
Definition munit.h:472
unsigned int iterations
Definition munit.h:471
MunitSuite * suites
Definition munit.h:470
char * prefix
Definition munit.h:468
MunitTestFunc test
Definition munit.h:454
MunitTestTearDown tear_down
Definition munit.h:456
MunitTestOptions options
Definition munit.h:457
MunitParameterEnum * parameters
Definition munit.h:458
char * name
Definition munit.h:453