blob: f15b0c174095e497eed319b84734d3e37a304118 [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 = \
Jens Geyer79f988c2014-10-03 20:42:54 +020022 gen-cpp/DebugProtoTest_types.cpp \
23 gen-cpp/DebugProtoTest_types.h \
24 gen-cpp/EnumTest_types.cpp \
25 gen-cpp/EnumTest_types.h \
26 gen-cpp/OptionalRequiredTest_types.cpp \
27 gen-cpp/OptionalRequiredTest_types.h \
28 gen-cpp/Recursive_types.cpp \
29 gen-cpp/Recursive_types.h \
30 gen-cpp/ThriftTest_types.cpp \
31 gen-cpp/ThriftTest_types.h \
32 gen-cpp/TypedefTest_types.cpp \
33 gen-cpp/TypedefTest_types.h \
34 ThriftTest_extras.cpp \
35 DebugProtoTest_extras.cpp
David Reiss351e22b2010-08-31 16:51:19 +000036
Roger Meier2b1a5282012-05-11 10:12:39 +000037nodist_libprocessortest_la_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020038 gen-cpp/ChildService.cpp \
39 gen-cpp/ChildService.h \
40 gen-cpp/ParentService.cpp \
41 gen-cpp/ParentService.h \
42 gen-cpp/proc_types.cpp \
43 gen-cpp/proc_types.h
Roger Meier2b1a5282012-05-11 10:12:39 +000044
David Reiss351e22b2010-08-31 16:51:19 +000045ThriftTest_extras.o: gen-cpp/ThriftTest_types.h
46DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h
47
48libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
49
50noinst_PROGRAMS = Benchmark
51
52Benchmark_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020053 Benchmark.cpp
David Reiss351e22b2010-08-31 16:51:19 +000054
55Benchmark_LDADD = libtestgencpp.la
56
57check_PROGRAMS = \
Jens Geyer79f988c2014-10-03 20:42:54 +020058 TFDTransportTest \
59 TPipedTransportTest \
60 DebugProtoTest \
61 JSONProtoTest \
62 OptionalRequiredTest \
63 RecursiveTest \
64 SpecializationTest \
65 AllProtocolsTest \
66 TransportTest \
67 ZlibTest \
68 TFileTransportTest \
69 UnitTests \
70 link_test \
71 OpenSSLManualInitTest \
72 EnumTest
Roger Meier2d59b9e2012-05-23 19:40:40 +000073# disable these test ... too strong
74# processor_test
Jens Geyer79f988c2014-10-03 20:42:54 +020075# concurrency_test
David Reiss351e22b2010-08-31 16:51:19 +000076
Roger Meier9e0f0742011-08-03 17:36:55 +000077TESTS_ENVIRONMENT= \
Jens Geyer79f988c2014-10-03 20:42:54 +020078 BOOST_TEST_LOG_SINK=tests.xml \
79 BOOST_TEST_LOG_LEVEL=test_suite \
80 BOOST_TEST_LOG_FORMAT=xml
Roger Meier9e0f0742011-08-03 17:36:55 +000081
David Reiss351e22b2010-08-31 16:51:19 +000082TESTS = \
Jens Geyer79f988c2014-10-03 20:42:54 +020083 $(check_PROGRAMS)
David Reiss351e22b2010-08-31 16:51:19 +000084
85UnitTests_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020086 UnitTestMain.cpp \
87 TMemoryBufferTest.cpp \
88 TBufferBaseTest.cpp \
89 Base64Test.cpp \
90 ToStringTest.cpp \
91 TypedefTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000092
93if !WITH_BOOSTTHREADS
94UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +000095 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000096endif
David Reiss351e22b2010-08-31 16:51:19 +000097
Christian Lavoie4f42ef72010-11-04 18:51:42 +000098UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +000099 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200100 -l:libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +0000101
David Reiss35dc7692010-10-06 17:10:19 +0000102TransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200103 TransportTest.cpp
David Reiss35dc7692010-10-06 17:10:19 +0000104
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000105TransportTest_LDADD = \
106 libtestgencpp.la \
107 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200108 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000109 -lz
David Reiss35dc7692010-10-06 17:10:19 +0000110
David Reiss9a961e72010-10-06 17:10:23 +0000111ZlibTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200112 ZlibTest.cpp
David Reiss9a961e72010-10-06 17:10:23 +0000113
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000114ZlibTest_LDADD = \
115 libtestgencpp.la \
116 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200117 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000118 -lz
David Reiss9a961e72010-10-06 17:10:23 +0000119
Jens Geyerae0b22c2014-09-04 23:04:21 +0200120EnumTest_SOURCES = \
121 EnumTest.cpp
122
123EnumTest_LDADD = \
124 libtestgencpp.la \
Jens Geyer089bcd32014-09-11 22:36:41 +0200125 -l:libboost_unit_test_framework.a
Jens Geyerae0b22c2014-09-04 23:04:21 +0200126
David Reiss709b69f2010-10-06 17:10:30 +0000127TFileTransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200128 TFileTransportTest.cpp
David Reiss709b69f2010-10-06 17:10:30 +0000129
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000130TFileTransportTest_LDADD = \
131 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200132 -l:libboost_unit_test_framework.a
David Reiss709b69f2010-10-06 17:10:30 +0000133
David Reiss351e22b2010-08-31 16:51:19 +0000134#
135# TFDTransportTest
136#
137TFDTransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200138 TFDTransportTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000139
140TFDTransportTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200141 $(top_builddir)/lib/cpp/libthrift.la
David Reiss351e22b2010-08-31 16:51:19 +0000142
143
144#
145# TPipedTransportTest
146#
147TPipedTransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200148 TPipedTransportTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000149
150TPipedTransportTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200151 $(top_builddir)/lib/cpp/libthrift.la
David Reiss351e22b2010-08-31 16:51:19 +0000152
153#
154# AllProtocolsTest
155#
156AllProtocolsTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200157 AllProtocolTests.cpp \
158 AllProtocolTests.tcc \
159 GenericHelpers.h
David Reiss351e22b2010-08-31 16:51:19 +0000160
161AllProtocolsTest_LDADD = libtestgencpp.la
162
163#
164# DebugProtoTest
165#
166DebugProtoTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200167 DebugProtoTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000168
169DebugProtoTest_LDADD = libtestgencpp.la
170
171
172#
173# JSONProtoTest
174#
175JSONProtoTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200176 JSONProtoTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000177
178JSONProtoTest_LDADD = libtestgencpp.la
179
180#
181# OptionalRequiredTest
182#
183OptionalRequiredTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200184 OptionalRequiredTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000185
186OptionalRequiredTest_LDADD = libtestgencpp.la
187
David Reisse71115b2010-10-06 17:09:56 +0000188#
jfarrelle0e83162014-04-08 22:45:01 -0400189# OptionalRequiredTest
190#
191RecursiveTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200192 RecursiveTest.cpp
jfarrelle0e83162014-04-08 22:45:01 -0400193
194RecursiveTest_LDADD = libtestgencpp.la
195
196#
David Reisse71115b2010-10-06 17:09:56 +0000197# SpecializationTest
198#
199SpecializationTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200200 SpecializationTest.cpp
David Reisse71115b2010-10-06 17:09:56 +0000201
202SpecializationTest_LDADD = libtestgencpp.la
203
Roger Meier2b1a5282012-05-11 10:12:39 +0000204concurrency_test_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200205 concurrency/Tests.cpp \
206 concurrency/ThreadFactoryTests.h \
207 concurrency/ThreadManagerTests.h \
208 concurrency/TimerManagerTests.h
David Reiss351e22b2010-08-31 16:51:19 +0000209
Roger Meier2b1a5282012-05-11 10:12:39 +0000210concurrency_test_LDADD = \
211 $(top_builddir)/lib/cpp/libthrift.la
212
Roger Meier63fcb7e2014-06-15 21:48:59 +0200213link_test_SOURCES = \
214 link/LinkTest.cpp \
215 link/TemplatedService1.cpp \
216 link/TemplatedService2.cpp
217
Roger Meier2b1a5282012-05-11 10:12:39 +0000218processor_test_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200219 processor/ProcessorTest.cpp \
220 processor/EventLog.cpp \
221 processor/ServerThread.cpp \
222 processor/EventLog.h \
223 processor/Handlers.h \
224 processor/ServerThread.h
Roger Meier2b1a5282012-05-11 10:12:39 +0000225
226processor_test_LDADD = libprocessortest.la \
227 $(top_builddir)/lib/cpp/libthrift.la \
228 $(top_builddir)/lib/cpp/libthriftnb.la \
229 $(BOOST_LDFLAGS) \
230 -levent \
Roger Meier73b58a22014-05-11 17:39:34 +0200231 -l:libboost_unit_test_framework.a
Alan Dunnbee7b732014-07-26 13:48:43 -0500232
233OpenSSLManualInitTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200234 OpenSSLManualInitTest.cpp
Alan Dunnbee7b732014-07-26 13:48:43 -0500235
236OpenSSLManualInitTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200237 $(top_builddir)/lib/cpp/libthrift.la \
238 -l:libboost_unit_test_framework.a
Alan Dunnbee7b732014-07-26 13:48:43 -0500239
David Reiss351e22b2010-08-31 16:51:19 +0000240#
241# Common thrift code generation rules
242#
243THRIFT = $(top_builddir)/compiler/cpp/thrift
244
245gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200246 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000247
Jens Geyerae0b22c2014-09-04 23:04:21 +0200248gen-cpp/EnumTest_types.cpp gen-cpp/EnumTest_types.h: $(top_srcdir)/test/EnumTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200249 $(THRIFT) --gen cpp $<
Jens Geyerae0b22c2014-09-04 23:04:21 +0200250
Jens Geyer089bcd32014-09-11 22:36:41 +0200251gen-cpp/TypedefTest_types.cpp gen-cpp/TypedefTest_types.h: $(top_srcdir)/test/TypedefTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200252 $(THRIFT) --gen cpp $<
Jens Geyer089bcd32014-09-11 22:36:41 +0200253
David Reiss351e22b2010-08-31 16:51:19 +0000254gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200255 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000256
jfarrelle0e83162014-04-08 22:45:01 -0400257gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h: $(top_srcdir)/test/Recursive.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200258 $(THRIFT) --gen cpp $<
jfarrelle0e83162014-04-08 22:45:01 -0400259
David Reiss351e22b2010-08-31 16:51:19 +0000260gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200261 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000262
263gen-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
Jens Geyer79f988c2014-10-03 20:42:54 +0200264 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000265
Roger Meier2b1a5282012-05-11 10:12:39 +0000266gen-cpp/ChildService.cpp: processor/proc.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200267 $(THRIFT) --gen cpp:templates,cob_style $<
Roger Meier2b1a5282012-05-11 10:12:39 +0000268
Konrad Grochowski1ff4a972014-09-19 23:57:57 +0200269AM_CPPFLAGS = $(BOOST_CPPFLAGS) -I$(top_srcdir)/lib/cpp/src
Roger Meier38315782011-11-06 11:29:41 +0000270AM_LDFLAGS = $(BOOST_LDFLAGS)
Roger Meiercb0754d2014-10-21 21:28:04 +0200271AM_CXXFLAGS = -Wall -Wextra -pedantic
David Reiss351e22b2010-08-31 16:51:19 +0000272
273clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +0200274 $(RM) -r gen-cpp
David Reiss351e22b2010-08-31 16:51:19 +0000275
276EXTRA_DIST = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200277 DenseProtoTest.cpp \
278 ThriftTest_extras.cpp \
279 DebugProtoTest_extras.cpp \
280 concurrency \
281 processor