00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifdef __GNUC__
00031 # define ok(e, test, ...) ((e) ? \
00032 _gen_result(1, __func__, __FILE__, __LINE__, \
00033 test, ## __VA_ARGS__) : \
00034 _gen_result(0, __func__, __FILE__, __LINE__, \
00035 test, ## __VA_ARGS__))
00036
00037 # define ok1(e) ((e) ? \
00038 _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \
00039 _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e))
00040
00041 # define pass(test, ...) ok(1, test, ## __VA_ARGS__);
00042 # define fail(test, ...) ok(0, test, ## __VA_ARGS__);
00043
00044 # define skip_start(test, n, fmt, ...) \
00045 do { \
00046 if((test)) { \
00047 skip(n, fmt, ## __VA_ARGS__); \
00048 continue; \
00049 }
00050 #elif __STDC_VERSION__ >= 199901L
00051 # define ok(e, ...) ((e) ? \
00052 _gen_result(1, __func__, __FILE__, __LINE__, \
00053 __VA_ARGS__) : \
00054 _gen_result(0, __func__, __FILE__, __LINE__, \
00055 __VA_ARGS__))
00056
00057 # define ok1(e) ((e) ? \
00058 _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \
00059 _gen_result(0, __func__, __FILE__, __LINE__, "%s", #e))
00060
00061 # define pass(...) ok(1, __VA_ARGS__);
00062 # define fail(...) ok(0, __VA_ARGS__);
00063
00064 # define skip_start(test, n, ...) \
00065 do { \
00066 if((test)) { \
00067 skip(n, __VA_ARGS__); \
00068 continue; \
00069 }
00070 #else
00071 # error "Needs gcc or C99 compiler for variadic macros."
00072 #endif
00073
00074 # define skip_end } while(0);
00075
00076 unsigned int _gen_result(int, const char *, char *, unsigned int, char *, ...);
00077
00078 int plan_no_plan(void);
00079 int plan_skip_all(char *);
00080 int plan_tests(unsigned int);
00081
00082 unsigned int diag(char *, ...);
00083
00084 int skip(unsigned int, char *, ...);
00085
00086 void todo_start(char *, ...);
00087 void todo_end(void);
00088
00089 int exit_status(void);