blob: 3c97452f5a635d9944cb253270b6e729c9ce8c65 [file] [log] [blame]
David Reiss351e22b2010-08-31 16:51:19 +00001#
2# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18#
Roger Meierc0959192013-01-15 23:20:19 +010019.NOTPARALLEL:
Roger Meier2b1a5282012-05-11 10:12:39 +000020noinst_LTLIBRARIES = libtestgencpp.la libprocessortest.la
David Reiss351e22b2010-08-31 16:51:19 +000021nodist_libtestgencpp_la_SOURCES = \
22 gen-cpp/DebugProtoTest_types.cpp \
23 gen-cpp/OptionalRequiredTest_types.cpp \
24 gen-cpp/DebugProtoTest_types.cpp \
25 gen-cpp/ThriftTest_types.cpp \
26 gen-cpp/DebugProtoTest_types.h \
27 gen-cpp/OptionalRequiredTest_types.h \
jfarrelle0e83162014-04-08 22:45:01 -040028 gen-cpp/Recursive_types.cpp \
29 gen-cpp/Recursive_types.h \
David Reiss351e22b2010-08-31 16:51:19 +000030 gen-cpp/ThriftTest_types.h \
31 ThriftTest_extras.cpp \
32 DebugProtoTest_extras.cpp
33
Roger Meier2b1a5282012-05-11 10:12:39 +000034nodist_libprocessortest_la_SOURCES = \
35 gen-cpp/ChildService.cpp \
36 gen-cpp/ChildService.h \
37 gen-cpp/ParentService.cpp \
38 gen-cpp/ParentService.h \
39 gen-cpp/proc_types.cpp \
40 gen-cpp/proc_types.h
41
David Reiss351e22b2010-08-31 16:51:19 +000042ThriftTest_extras.o: gen-cpp/ThriftTest_types.h
43DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h
44
45libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
46
47noinst_PROGRAMS = Benchmark
48
49Benchmark_SOURCES = \
50 Benchmark.cpp
51
52Benchmark_LDADD = libtestgencpp.la
53
54check_PROGRAMS = \
55 TFDTransportTest \
56 TPipedTransportTest \
57 DebugProtoTest \
58 JSONProtoTest \
59 OptionalRequiredTest \
jfarrelle0e83162014-04-08 22:45:01 -040060 RecursiveTest \
David Reisse71115b2010-10-06 17:09:56 +000061 SpecializationTest \
David Reiss351e22b2010-08-31 16:51:19 +000062 AllProtocolsTest \
David Reiss35dc7692010-10-06 17:10:19 +000063 TransportTest \
David Reiss9a961e72010-10-06 17:10:23 +000064 ZlibTest \
David Reiss709b69f2010-10-06 17:10:30 +000065 TFileTransportTest \
Roger Meier63fcb7e2014-06-15 21:48:59 +020066 UnitTests \
67 link_test
Roger Meier2d59b9e2012-05-23 19:40:40 +000068# disable these test ... too strong
69# processor_test
Roger Meierdd16f052012-05-11 14:19:48 +000070# concurrency_test
David Reiss351e22b2010-08-31 16:51:19 +000071
Roger Meier9e0f0742011-08-03 17:36:55 +000072TESTS_ENVIRONMENT= \
73 BOOST_TEST_LOG_SINK=tests.xml \
74 BOOST_TEST_LOG_LEVEL=test_suite \
75 BOOST_TEST_LOG_FORMAT=xml
76
David Reiss351e22b2010-08-31 16:51:19 +000077TESTS = \
78 $(check_PROGRAMS)
79
80UnitTests_SOURCES = \
81 UnitTestMain.cpp \
82 TMemoryBufferTest.cpp \
Roger Meier4cb8e402012-05-27 18:05:16 +000083 TBufferBaseTest.cpp \
84 Base64Test.cpp
Roger Meier12d70532011-12-14 23:35:28 +000085
86if !WITH_BOOSTTHREADS
87UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +000088 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000089endif
David Reiss351e22b2010-08-31 16:51:19 +000090
Christian Lavoie4f42ef72010-11-04 18:51:42 +000091UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +000092 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +020093 -l:libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +000094
David Reiss35dc7692010-10-06 17:10:19 +000095TransportTest_SOURCES = \
96 TransportTest.cpp
97
Christian Lavoie4f42ef72010-11-04 18:51:42 +000098TransportTest_LDADD = \
99 libtestgencpp.la \
100 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200101 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000102 -lz
David Reiss35dc7692010-10-06 17:10:19 +0000103
David Reiss9a961e72010-10-06 17:10:23 +0000104ZlibTest_SOURCES = \
105 ZlibTest.cpp
106
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000107ZlibTest_LDADD = \
108 libtestgencpp.la \
109 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200110 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000111 -lz
David Reiss9a961e72010-10-06 17:10:23 +0000112
David Reiss709b69f2010-10-06 17:10:30 +0000113TFileTransportTest_SOURCES = \
114 TFileTransportTest.cpp
115
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000116TFileTransportTest_LDADD = \
117 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200118 -l:libboost_unit_test_framework.a
David Reiss709b69f2010-10-06 17:10:30 +0000119
David Reiss351e22b2010-08-31 16:51:19 +0000120#
121# TFDTransportTest
122#
123TFDTransportTest_SOURCES = \
124 TFDTransportTest.cpp
125
126TFDTransportTest_LDADD = \
127 $(top_builddir)/lib/cpp/libthrift.la
128
129
130#
131# TPipedTransportTest
132#
133TPipedTransportTest_SOURCES = \
134 TPipedTransportTest.cpp
135
136TPipedTransportTest_LDADD = \
137 $(top_builddir)/lib/cpp/libthrift.la
138
139#
140# AllProtocolsTest
141#
142AllProtocolsTest_SOURCES = \
143 AllProtocolTests.cpp \
144 AllProtocolTests.tcc \
145 GenericHelpers.h
146
147AllProtocolsTest_LDADD = libtestgencpp.la
148
149#
150# DebugProtoTest
151#
152DebugProtoTest_SOURCES = \
153 DebugProtoTest.cpp
154
155DebugProtoTest_LDADD = libtestgencpp.la
156
157
158#
159# JSONProtoTest
160#
161JSONProtoTest_SOURCES = \
162 JSONProtoTest.cpp
163
164JSONProtoTest_LDADD = libtestgencpp.la
165
166#
167# OptionalRequiredTest
168#
169OptionalRequiredTest_SOURCES = \
170 OptionalRequiredTest.cpp
171
172OptionalRequiredTest_LDADD = libtestgencpp.la
173
David Reisse71115b2010-10-06 17:09:56 +0000174#
jfarrelle0e83162014-04-08 22:45:01 -0400175# OptionalRequiredTest
176#
177RecursiveTest_SOURCES = \
178 RecursiveTest.cpp
179
180RecursiveTest_LDADD = libtestgencpp.la
181
182#
David Reisse71115b2010-10-06 17:09:56 +0000183# SpecializationTest
184#
185SpecializationTest_SOURCES = \
186 SpecializationTest.cpp
187
188SpecializationTest_LDADD = libtestgencpp.la
189
Roger Meier2b1a5282012-05-11 10:12:39 +0000190concurrency_test_SOURCES = \
191 concurrency/Tests.cpp \
192 concurrency/ThreadFactoryTests.h \
193 concurrency/ThreadManagerTests.h \
194 concurrency/TimerManagerTests.h
David Reiss351e22b2010-08-31 16:51:19 +0000195
Roger Meier2b1a5282012-05-11 10:12:39 +0000196concurrency_test_LDADD = \
197 $(top_builddir)/lib/cpp/libthrift.la
198
Roger Meier63fcb7e2014-06-15 21:48:59 +0200199link_test_SOURCES = \
200 link/LinkTest.cpp \
201 link/TemplatedService1.cpp \
202 link/TemplatedService2.cpp
203
Roger Meier2b1a5282012-05-11 10:12:39 +0000204processor_test_SOURCES = \
205 processor/ProcessorTest.cpp \
206 processor/EventLog.cpp \
207 processor/ServerThread.cpp \
208 processor/EventLog.h \
209 processor/Handlers.h \
210 processor/ServerThread.h
211
212processor_test_LDADD = libprocessortest.la \
213 $(top_builddir)/lib/cpp/libthrift.la \
214 $(top_builddir)/lib/cpp/libthriftnb.la \
215 $(BOOST_LDFLAGS) \
216 -levent \
Roger Meier73b58a22014-05-11 17:39:34 +0200217 -l:libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +0000218#
219# Common thrift code generation rules
220#
221THRIFT = $(top_builddir)/compiler/cpp/thrift
222
223gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
224 $(THRIFT) --gen cpp:dense $<
225
226gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
227 $(THRIFT) --gen cpp:dense $<
228
jfarrelle0e83162014-04-08 22:45:01 -0400229gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h: $(top_srcdir)/test/Recursive.thrift
230 $(THRIFT) --gen cpp $<
231
David Reiss351e22b2010-08-31 16:51:19 +0000232gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
233 $(THRIFT) --gen cpp:dense $<
234
235gen-cpp/SecondService.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_types.cpp gen-cpp/ThriftTest_types.h: $(top_srcdir)/test/ThriftTest.thrift
236 $(THRIFT) --gen cpp:dense $<
237
Roger Meier2b1a5282012-05-11 10:12:39 +0000238gen-cpp/ChildService.cpp: processor/proc.thrift
239 $(THRIFT) --gen cpp:templates,cob_style $<
240
David Reiss351e22b2010-08-31 16:51:19 +0000241INCLUDES = \
242 -I$(top_srcdir)/lib/cpp/src
243
244AM_CPPFLAGS = $(BOOST_CPPFLAGS)
Roger Meier38315782011-11-06 11:29:41 +0000245AM_LDFLAGS = $(BOOST_LDFLAGS)
Jake Farrellea949fb2011-12-13 20:02:33 +0000246AM_CXXFLAGS = -Wall
David Reiss351e22b2010-08-31 16:51:19 +0000247
248clean-local:
249 $(RM) -r gen-cpp
250
251EXTRA_DIST = \
David Reiss351e22b2010-08-31 16:51:19 +0000252 DenseProtoTest.cpp \
253 ThriftTest_extras.cpp \
Jake Farrell7c7a5e02012-10-11 00:29:11 +0000254 DebugProtoTest_extras.cpp \
255 concurrency \
256 processor