]>
Commit | Line | Data |
---|---|---|
0959b6d4 A |
1 | #include <stdarg.h> |
2 | #include <stdio.h> | |
3 | ||
4 | #define DEFINE_TEST_FUNC(name) \ | |
5 | static \ | |
6 | inline \ | |
7 | void \ | |
8 | name(const char *format, ...) \ | |
9 | { \ | |
10 | va_list args; \ | |
11 | va_start(args, format); \ | |
12 | common(stdout, #name, format, args); \ | |
13 | va_end(args); \ | |
14 | return; \ | |
15 | } | |
16 | ||
17 | static | |
18 | inline | |
19 | void | |
20 | common(FILE *file, const char *prefix, const char *format, va_list args) | |
21 | { | |
22 | fprintf(file, "%s \"", prefix); | |
23 | vfprintf(file, format, args); | |
24 | fprintf(file, "\"\n"); // should check for trailing newline | |
25 | return; | |
26 | } | |
27 | ||
28 | DEFINE_TEST_FUNC(PASS); | |
29 | DEFINE_TEST_FUNC(XPASS); | |
30 | DEFINE_TEST_FUNC(FAIL); | |
31 | DEFINE_TEST_FUNC(XFAIL); | |
32 | ||
33 | DEFINE_TEST_FUNC(UNTESTED); | |
34 | DEFINE_TEST_FUNC(UNSUPPORTED); | |
35 | DEFINE_TEST_FUNC(UNRESOLVED); |