015c9d10ae79b1f10295671807b6e9af0c1a0027
[vlendec/samba-autobuild/.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 tevent_context_init(x) \
34         tevent_context_init_stub(x)
35 #define ctdb_ctrl_getnodemap(ctdb, timelimit, pnn, tmp_ctx, nodemap) \
36         ctdb_ctrl_getnodemap_stub(ctdb, timelimit, pnn, tmp_ctx, nodemap)
37 #define ctdb_ctrl_get_ifaces(ctdb, timelimit, pnn, tmp_ctx, ifaces) \
38         ctdb_ctrl_get_ifaces_stub(ctdb, timelimit, pnn, tmp_ctx, ifaces)
39 #define ctdb_ctrl_getpnn(ctdb, timelimit, pnn) \
40         ctdb_ctrl_getpnn_stub(ctdb, timelimit, pnn)
41 #define ctdb_ctrl_getrecmode(ctdb, tmp_ctx, timelimit, pnn, recmode) \
42         ctdb_ctrl_getrecmode_stub(ctdb, tmp_ctx, timelimit, pnn, recmode)
43 #define ctdb_ctrl_getrecmaster(ctdb, tmp_ctx, timelimit, pnn, recmaster) \
44         ctdb_ctrl_getrecmaster_stub(ctdb, tmp_ctx, timelimit, pnn, recmaster)
45 #define ctdb_ctrl_getvnnmap(ctdb, timelimit, pnn, tmp_ctx, vnnmap) \
46         ctdb_ctrl_getvnnmap_stub(ctdb, timelimit, pnn, tmp_ctx, vnnmap)
47 #define ctdb_ctrl_getdebseqnum(ctdb, timelimit, pnn, db_id, seqnum) \
48         ctdb_ctrl_getvnnmap_stub(ctdb, timelimit, pnn, db_id, seqnum)
49 #define ctdb_client_check_message_handlers(ctdb, ids, argc, result) \
50         ctdb_client_check_message_handlers_stub(ctdb, ids, argc, result)
51 #define ctdb_ctrl_getcapabilities(ctdb, timeout, destnode, capabilities) \
52         ctdb_ctrl_getcapabilities_stub(ctdb, timeout, destnode, capabilities)
53 #define ctdb_sys_have_ip(addr) \
54         ctdb_sys_have_ip_stub(addr)
55
56 #include "tools/ctdb.c"
57
58 #ifndef CTDB_TEST_USE_MAIN
59 #undef main
60 #undef usage
61 #endif /* CTDB_TEST_USE_MAIN */
62
63 #undef ctdb_cmdline_client
64 #undef tevent_context_init
65 /* This is called in client/ctdb_client.c so needs a declaration... */
66 struct tevent_context *tevent_context_init(TALLOC_CTX *mem_ctx);
67
68 #include "common/cmdline.c"
69
70 #undef ctdb_ctrl_getnodemap
71 #undef ctdb_ctrl_get_ifaces 
72 #undef ctdb_ctrl_getpnn
73 #undef ctdb_ctrl_getrecmode
74 #undef ctdb_ctrl_getrecmaster
75 #undef ctdb_ctrl_getvnnmap
76 #undef ctdb_ctrl_getdebseqnum
77 #undef ctdb_client_check_message_handlers
78 #undef ctdb_ctrl_getcapabilities
79 #undef ctdb_sys_have_ip
80
81 #undef TIMELIMIT
82 #include "tools/ctdb_vacuum.c"
83
84 /* UTIL_OBJ */
85 #include "lib/util/idtree.c"
86 #include "lib/util/db_wrap.c"
87 #include "lib/util/strlist.c"
88 #include "lib/util/util.c"
89 #include "lib/util/util_time.c"
90 #include "lib/util/util_file.c"
91 #include "lib/util/fault.c"
92 #include "lib/util/substitute.c"
93 #include "lib/util/signal.c"
94
95 /* CTDB_COMMON_OBJ */
96 #include "common/ctdb_io.c"
97 #include "common/ctdb_util.c"
98 #include "common/ctdb_ltdb.c"
99 #include "common/ctdb_message.c"
100 #include "lib/util/debug.c"
101 #include "common/rb_tree.c"
102 #include "common/system_common.c"
103 #include "common/ctdb_logging.c"
104 #include "common/ctdb_fork.c"
105 #include "common/system_util.c"
106
107 /* CTDB_CLIENT_OBJ */
108 #include "client/ctdb_client.c"
109
110 /* TEST STUBS */
111 #include "ctdb_test_stubs.c"
112
113 #endif /* _CTDBD_TEST_C */