MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NdbTap.hpp
1 /*
2  Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef NDB_TAP_HPP
19 #define NDB_TAP_HPP
20 
21 #include <../../../unittest/mytap/tap.h>
22 #include <../../../unittest/mytap/tap.c>
23 
24 #ifdef VM_TRACE
25 #define OK(b) assert(b);
26 #else
27 #define OK(b) if (!(b)) abort();
28 #endif
29 
30 #define TAPTEST(name) \
31 int name##_test(); \
32 int main(int argc, const char** argv){ \
33  plan(1); \
34  ok(name##_test(), #name); \
35  return exit_status(); \
36 } \
37 int name##_test()
38 
39 /* tap.c needs my_print_stacktrace */
40 #ifdef DONT_DEFINE_VOID
41 // stacktrace.c turns off VOID redefinition if needed
42 #undef DONT_DEFINE_VOID
43 #endif
44 
45 #ifdef HAVE_gcov
46 // __gcov_flush need C linkage
47 extern "C" void __gcov_flush(void);
48 #endif
49 
50 /* stacktrace.c needs min unless MY_MIN is defined */
51 #if !defined MY_MIN && !defined min
52 #define min(a, b) ((a) < (b) ? (a) : (b))
53 #endif
54 
55 #include <../../../mysys/stacktrace.c>
56 
57 
58 #endif