The world's most popular open source database
00001 /* Copyright (C) 2006 MySQL AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 00017 Library for providing TAP support for testing C and C++ was written 00018 by Mats Kindahl <mats@mysql.com>. 00019 */ 00020 00021 #ifndef TAP_H 00022 #define TAP_H 00023 00024 #include "my_global.h" 00025 00026 /* 00027 @defgroup MyTAP MySQL support for performing unit tests according to TAP. 00028 00029 */ 00030 00031 #define NO_PLAN (0) 00032 00039 typedef struct TEST_DATA { 00046 int plan; 00047 00049 int last; 00050 00052 int failed; 00053 00055 char todo[128]; 00056 } TEST_DATA; 00057 00058 #ifdef __cplusplus 00059 extern "C" { 00060 #endif 00061 00072 void plan(int count); 00073 00074 00090 void ok(int pass, char const *fmt, ...) 00091 __attribute__((format(printf,2,3))); 00092 00117 void skip(int how_many, char const *reason, ...) 00118 __attribute__((format(printf,2,3))); 00119 00120 00138 #define SKIP_BLOCK_IF(SKIP_IF_TRUE, COUNT, REASON) \ 00139 if (SKIP_IF_TRUE) skip((COUNT),(REASON)); else 00140 00146 void diag(char const *fmt, ...) 00147 __attribute__((format(printf,1,2))); 00148 00164 int exit_status(void); 00165 00166 00174 void skip_all(char const *reason, ...) 00175 __attribute__((noreturn, format(printf, 1, 2))); 00176 00197 void todo_start(char const *message, ...) 00198 __attribute__((format (printf, 1, 2))); 00199 00203 void todo_end(); 00204 00205 #ifdef __cplusplus 00206 } 00207 #endif 00208 00209 #endif /* TAP_H */
1.4.7

