Update hardening flags.
[m6w6/libmemcached] / libtest / include.am
1 # vim:ft=automake
2 #
3 # included from Top Level Makefile.am
4 # All paths should be given relative to the root
5 #
6
7 LIBTOOL_COMMAND= ${abs_top_builddir}/libtool --mode=execute
8 VALGRIND_EXEC_COMMAND= $(LIBTOOL_COMMAND) valgrind --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE --xml-file=./tmp_chroot/var/tmp/yatl-\%p.xml --xml=yes
9 VALGRIND_COMMAND= TESTS_ENVIRONMENT="valgrind" $(VALGRIND_EXEC_COMMAND)
10 HELGRIND_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=helgrind --read-var-info=yes --error-exitcode=1 --read-var-info=yes
11 DRD_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=drd
12 MASSIF_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=massif
13 GDB_COMMAND= $(LIBTOOL_COMMAND) gdb -f -x libtest/run.gdb
14 PTRCHECK_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-ptrcheck --error-exitcode=1
15
16 export LIBTOOL_COMMAND
17 export VALGRIND_COMMAND
18 export HELGRIND_COMMAND
19 export DRD_COMMAND
20 export GDB_COMMAND
21
22 valgrind:
23 @echo make check TESTS_ENVIRONMENT="\"$(VALGRIND_EXEC_COMMAND)\""
24
25 gdb:
26 @echo make check TESTS_ENVIRONMENT="\"$(GDB_COMMAND)\""
27
28 helgrind:
29 @echo make check TESTS_ENVIRONMENT="\"$(HELGRIND_COMMAND)\""
30
31 drd:
32 @echo make check TESTS_ENVIRONMENT="\"$(DRD_COMMAND)\""
33
34 EXTRA_DIST+= libtest/run.gdb
35 EXTRA_DIST+= libtest/version.h
36
37 CLEANFILES+= tmp_chroot/etc/*
38 CLEANFILES+= tmp_chroot/var/drizzle/*
39 CLEANFILES+= tmp_chroot/var/log/*
40 CLEANFILES+= tmp_chroot/var/run/*
41 CLEANFILES+= tmp_chroot/var/tmp/*
42 CLEANFILES+= tmp_chroot/*.xml
43
44 BUILT_SOURCES+= libtest/version.h
45
46 .PHONY: distclean-libtest-check
47 distclean-libtest-check:
48 -rm -rf tmp_chroot
49
50 noinst_HEADERS+= libtest/formatter.hpp
51 noinst_HEADERS+= libtest/timer.hpp
52 noinst_HEADERS+= libtest/binaries.h
53 noinst_HEADERS+= libtest/cpu.hpp
54 noinst_HEADERS+= libtest/blobslap_worker.h
55 noinst_HEADERS+= libtest/callbacks.h
56 noinst_HEADERS+= libtest/dns.hpp
57 noinst_HEADERS+= libtest/cmdline.h
58 noinst_HEADERS+= libtest/collection.h
59 noinst_HEADERS+= libtest/common.h
60 noinst_HEADERS+= libtest/comparison.hpp
61 noinst_HEADERS+= libtest/core.h
62 noinst_HEADERS+= libtest/dream.h
63 noinst_HEADERS+= libtest/error.h
64 noinst_HEADERS+= libtest/failed.h
65 noinst_HEADERS+= libtest/fatal.hpp
66 noinst_HEADERS+= libtest/framework.h
67 noinst_HEADERS+= libtest/gearmand.h
68 noinst_HEADERS+= libtest/drizzled.h
69 noinst_HEADERS+= libtest/get.h
70 noinst_HEADERS+= libtest/has.hpp
71 noinst_HEADERS+= libtest/http.hpp
72 noinst_HEADERS+= libtest/is_pid.hpp
73 noinst_HEADERS+= libtest/is_local.hpp
74 noinst_HEADERS+= libtest/killpid.h
75 noinst_HEADERS+= libtest/libtool.hpp
76 noinst_HEADERS+= libtest/memcached.h
77 noinst_HEADERS+= libtest/memcached.hpp
78 noinst_HEADERS+= libtest/poll_error.hpp
79 noinst_HEADERS+= libtest/port.h
80 noinst_HEADERS+= libtest/runner.h
81 noinst_HEADERS+= libtest/server.h
82 noinst_HEADERS+= libtest/server_container.h
83 noinst_HEADERS+= libtest/signal.h
84 noinst_HEADERS+= libtest/socket.hpp
85 noinst_HEADERS+= libtest/stream.h
86 noinst_HEADERS+= libtest/strerror.h
87 noinst_HEADERS+= libtest/string.hpp
88 noinst_HEADERS+= libtest/test.h
89 noinst_HEADERS+= libtest/test.hpp
90 noinst_HEADERS+= libtest/tmpfile.hpp
91 noinst_HEADERS+= libtest/vchar.hpp
92 noinst_HEADERS+= libtest/version.h
93 noinst_HEADERS+= libtest/visibility.h
94 noinst_HEADERS+= libtest/wait.h
95
96 noinst_LTLIBRARIES+= libtest/libtest.la
97
98 libtest_libtest_la_CXXFLAGS=
99 libtest_libtest_la_DEPENDENCIES=
100 libtest_libtest_la_LIBADD=
101 libtest_libtest_la_SOURCES=
102
103 libtest_libtest_la_SOURCES+= libtest/binaries.cc
104 libtest_libtest_la_SOURCES+= libtest/dns.cc
105 libtest_libtest_la_SOURCES+= libtest/cmdline.cc
106 libtest_libtest_la_SOURCES+= libtest/comparison.cc
107 libtest_libtest_la_SOURCES+= libtest/collection.cc
108 libtest_libtest_la_SOURCES+= libtest/core.cc
109 libtest_libtest_la_SOURCES+= libtest/cpu.cc
110 libtest_libtest_la_SOURCES+= libtest/dream.cc
111 libtest_libtest_la_SOURCES+= libtest/fatal.cc
112 libtest_libtest_la_SOURCES+= libtest/formatter.cc
113 libtest_libtest_la_SOURCES+= libtest/framework.cc
114 libtest_libtest_la_SOURCES+= libtest/has.cc
115 libtest_libtest_la_SOURCES+= libtest/drizzled.cc
116 libtest_libtest_la_SOURCES+= libtest/http.cc
117 libtest_libtest_la_SOURCES+= libtest/is_local.cc
118 libtest_libtest_la_SOURCES+= libtest/killpid.cc
119 libtest_libtest_la_SOURCES+= libtest/libtool.cc
120 libtest_libtest_la_SOURCES+= libtest/main.cc
121 libtest_libtest_la_SOURCES+= libtest/port.cc
122 libtest_libtest_la_SOURCES+= libtest/runner.cc
123 libtest_libtest_la_SOURCES+= libtest/server.cc
124 libtest_libtest_la_SOURCES+= libtest/server_container.cc
125 libtest_libtest_la_SOURCES+= libtest/signal.cc
126 libtest_libtest_la_SOURCES+= libtest/socket.cc
127 libtest_libtest_la_SOURCES+= libtest/strerror.cc
128 libtest_libtest_la_SOURCES+= libtest/timer.cc
129 libtest_libtest_la_SOURCES+= libtest/tmpfile.cc
130 libtest_libtest_la_SOURCES+= libtest/vchar.cc
131
132 libtest_libtest_la_CXXFLAGS+= -DBUILDING_LIBTEST
133 libtest_libtest_la_CXXFLAGS+= $(PTHREAD_CFLAGS)
134 libtest_libtest_la_CXXFLAGS+= -DLIBTEST_TEMP="\"tmp_chroot\""
135 libtest_libtest_la_CXXFLAGS+= $(CURL_CFLAGS)
136
137 libtest_libtest_la_LIBADD+= $(PTHREAD_LIBS)
138 libtest_libtest_la_LIBADD+= $(CURL_LIBS)
139
140 libtest_libtest_la_DEPENDENCIES+= libtest_tmp_dir
141 libtest_libtest_la_DEPENDENCIES+=libtest/abort
142 libtest_libtest_la_DEPENDENCIES+=libtest/wait
143
144 # Declare unittest so that we can append to it
145 libtest_unittest_CXXFLAGS=
146 libtest_unittest_LDADD=
147 libtest_unittest_DEPENDENCIES=
148
149 # We are either building in tree, or with
150 if BUILDING_LIBMEMCACHED
151 libtest_libtest_la_DEPENDENCIES+= libmemcached/libmemcached.la
152 libtest_libtest_la_DEPENDENCIES+= libmemcached/libmemcachedutil.la
153 libtest_libtest_la_LIBADD+= libmemcached/libmemcached.la
154 libtest_libtest_la_LIBADD+= libmemcached/libmemcachedutil.la
155 libtest_libtest_la_SOURCES+= libtest/memcached.cc
156 libtest_libtest_la_CXXFLAGS+= -DHAVE_LIBMEMCACHED
157
158 libtest_unittest_CXXFLAGS+= -DHAVE_LIBMEMCACHED
159 libtest_unittest_LDADD+= libmemcached/libmemcached.la
160 libtest_unittest_LDADD+= libmemcached/libmemcachedutil.la
161 libtest_unittest_DEPENDENCIES+= libmemcached/libmemcached.la
162 libtest_unittest_DEPENDENCIES+= libmemcached/libmemcachedutil.la
163 else
164 if HAVE_LIBMEMCACHED
165 libtest_libtest_la_LIBADD+= $(libmemcached_LIBS)
166 libtest_libtest_la_SOURCES+= libtest/memcached.cc
167 else
168 libtest_libtest_la_CXXFLAGS+= -DHAVE_LIBMEMCACHED=0
169 libtest_unittest_CXXFLAGS+= -DHAVE_LIBMEMCACHED=0
170 endif
171 endif
172
173 if HAVE_LIBDRIZZLE
174
175 libtest_libtest_la_LIBADD+= $(libdrizzle_LIBS)
176 libtest_libtest_la_CXXFLAGS+= $(libdrizzle_CFLAGS)
177
178 endif
179
180 if BUILDING_GEARMAN
181 libtest_libtest_la_DEPENDENCIES+= libgearman/libgearman.la
182 libtest_libtest_la_LIBADD+= libgearman/libgearman.la
183 libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc
184 libtest_libtest_la_SOURCES+= libtest/gearmand.cc
185 libtest_libtest_la_SOURCES+= util/instance.cc
186 libtest_libtest_la_SOURCES+= util/operation.cc
187
188 libtest_unittest_LDADD+= libgearman/libgearman.la
189 libtest_unittest_DEPENDENCIES+= libgearman/libgearman.la
190 libtest_unittest_DEPENDENCIES+= gearmand/gearmand
191 else
192 if HAVE_LIBGEARMAN
193 libtest_libtest_la_DEPENDENCIES+= libgearman/libgearman.la
194 libtest_libtest_la_LIBADD+= $(libgearman_LIBS)
195 libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc
196 libtest_libtest_la_SOURCES+= libtest/gearmand.cc
197 libtest_libtest_la_SOURCES+= util/instance.cc
198 libtest_libtest_la_SOURCES+= util/operation.cc
199 endif
200 endif
201
202 libtest_tmp_dir: tmp_chroot/var/log tmp_chroot/var/tmp tmp_chroot/var/run tmp_chroot/var/drizzle
203
204 tmp_chroot: tmp_chroot/etc
205 @$(mkdir_p) tmp_chroot
206
207 tmp_chroot/etc:
208 @$(mkdir_p) tmp_chroot/etc
209
210 tmp_chroot/var: tmp_chroot
211 @$(mkdir_p) tmp_chroot/var
212
213 tmp_chroot/var/log: tmp_chroot/var
214 @$(mkdir_p) tmp_chroot/var/log
215
216 tmp_chroot/var/tmp: tmp_chroot/var
217 @$(mkdir_p) tmp_chroot/var/tmp
218
219 tmp_chroot/var/drizzle: tmp_chroot/var
220 @$(mkdir_p) tmp_chroot/var/drizzle
221
222 tmp_chroot/var/run: tmp_chroot/var
223 @$(mkdir_p) tmp_chroot/var/run
224
225
226 libtest_unittest_DEPENDENCIES+= libtest/libtest.la
227 libtest_unittest_LDADD+= libtest/libtest.la
228 libtest_unittest_SOURCES= libtest/unittest.cc
229 check_PROGRAMS+= libtest/unittest
230 noinst_PROGRAMS+= libtest/unittest
231 test-unittest: libtest/unittest
232 @libtest/unittest
233
234 valgrind-unittest: libtest/unittest
235 @$(VALGRIND_COMMAND) libtest/unittest
236
237 gdb-unittest: libtest/unittest
238 @$(GDB_COMMAND) libtest/unittest
239
240 helgrind-unittest: libtest/unittest
241 @$(HELGRIND_COMMAND) libtest/unittest
242
243 drd-unittest: libtest/unittest
244 @$(DRD_COMMAND) libtest/unittest
245
246 libtest_skiptest_LDADD= libtest/libtest.la
247 libtest_skiptest_SOURCES= libtest/skiptest.cc
248 check_PROGRAMS+= libtest/skiptest
249 noinst_PROGRAMS+= libtest/skiptest
250
251 libtest_wait_SOURCES=
252 libtest_wait_SOURCES+= libtest/wait.cc
253 libtest_wait_SOURCES+= libtest/dream.cc
254 noinst_PROGRAMS+= libtest/wait
255
256 libtest_abort_SOURCES= libtest/abort.cc
257 noinst_PROGRAMS+= libtest/abort