9 #define va_copy(d,s) ((d) = (s))
17 #define ok(...) ok_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
20 #define pass(...) ok_at_loc(__FILE__, __LINE__, 1, __VA_ARGS__, NULL)
21 #define fail(...) ok_at_loc(__FILE__, __LINE__, 0, __VA_ARGS__, NULL)
23 #define pass(...) ok(1, ## __VA_ARGS__)
24 #define fail(...) ok(0, ## __VA_ARGS__)
27 #define is(...) is_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
28 #define isnt(...) isnt_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
29 #define cmp_ok(...) cmp_ok_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
31 int vok_at_loc (const char *file, int line, int test, const char *fmt,
33 void plan (int tests);
34 int ok_at_loc (const char *file, int line, int test, const char *fmt,
36 int diag (const char *fmt, ...);
37 int note (const char *fmt, ...);
38 int exit_status (void);
39 void skippy (int n, const char *fmt, ...);
40 void ctodo (int ignore, const char *fmt, ...);
42 int is_at_loc (const char *file, int line, const char *got,
43 const char *expected, const char *fmt, ...);
44 int isnt_at_loc (const char *file, int line, const char *got,
45 const char *expected, const char *fmt, ...);
46 int cmp_ok_at_loc (const char *file, int line, int a, const char *op,
47 int b, const char *fmt, ...);
50 #define like(...) skippy(1, "like is not implemented on MSWin32")
51 #define unlike(...) like()
53 #define like(...) like_at_loc(1, __FILE__, __LINE__, __VA_ARGS__, NULL)
54 #define unlike(...) like_at_loc(0, __FILE__, __LINE__, __VA_ARGS__, NULL)
55 int like_at_loc (int for_match, const char *file, int line,
56 const char *got, const char *expected,
57 const char *fmt, ...);
60 #define skip(test, ...) do {if (test) {skippy(__VA_ARGS__, NULL); break;}
61 #define endskip } while (0)
63 #define todo(...) ctodo(0, ## __VA_ARGS__, NULL)
64 #define endtodo cendtodo()
66 #define dies_ok(code, ...) dies_ok_common(code, 1, ## __VA_ARGS__)
67 #define lives_ok(code, ...) dies_ok_common(code, 0, ## __VA_ARGS__)
70 #define dies_ok_common(...) \
71 skippy(1, "Death detection is not supported on MSWin32")
74 #include <sys/types.h>
76 int tap_test_died (int status);
77 #define dies_ok_common(code, for_death, ...) \
83 perror("fork error"); \
91 if (waitpid(cpid, NULL, 0) < 0) { \
92 perror("waitpid error"); \
95 int it_died = tap_test_died(0); \
96 if (!it_died) {code} \
97 ok(for_death ? it_died : !it_died, ## __VA_ARGS__); \