Fix bad if path
[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 --tool=memcheck --error-exitcode=1 --leak-check=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE
9 SGCHECK_EXEC_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-sgcheck --error-exitcode=1
10 VALGRIND_COMMAND= TESTS_ENVIRONMENT="valgrind" $(VALGRIND_EXEC_COMMAND)
11 HELGRIND_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=helgrind --read-var-info=yes --error-exitcode=1 --read-var-info=yes
12 DRD_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=drd --free-is-write=yes --error-exitcode=1
13 SGCHECK_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-sgcheck --error-exitcode=1
14 MASSIF_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=massif
15 GDB_COMMAND= $(LIBTOOL_COMMAND) gdb -f -x libtest/run.gdb
16 PTRCHECK_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=exp-ptrcheck --error-exitcode=1
17 PAHOLE_COMMAND= $(LIBTOOL_COMMAND) --mode=execute pahole
18 VALGRIND_SUPRESSION= $(LIBTOOL_COMMAND) valgrind --leak-check=full --show-reachable=yes --error-limit=no --gen-suppressions=all --log-file=minimalraw.log
19
20 export LIBTOOL_COMMAND
21 export VALGRIND_COMMAND
22 export HELGRIND_COMMAND
23 export DRD_COMMAND
24 export SGCHECK_COMMAND
25 export GDB_COMMAND
26
27 valgrind:
28 @echo make check TESTS_ENVIRONMENT="\"$(VALGRIND_EXEC_COMMAND)\""
29
30 sgcheck:
31 @echo make check TESTS_ENVIRONMENT="\"$(SGCHECK_EXEC_COMMAND)\""
32
33 valgrind-supressions:
34 @echo make check TESTS_ENVIRONMENT="\"$(VALGRIND_SUPRESSION)\""
35
36 gdb:
37 @echo make check TESTS_ENVIRONMENT="\"$(GDB_COMMAND)\""
38
39 helgrind:
40 @echo make check TESTS_ENVIRONMENT="\"$(HELGRIND_COMMAND)\""
41
42 drd:
43 @echo make check TESTS_ENVIRONMENT="\"$(DRD_COMMAND)\""
44
45 EXTRA_DIST+= libtest/run.gdb
46 EXTRA_DIST+= libtest/version.h
47
48 BUILT_SOURCES+= libtest/version.h
49
50 .PHONY: clean-libtest-check
51 clean-libtest-check:
52 -rm -rf tmp_chroot
53
54 noinst_HEADERS+= libtest/client.hpp
55 noinst_HEADERS+= libtest/formatter.hpp
56 noinst_HEADERS+= libtest/timer.hpp
57 noinst_HEADERS+= libtest/alarm.h
58 noinst_HEADERS+= libtest/binaries.h
59 noinst_HEADERS+= libtest/cpu.hpp
60 noinst_HEADERS+= libtest/blobslap_worker.h
61 noinst_HEADERS+= libtest/callbacks.h
62 noinst_HEADERS+= libtest/dns.hpp
63 noinst_HEADERS+= libtest/cmdline.h
64 noinst_HEADERS+= libtest/collection.h
65 noinst_HEADERS+= libtest/common.h
66 noinst_HEADERS+= libtest/comparison.hpp
67 noinst_HEADERS+= libtest/core.h
68 noinst_HEADERS+= libtest/dream.h
69 noinst_HEADERS+= libtest/error.h
70 noinst_HEADERS+= libtest/exception.hpp
71 noinst_HEADERS+= libtest/exception/disconnected.hpp
72 noinst_HEADERS+= libtest/exception/fatal.hpp
73 noinst_HEADERS+= libtest/framework.h
74 noinst_HEADERS+= libtest/gearmand.h
75 noinst_HEADERS+= libtest/drizzled.h
76 noinst_HEADERS+= libtest/get.h
77 noinst_HEADERS+= libtest/has.hpp
78 noinst_HEADERS+= libtest/http.hpp
79 noinst_HEADERS+= libtest/is_pid.hpp
80 noinst_HEADERS+= libtest/is_local.hpp
81 noinst_HEADERS+= libtest/killpid.h
82 noinst_HEADERS+= libtest/libtool.hpp
83 noinst_HEADERS+= libtest/memcached.h
84 noinst_HEADERS+= libtest/memcached.hpp
85 noinst_HEADERS+= libtest/poll_error.hpp
86 noinst_HEADERS+= libtest/port.h
87 noinst_HEADERS+= libtest/result.hpp
88 noinst_HEADERS+= libtest/result/base.hpp
89 noinst_HEADERS+= libtest/result/fail.hpp
90 noinst_HEADERS+= libtest/result/skip.hpp
91 noinst_HEADERS+= libtest/result/success.hpp
92 noinst_HEADERS+= libtest/runner.h
93 noinst_HEADERS+= libtest/server.h
94 noinst_HEADERS+= libtest/server_container.h
95 noinst_HEADERS+= libtest/signal.h
96 noinst_HEADERS+= libtest/socket.hpp
97 noinst_HEADERS+= libtest/stream.h
98 noinst_HEADERS+= libtest/strerror.h
99 noinst_HEADERS+= libtest/string.hpp
100 noinst_HEADERS+= libtest/test.h
101 noinst_HEADERS+= libtest/test.hpp
102 noinst_HEADERS+= libtest/thread.hpp
103 noinst_HEADERS+= libtest/tmpfile.hpp
104 noinst_HEADERS+= libtest/lite.h
105 noinst_HEADERS+= libtest/valgrind.h
106 noinst_HEADERS+= libtest/vchar.hpp
107 noinst_HEADERS+= libtest/version.h
108 noinst_HEADERS+= libtest/visibility.h
109 noinst_HEADERS+= libtest/wait.h
110 noinst_HEADERS+= libtest/yatl.h
111
112 check_LTLIBRARIES+= libtest/libtest.la
113
114 libtest_libtest_la_CXXFLAGS=
115 EXTRA_libtest_libtest_la_DEPENDENCIES=
116 libtest_libtest_la_LIBADD=
117 libtest_libtest_la_SOURCES=
118
119 libtest_libtest_la_SOURCES+= libtest/alarm.cc
120 libtest_libtest_la_SOURCES+= libtest/binaries.cc
121 libtest_libtest_la_SOURCES+= libtest/cmdline.cc
122 libtest_libtest_la_SOURCES+= libtest/collection.cc
123 libtest_libtest_la_SOURCES+= libtest/comparison.cc
124 libtest_libtest_la_SOURCES+= libtest/core.cc
125 libtest_libtest_la_SOURCES+= libtest/cpu.cc
126 libtest_libtest_la_SOURCES+= libtest/dns.cc
127 libtest_libtest_la_SOURCES+= libtest/dream.cc
128 libtest_libtest_la_SOURCES+= libtest/drizzled.cc
129 libtest_libtest_la_SOURCES+= libtest/exception.cc
130 libtest_libtest_la_SOURCES+= libtest/exception/fatal.cc
131 libtest_libtest_la_SOURCES+= libtest/formatter.cc
132 libtest_libtest_la_SOURCES+= libtest/client.cc
133 libtest_libtest_la_SOURCES+= libtest/framework.cc
134 libtest_libtest_la_SOURCES+= libtest/has.cc
135 libtest_libtest_la_SOURCES+= libtest/http.cc
136 libtest_libtest_la_SOURCES+= libtest/is_local.cc
137 libtest_libtest_la_SOURCES+= libtest/killpid.cc
138 libtest_libtest_la_SOURCES+= libtest/libtool.cc
139 libtest_libtest_la_SOURCES+= libtest/main.cc
140 libtest_libtest_la_SOURCES+= libtest/port.cc
141 libtest_libtest_la_SOURCES+= libtest/result.cc
142 libtest_libtest_la_SOURCES+= libtest/runner.cc
143 libtest_libtest_la_SOURCES+= libtest/server.cc
144 libtest_libtest_la_SOURCES+= libtest/server_container.cc
145 libtest_libtest_la_SOURCES+= libtest/signal.cc
146 libtest_libtest_la_SOURCES+= libtest/socket.cc
147 libtest_libtest_la_SOURCES+= libtest/strerror.cc
148 libtest_libtest_la_SOURCES+= libtest/timer.cc
149 libtest_libtest_la_SOURCES+= libtest/tmpfile.cc
150 libtest_libtest_la_SOURCES+= libtest/vchar.cc
151
152 libtest_libtest_la_CXXFLAGS+= -DBUILDING_LIBTEST
153 libtest_libtest_la_CXXFLAGS+= @PTHREAD_CFLAGS@
154 libtest_libtest_la_CXXFLAGS+= -DLIBTEST_TEMP="\"tmp_chroot\""
155 libtest_libtest_la_CXXFLAGS+= $(CURL_CFLAGS)
156
157 libtest_libtest_la_LIBADD+= @PTHREAD_LIBS@
158 libtest_libtest_la_LIBADD+= $(CURL_LIBS)
159 libtest_libtest_la_LIBADD+= @RT_LIB@
160
161 EXTRA_libtest_libtest_la_DEPENDENCIES+= libtest_tmp_dir
162 EXTRA_libtest_libtest_la_DEPENDENCIES+= libtest/abort
163 EXTRA_libtest_libtest_la_DEPENDENCIES+= libtest/wait
164
165 # Declare unittest so that we can append to it
166 libtest_unittest_CXXFLAGS=
167 libtest_unittest_LDADD=
168 libtest_libtest_la_LDFLAGS=
169
170 # We are either building in tree, or with
171 libtest_libtest_la_SOURCES+= libtest/memcached.cc
172
173 libtest_libtest_la_LDFLAGS+= @LIBDRIZZLE_LDFLAGS@
174 libtest_libtest_la_LIBADD+= @LIBDRIZZLE_LIB@
175
176 libtest_libtest_la_SOURCES+= libtest/gearmand.cc
177
178 if BUILDING_GEARMAN
179 libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc
180 endif
181
182 TMP_DIR := tmp_chroot/etc tmp_chroot/var/log tmp_chroot/var/tmp tmp_chroot/var/run tmp_chroot/var/drizzle
183
184 .PHONY: libtest_tmp_dir
185 libtest_tmp_dir: | $(TMP_DIR)
186
187 $(TMP_DIR):
188 @$(mkdir_p) $(TMP_DIR)
189
190 libtest_unittest_LDADD+= libtest/libtest.la
191 libtest_unittest_SOURCES= libtest/unittest.cc
192 check_PROGRAMS+= libtest/unittest
193 noinst_PROGRAMS+= libtest/unittest
194 test-unittest: libtest/unittest
195 @libtest/unittest
196
197 valgrind-unittest: libtest/unittest
198 @$(VALGRIND_COMMAND) libtest/unittest
199
200 gdb-unittest: libtest/unittest
201 @$(GDB_COMMAND) libtest/unittest
202
203 helgrind-unittest: libtest/unittest
204 @$(HELGRIND_COMMAND) libtest/unittest
205
206 drd-unittest: libtest/unittest
207 @$(DRD_COMMAND) libtest/unittest
208
209 sgcheck-unittest: libtest/unittest
210 echo $(SGCHECK_COMMAND)
211 @$(SGCHECK_COMMAND) libtest/unittest
212
213 libtest_skiptest_LDADD= libtest/libtest.la
214 libtest_skiptest_SOURCES= libtest/skiptest.cc
215 check_PROGRAMS+= libtest/skiptest
216 noinst_PROGRAMS+= libtest/skiptest
217
218 test-skiptest: libtest/skiptest
219 @libtest/skiptest
220
221 valgrind-skiptest: libtest/skiptest
222 @$(VALGRIND_COMMAND) libtest/skiptest
223
224 helgrind-skiptest: libtest/skiptest
225 @$(HELGRIND_COMMAND) libtest/skiptest
226
227 drd-skiptest: libtest/skiptest
228 @$(DRD_COMMAND) libtest/skiptest
229
230 libtest_wait_SOURCES=
231 libtest_wait_SOURCES+= libtest/wait.cc
232 libtest_wait_SOURCES+= libtest/dream.cc
233 noinst_PROGRAMS+= libtest/wait
234
235 libtest_core_count_SOURCES=
236 libtest_core_count_SOURCES+= libtest/cpu.cc
237 libtest_core_count_SOURCES+= libtest/core_count.cc
238 noinst_PROGRAMS+= libtest/core-count
239
240 libtest_abort_SOURCES= libtest/abort.cc
241 noinst_PROGRAMS+= libtest/abort
242
243 libtest_backtrace_SOURCES=
244 libtest_backtrace_LDADD=
245 libtest_backtrace_SOURCES+= libtest/backtrace_test.cc
246 libtest_backtrace_SOURCES+= libmemcached/backtrace.cc
247 libtest_backtrace_LDADD+= @DL_LIB@
248 noinst_PROGRAMS+= libtest/backtrace
249 test-backtrace: libtest/backtrace
250 @libtest/backtrace
251
252 gdb-backtrace: libtest/backtrace
253 @$(GDB_COMMAND) libtest/backtrace
254