5 #define va_copy(d,s) ((d) = (s))
13 #define ok(...) ok_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
16 #define pass(...) ok_at_loc(__FILE__, __LINE__, 1, __VA_ARGS__, NULL)
17 #define fail(...) ok_at_loc(__FILE__, __LINE__, 0, __VA_ARGS__, NULL)
19 #define pass(...) ok(1, ## __VA_ARGS__)
20 #define fail(...) ok(0, ## __VA_ARGS__)
23 #define is(...) is_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
24 #define isnt(...) isnt_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
25 #define cmp_ok(...) cmp_ok_at_loc(__FILE__, __LINE__, __VA_ARGS__, NULL)
30 int vok_at_loc (const char *file, int line, int test, const char *fmt,
32 void plan (int tests);
33 int ok_at_loc (const char *file, int line, int test, const char *fmt,
35 int diag (const char *fmt, ...);
36 int note (const char *fmt, ...);
37 int exit_status (void);
38 void skippy (int n, const char *fmt, ...);
39 void ctodo (int ignore, const char *fmt, ...);
41 int is_at_loc (const char *file, int line, const char *got,
42 const char *expected, const char *fmt, ...);
43 int isnt_at_loc (const char *file, int line, const char *got,
44 const char *expected, const char *fmt, ...);
45 int cmp_ok_at_loc (const char *file, int line, int a, const char *op,
46 int b, const char *fmt, ...);
53 #define like(...) skippy(1, "like is not implemented on MSWin32")
54 #define unlike(...) like()
56 #define like(...) like_at_loc(1, __FILE__, __LINE__, __VA_ARGS__, NULL)
57 #define unlike(...) like_at_loc(0, __FILE__, __LINE__, __VA_ARGS__, NULL)
61 int like_at_loc (int for_match, const char *file, int line,
62 const char *got, const char *expected,
63 const char *fmt, ...);
66 #define skip(test, ...) do {if (test) {skippy(__VA_ARGS__, NULL); break;}
67 #define endskip } while (0)
69 #define todo(...) ctodo(0, ## __VA_ARGS__, NULL)
70 #define endtodo cendtodo()
72 #define dies_ok(code, ...) dies_ok_common(code, 1, ## __VA_ARGS__)
73 #define lives_ok(code, ...) dies_ok_common(code, 0, ## __VA_ARGS__)
76 #define dies_ok_common(...) \
77 skippy(1, "Death detection is not supported on MSWin32")
80 #include <sys/types.h>
85 int tap_test_died (int status);
86 #define dies_ok_common(code, for_death, ...) \
92 perror("fork error"); \
100 if (waitpid(cpid, NULL, 0) < 0) { \
101 perror("waitpid error"); \
102 exit(EXIT_FAILURE); \
104 int it_died = tap_test_died(0); \
105 if (!it_died) {code} \
106 ok(for_death ? it_died : !it_died, ## __VA_ARGS__); \