Merge branch 'master' of ctdb into 'master' of samba
[samba.git] / ctdb / tests / src / ctdb_test.c
1 /*
2    ctdb test include file
3
4    Copyright (C) Martin Schwenke  2011
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef _CTDBD_TEST_C
21 #define _CTDBD_TEST_C
22
23 #ifdef CTDB_TEST_OVERRIDE_MAIN
24
25 /* Define our own main() and usage() functions */
26 #define main(argc, argv) main_foobar(argc, argv)
27 #define usage usage_foobar
28
29 #endif /* CTDB_TEST_USE_MAIN */
30
31 #define ctdb_cmdline_client(x, y) \
32         ctdb_cmdline_client_stub(x, y)
33 #define ctdb_ctrl_getnodemap(ctdb, timelimit, pnn, tmp_ctx, nodemap) \
34         ctdb_ctrl_getnodemap_stub(ctdb, timelimit, pnn, tmp_ctx, nodemap)
35 #define ctdb_ctrl_get_ifaces(ctdb, timelimit, pnn, tmp_ctx, ifaces) \
36         ctdb_ctrl_get_ifaces_stub(ctdb, timelimit, pnn, tmp_ctx, ifaces)
37 #define ctdb_ctrl_getpnn(ctdb, timelimit, pnn) \
38         ctdb_ctrl_getpnn_stub(ctdb, timelimit, pnn)
39 #define ctdb_ctrl_getrecmode(ctdb, tmp_ctx, timelimit, pnn, recmode) \
40         ctdb_ctrl_getrecmode_stub(ctdb, tmp_ctx, timelimit, pnn, recmode)
41 #define ctdb_ctrl_getrecmaster(ctdb, tmp_ctx, timelimit, pnn, recmaster) \
42         ctdb_ctrl_getrecmaster_stub(ctdb, tmp_ctx, timelimit, pnn, recmaster)
43 #define ctdb_ctrl_getvnnmap(ctdb, timelimit, pnn, tmp_ctx, vnnmap) \
44         ctdb_ctrl_getvnnmap_stub(ctdb, timelimit, pnn, tmp_ctx, vnnmap)
45 #define ctdb_ctrl_getdebseqnum(ctdb, timelimit, pnn, db_id, seqnum) \
46         ctdb_ctrl_getvnnmap_stub(ctdb, timelimit, pnn, db_id, seqnum)
47 #define ctdb_client_check_message_handlers(ctdb, ids, argc, result) \
48         ctdb_client_check_message_handlers_stub(ctdb, ids, argc, result)
49 #define ctdb_ctrl_getcapabilities(ctdb, timeout, destnode, capabilities) \
50         ctdb_ctrl_getcapabilities_stub(ctdb, timeout, destnode, capabilities)
51
52 #include "tools/ctdb.c"
53
54 #ifndef CTDB_TEST_USE_MAIN
55 #undef main
56 #undef usage
57 #endif /* CTDB_TEST_USE_MAIN */
58
59 #undef ctdb_cmdline_client
60
61 #include "common/cmdline.c"
62
63 #undef ctdb_ctrl_getnodemap
64 #undef ctdb_ctrl_get_ifaces 
65 #undef ctdb_ctrl_getpnn
66 #undef ctdb_ctrl_getrecmode
67 #undef ctdb_ctrl_getrecmaster
68 #undef ctdb_ctrl_getvnnmap
69 #undef ctdb_ctrl_getdebseqnum
70 #undef ctdb_client_check_message_handlers
71 #undef ctdb_ctrl_getcapabilities
72
73 #undef TIMELIMIT
74 #include "tools/ctdb_vacuum.c"
75
76 /* UTIL_OBJ */
77 #include "lib/util/idtree.c"
78 #include "lib/util/db_wrap.c"
79 #include "lib/util/strlist.c"
80 #include "lib/util/util.c"
81 #include "lib/util/util_time.c"
82 #include "lib/util/util_file.c"
83 #include "lib/util/fault.c"
84 #include "lib/util/substitute.c"
85 #include "lib/util/signal.c"
86
87 /* CTDB_COMMON_OBJ */
88 #include "common/ctdb_io.c"
89 #include "common/ctdb_util.c"
90 #include "common/ctdb_ltdb.c"
91 #include "common/ctdb_message.c"
92 #include "lib/util/debug.c"
93 #include "common/rb_tree.c"
94 #include "common/system_common.c"
95 #include "common/ctdb_logging.c"
96 #include "common/ctdb_fork.c"
97
98 /* CTDB_CLIENT_OBJ */
99 #include "client/ctdb_client.c"
100
101 /* TEST STUBS */
102 #include "ctdb_test_stubs.c"
103
104 #endif /* _CTDBD_TEST_C */