tap.h

Go to the documentation of this file.
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 #define NO_PLAN  (0)
00027 
00036 typedef struct TEST_DATA {
00043   int plan;
00044 
00046   int last;
00047 
00049   int failed;
00050 
00052   char todo[128];
00053 } TEST_DATA;
00054 
00055 #ifdef __cplusplus
00056 extern "C" {
00057 #endif
00058 
00077 void plan(int count);
00078 
00079 
00095 void ok(int pass, char const *fmt, ...)
00096   __attribute__((format(printf,2,3)));
00097 
00125 void skip(int how_many, char const *reason, ...)
00126     __attribute__((format(printf,2,3)));
00127 
00128 
00145 #define SKIP_BLOCK_IF(SKIP_IF_TRUE, COUNT, REASON) \
00146   if (SKIP_IF_TRUE) skip((COUNT),(REASON)); else
00147 
00153 void diag(char const *fmt, ...)
00154   __attribute__((format(printf,1,2)));
00155 
00171 int exit_status(void);
00172 
00173 
00181 void skip_all(char const *reason, ...)
00182   __attribute__((noreturn, format(printf, 1, 2)));
00183 
00204 void todo_start(char const *message, ...)
00205   __attribute__((format (printf, 1, 2)));
00206 
00210 void todo_end();
00211 
00214 #ifdef __cplusplus
00215 }
00216 #endif
00217 
00218 #endif /* TAP_H */

Generated on Fri Oct 20 21:13:28 2006 by  doxygen 1.4.6