2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (C) 2004 Nik Clayton
8 /* '## __VA_ARGS__' is a gcc'ism. C99 doesn't allow the token pasting
9 and requires the caller to add the final comma if they've ommitted
10 the optional arguments */
12 # define ok(e, test, ...) ((e) ? \
13 _gen_result(1, __func__, __FILE__, __LINE__, \
14 test, ## __VA_ARGS__) : \
15 _gen_result(0, __func__, __FILE__, __LINE__, \
16 test, ## __VA_ARGS__))
18 # define ok1(e) ((e) ? \
19 _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \
20 _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e))
22 # define pass(test, ...) ok(1, test, ## __VA_ARGS__);
23 # define fail(test, ...) ok(0, test, ## __VA_ARGS__);
25 # define skip_start(test, n, fmt, ...) \
28 skip(n, fmt, ## __VA_ARGS__); \
31 #elif __STDC_VERSION__ >= 199901L /* __GNUC__ */
32 # define ok(e, ...) ((e) ? \
33 _gen_result(1, __func__, __FILE__, __LINE__, \
35 _gen_result(0, __func__, __FILE__, __LINE__, \
38 # define ok1(e) ((e) ? \
39 _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \
40 _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e))
42 # define pass(...) ok(1, __VA_ARGS__);
43 # define fail(...) ok(0, __VA_ARGS__);
45 # define skip_start(test, n, ...) \
48 skip(n, __VA_ARGS__); \
51 #else /* __STDC_VERSION__ */
52 # error "Needs gcc or C99 compiler for variadic macros."
53 #endif /* __STDC_VERSION__ */
55 #define skip_end() } while(0);
57 unsigned int _gen_result(int, const char *, char *, unsigned int, char *, ...);
59 int plan_no_plan(void);
60 int plan_skip_all(char *);
61 int plan_tests(unsigned int);
63 unsigned int diag(char *, ...);
65 int skip(unsigned int, char *, ...);
67 void todo_start(char *, ...);
70 int exit_status(void);
This page took 0.032463 seconds and 4 git commands to generate.