Update libtest/fedora/lion fixes
[m6w6/libmemcached] / libtest / include.am
1 # vim:ft=automake
2 # Copyright (C) 2011 Data Differential, http://datadifferential.com/
3 # All rights reserved.
4 #
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 3 of the License, or (at your option) any later version.
9 #
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #
19 # included from Top Level Makefile.am
20 # All paths should be given relative to the root
21 #
22
23 LIBTEST_TMP = ${abs_top_builddir}/tests/var/tmp/
24
25 LIBTOOL_COMMAND=$(LIBTOOL) --mode=execute
26 VALGRIND_COMMAND= $(LIBTOOL_COMMAND) valgrind --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE
27 HELGRIND_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=helgrind --read-var-info=yes --error-exitcode=1
28 DRD_COMMAND= $(LIBTOOL_COMMAND) valgrind --tool=drd
29 GDB_COMMAND= $(LIBTOOL_COMMAND) gdb -f -x libtest/run.gdb
30
31 export LIBTOOL_COMMAND
32 export VALGRIND_COMMAND
33 export HELGRIND_COMMAND
34 export DRD_COMMAND
35 export GDB_COMMAND
36
37 EXTRA_DIST+= libtest/run.gdb
38
39 CLEANFILES+= \
40 tests/var/log/* \
41 tests/var/run/* \
42 tests/var/tmp/*
43
44 noinst_HEADERS+= \
45 libtest/blobslap_worker.h \
46 libtest/callbacks.h \
47 libtest/cmdline.h \
48 libtest/collection.h \
49 libtest/common.h \
50 libtest/comparison.hpp \
51 libtest/core.h \
52 libtest/error.h \
53 libtest/failed.h \
54 libtest/framework.h \
55 libtest/gearmand.h \
56 libtest/get.h \
57 libtest/killpid.h \
58 libtest/memcached.h \
59 libtest/runner.h \
60 libtest/server.h \
61 libtest/signal.h \
62 libtest/stats.h \
63 libtest/stream.h \
64 libtest/strerror.h \
65 libtest/string.hpp \
66 libtest/test.h \
67 libtest/test.hpp \
68 libtest/visibility.h \
69 libtest/wait.h
70
71 noinst_LTLIBRARIES+= libtest/libtest.la
72 libtest_libtest_la_SOURCES= \
73 libtest/cmdline.cc \
74 libtest/framework.cc \
75 libtest/killpid.cc \
76 libtest/runner.cc \
77 libtest/server.cc \
78 libtest/signal.cc \
79 libtest/test.cc
80
81 libtest_libtest_la_CFLAGS= ${AM_CFLAGS} ${NO_CONVERSION} -DBUILDING_LIBTEST
82 libtest_libtest_la_CXXFLAGS= ${AM_CXXFLAGS} ${NO_CONVERSION} -DBUILDING_LIBTEST
83 libtest_libtest_la_LIBADD=
84
85 LIBTEST_LDADD= libtest/libtest.la
86
87 if HAVE_LIBMEMCACHED
88 if BUILD_LIBMEMCACHEDUTIL
89 LIBTEST_LDADD+= libmemcached/libmemcached.la
90 LIBTEST_LDADD+= libmemcached/libmemcachedutil.la
91 else
92 LIBTEST_LDADD+= $(libmemcached_LIBS)
93 endif
94 libtest_libtest_la_SOURCES+= libtest/memcached.cc
95 endif
96
97 if HAVE_LIBGEARMAN
98 LIBTEST_LDADD+= libgearman/libgearman.la
99 libtest_libtest_la_SOURCES+= libtest/blobslap_worker.cc
100 libtest_libtest_la_SOURCES+= libtest/gearmand.cc
101 libtest_libtest_la_SOURCES+= util/instance.cc
102 libtest_libtest_la_SOURCES+= util/operation.cc
103 endif
104
105 libtest_tmp_dir: tests/var/log tests/var/tmp tests/var/run clearn-var
106
107 clearn-var:
108 @rm -f tests/var/log/*
109 @rm -f tests/var/run/*
110 @rm -f tests/var/tmp/*
111
112 tests/var:
113 @$(mkdir_p) tests/var
114
115 tests/var/log: tests/var
116 @$(mkdir_p) tests/var/log
117
118 tests/var/tmp: tests/var
119 @$(mkdir_p) tests/var/tmp
120
121 tests/var/run: tests/var
122 @$(mkdir_p) tests/var/run
123
124 .PHONY+= tests/var
125
126
127 libtest_unittest_CFLAGS=
128 libtest_unittest_LDADD= ${LIBTEST_LDADD}
129 libtest_unittest_DEPENDENCIES= ${LIBTEST_LDADD} libtest_tmp_dir
130 libtest_unittest_SOURCES= libtest/unittest.cc
131 check_PROGRAMS+= libtest/unittest
132 noinst_PROGRAMS+= libtest/unittest
133 test-unittest: libtest/unittest
134 @libtest/unittest
135
136 valgrind-unittest: libtest/unittest
137 @$(VALGRIND_COMMAND) libtest/unittest
138
139 gdb-unittest: libtest/unittest
140 @$(GDB_COMMAND) libtest/unittest
141
142 helgrind-unittest: libtest/unittest
143 @$(HELGRIND_COMMAND) libtest/unittest
144
145 drd-unittest: libtest/unittest
146 @$(DRD_COMMAND) libtest/unittest
147
148 libtest_wait_SOURCES= libtest/wait.cc
149 noinst_PROGRAMS+= libtest/wait
150