9 #define va_copy(d,s) ((d) = (s))
16 int vok_at_loc (const char *file, int line, int test, const char *fmt,
18 int ok_at_loc (const char *file, int line, int test, const char *fmt,
20 int is_at_loc (const char *file, int line, const char *got,
21 const char *expected, const char *fmt, ...);
22 int isnt_at_loc (const char *file, int line, const char *got,
23 const char *expected, const char *fmt, ...);
24 int cmp_ok_at_loc (const char *file, int line, int a, const char *op,
25 int b, const char *fmt, ...);
26 void plan (int tests);
27 int diag (const char *fmt, ...);
28 int note (const char *fmt, ...);
29 int exit_status (void);
30 void skippy (int n, const char *fmt, ...);
31 void ctodo (int ignore, const char *fmt, ...);
35 #define ok(...) ok_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
36 #define is(...) is_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
37 #define isnt(...) isnt_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
38 #define cmp_ok(...) cmp_ok_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
39 #define done_testing return exit_status()
41 #define skip(test, ...) do {if (test) {skippy(__VA_ARGS__, NULL); break;}
42 #define endskip } while (0)
44 #define todo(...) ctodo(0, ## __VA_ARGS__, NULL)
45 #define endtodo cendtodo()
47 #define dies_ok(code, ...) dies_ok_common(code, 1, ## __VA_ARGS__)
48 #define lives_ok(code, ...) dies_ok_common(code, 0, ## __VA_ARGS__)
51 #define pass(...) ok_at_loc(__FILE__, __LINE__, 1, __VA_ARGS__, NULL)
52 #define fail(...) ok_at_loc(__FILE__, __LINE__, 0, __VA_ARGS__, NULL)
53 #define like(...) skippy(1, "like is not implemented on MSWin32")
54 #define unlike(...) like()
55 #define dies_ok_common(...) \
56 skippy(1, "Death detection is not supported on MSWin32")
58 #define pass(...) ok(1, ## __VA_ARGS__)
59 #define fail(...) ok(0, ## __VA_ARGS__)
60 #define like(...) like_at_loc(1, __FILE__, __LINE__, __VA_ARGS__, NULL)
61 #define unlike(...) like_at_loc(0, __FILE__, __LINE__, __VA_ARGS__, NULL)
62 int like_at_loc (int for_match, const char *file, int line,
63 const char *got, const char *expected,
64 const char *fmt, ...);
66 #include <sys/types.h>
68 int tap_test_died (int status);
69 #define dies_ok_common(code, for_death, ...) \
75 perror("fork error"); \
83 if (waitpid(cpid, NULL, 0) < 0) { \
84 perror("waitpid error"); \
87 int it_died = tap_test_died(0); \
88 if (!it_died) {code} \
89 ok(for_death ? it_died : !it_died, ## __VA_ARGS__); \