blob: 399bebd6fe0a8bcd49bc53544976a5199f810b1b [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 Meier81a1f992014-10-22 14:09:43 +020019AUTOMAKE_OPTIONS = subdir-objects serial-tests
20
Roger Meier2b1a5282012-05-11 10:12:39 +000021noinst_LTLIBRARIES = libtestgencpp.la libprocessortest.la
David Reiss351e22b2010-08-31 16:51:19 +000022nodist_libtestgencpp_la_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020023 gen-cpp/DebugProtoTest_types.cpp \
24 gen-cpp/DebugProtoTest_types.h \
25 gen-cpp/EnumTest_types.cpp \
26 gen-cpp/EnumTest_types.h \
27 gen-cpp/OptionalRequiredTest_types.cpp \
28 gen-cpp/OptionalRequiredTest_types.h \
29 gen-cpp/Recursive_types.cpp \
30 gen-cpp/Recursive_types.h \
31 gen-cpp/ThriftTest_types.cpp \
32 gen-cpp/ThriftTest_types.h \
Roger Meiera5bf1a12014-10-22 23:26:01 +020033 gen-cpp/ThriftTest_constants.cpp \
34 gen-cpp/ThriftTest_constants.h \
Jens Geyer79f988c2014-10-03 20:42:54 +020035 gen-cpp/TypedefTest_types.cpp \
36 gen-cpp/TypedefTest_types.h \
37 ThriftTest_extras.cpp \
38 DebugProtoTest_extras.cpp
David Reiss351e22b2010-08-31 16:51:19 +000039
Roger Meier2b1a5282012-05-11 10:12:39 +000040nodist_libprocessortest_la_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020041 gen-cpp/ChildService.cpp \
42 gen-cpp/ChildService.h \
43 gen-cpp/ParentService.cpp \
44 gen-cpp/ParentService.h \
45 gen-cpp/proc_types.cpp \
46 gen-cpp/proc_types.h
Roger Meier2b1a5282012-05-11 10:12:39 +000047
David Reiss351e22b2010-08-31 16:51:19 +000048ThriftTest_extras.o: gen-cpp/ThriftTest_types.h
49DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h
50
51libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
52
Roger Meiera5bf1a12014-10-22 23:26:01 +020053noinst_PROGRAMS = Benchmark \
Roger Meiera5bf1a12014-10-22 23:26:01 +020054 concurrency_test
David Reiss351e22b2010-08-31 16:51:19 +000055
56Benchmark_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020057 Benchmark.cpp
David Reiss351e22b2010-08-31 16:51:19 +000058
59Benchmark_LDADD = libtestgencpp.la
60
61check_PROGRAMS = \
Jens Geyer79f988c2014-10-03 20:42:54 +020062 TFDTransportTest \
63 TPipedTransportTest \
64 DebugProtoTest \
65 JSONProtoTest \
66 OptionalRequiredTest \
67 RecursiveTest \
68 SpecializationTest \
69 AllProtocolsTest \
70 TransportTest \
71 ZlibTest \
72 TFileTransportTest \
73 UnitTests \
74 link_test \
75 OpenSSLManualInitTest \
76 EnumTest
David Reiss351e22b2010-08-31 16:51:19 +000077
Jens Geyer4461a2f2014-12-23 18:22:54 +010078if AMX_HAVE_LIBEVENT
79noinst_PROGRAMS +=
80 processor_test
81check_PROGRAMS += \
82 TNonblockingServerTest
83endif
84
Roger Meier9e0f0742011-08-03 17:36:55 +000085TESTS_ENVIRONMENT= \
Jens Geyer79f988c2014-10-03 20:42:54 +020086 BOOST_TEST_LOG_SINK=tests.xml \
87 BOOST_TEST_LOG_LEVEL=test_suite \
88 BOOST_TEST_LOG_FORMAT=xml
Roger Meier9e0f0742011-08-03 17:36:55 +000089
David Reiss351e22b2010-08-31 16:51:19 +000090TESTS = \
Jens Geyer79f988c2014-10-03 20:42:54 +020091 $(check_PROGRAMS)
David Reiss351e22b2010-08-31 16:51:19 +000092
93UnitTests_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020094 UnitTestMain.cpp \
95 TMemoryBufferTest.cpp \
96 TBufferBaseTest.cpp \
97 Base64Test.cpp \
98 ToStringTest.cpp \
99 TypedefTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +0000100
101if !WITH_BOOSTTHREADS
102UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +0000103 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +0000104endif
David Reiss351e22b2010-08-31 16:51:19 +0000105
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000106UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000107 libtestgencpp.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100108 $(BOOST_TEST_LDADD)
David Reiss351e22b2010-08-31 16:51:19 +0000109
David Reiss35dc7692010-10-06 17:10:19 +0000110TransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200111 TransportTest.cpp
David Reiss35dc7692010-10-06 17:10:19 +0000112
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000113TransportTest_LDADD = \
114 libtestgencpp.la \
115 $(top_builddir)/lib/cpp/libthriftz.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100116 $(BOOST_TEST_LDADD) \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000117 -lz
David Reiss35dc7692010-10-06 17:10:19 +0000118
David Reiss9a961e72010-10-06 17:10:23 +0000119ZlibTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200120 ZlibTest.cpp
David Reiss9a961e72010-10-06 17:10:23 +0000121
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000122ZlibTest_LDADD = \
123 libtestgencpp.la \
124 $(top_builddir)/lib/cpp/libthriftz.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100125 $(BOOST_TEST_LDADD) \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000126 -lz
David Reiss9a961e72010-10-06 17:10:23 +0000127
Jens Geyerae0b22c2014-09-04 23:04:21 +0200128EnumTest_SOURCES = \
129 EnumTest.cpp
130
131EnumTest_LDADD = \
132 libtestgencpp.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100133 $(BOOST_TEST_LDADD)
Jens Geyerae0b22c2014-09-04 23:04:21 +0200134
David Reiss709b69f2010-10-06 17:10:30 +0000135TFileTransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200136 TFileTransportTest.cpp
David Reiss709b69f2010-10-06 17:10:30 +0000137
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000138TFileTransportTest_LDADD = \
139 libtestgencpp.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100140 $(BOOST_TEST_LDADD)
David Reiss709b69f2010-10-06 17:10:30 +0000141
David Reiss351e22b2010-08-31 16:51:19 +0000142#
143# TFDTransportTest
144#
145TFDTransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200146 TFDTransportTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000147
148TFDTransportTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200149 $(top_builddir)/lib/cpp/libthrift.la
David Reiss351e22b2010-08-31 16:51:19 +0000150
151
152#
153# TPipedTransportTest
154#
155TPipedTransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200156 TPipedTransportTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000157
158TPipedTransportTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200159 $(top_builddir)/lib/cpp/libthrift.la
David Reiss351e22b2010-08-31 16:51:19 +0000160
161#
162# AllProtocolsTest
163#
164AllProtocolsTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200165 AllProtocolTests.cpp \
166 AllProtocolTests.tcc \
167 GenericHelpers.h
David Reiss351e22b2010-08-31 16:51:19 +0000168
169AllProtocolsTest_LDADD = libtestgencpp.la
170
171#
172# DebugProtoTest
173#
174DebugProtoTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200175 DebugProtoTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000176
177DebugProtoTest_LDADD = libtestgencpp.la
178
179
180#
181# JSONProtoTest
182#
183JSONProtoTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200184 JSONProtoTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000185
186JSONProtoTest_LDADD = libtestgencpp.la
187
188#
Nobuaki Sukegawad0d7a652014-12-07 21:36:51 +0900189# TNonblockingServerTest
190#
191TNonblockingServerTest_SOURCES = TNonblockingServerTest.cpp
192
193TNonblockingServerTest_LDADD = libprocessortest.la \
194 $(top_builddir)/lib/cpp/libthrift.la \
195 $(top_builddir)/lib/cpp/libthriftnb.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100196 $(BOOST_TEST_LDADD) \
Nobuaki Sukegawad0d7a652014-12-07 21:36:51 +0900197 $(BOOST_LDFLAGS) \
Jens Geyer4461a2f2014-12-23 18:22:54 +0100198 $(LIBEVENT_LIBS)
Nobuaki Sukegawad0d7a652014-12-07 21:36:51 +0900199
200#
David Reiss351e22b2010-08-31 16:51:19 +0000201# OptionalRequiredTest
202#
203OptionalRequiredTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200204 OptionalRequiredTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000205
206OptionalRequiredTest_LDADD = libtestgencpp.la
207
David Reisse71115b2010-10-06 17:09:56 +0000208#
jfarrelle0e83162014-04-08 22:45:01 -0400209# OptionalRequiredTest
210#
211RecursiveTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200212 RecursiveTest.cpp
jfarrelle0e83162014-04-08 22:45:01 -0400213
214RecursiveTest_LDADD = libtestgencpp.la
215
216#
David Reisse71115b2010-10-06 17:09:56 +0000217# SpecializationTest
218#
219SpecializationTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200220 SpecializationTest.cpp
David Reisse71115b2010-10-06 17:09:56 +0000221
222SpecializationTest_LDADD = libtestgencpp.la
223
Roger Meier2b1a5282012-05-11 10:12:39 +0000224concurrency_test_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200225 concurrency/Tests.cpp \
226 concurrency/ThreadFactoryTests.h \
227 concurrency/ThreadManagerTests.h \
228 concurrency/TimerManagerTests.h
David Reiss351e22b2010-08-31 16:51:19 +0000229
Roger Meier2b1a5282012-05-11 10:12:39 +0000230concurrency_test_LDADD = \
231 $(top_builddir)/lib/cpp/libthrift.la
232
Roger Meier63fcb7e2014-06-15 21:48:59 +0200233link_test_SOURCES = \
234 link/LinkTest.cpp \
235 link/TemplatedService1.cpp \
236 link/TemplatedService2.cpp
237
Roger Meier2b1a5282012-05-11 10:12:39 +0000238processor_test_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200239 processor/ProcessorTest.cpp \
240 processor/EventLog.cpp \
241 processor/ServerThread.cpp \
242 processor/EventLog.h \
243 processor/Handlers.h \
244 processor/ServerThread.h
Roger Meier2b1a5282012-05-11 10:12:39 +0000245
246processor_test_LDADD = libprocessortest.la \
247 $(top_builddir)/lib/cpp/libthrift.la \
248 $(top_builddir)/lib/cpp/libthriftnb.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100249 $(BOOST_TEST_LDADD) \
Roger Meier2b1a5282012-05-11 10:12:39 +0000250 $(BOOST_LDFLAGS) \
Jens Geyer4461a2f2014-12-23 18:22:54 +0100251 $(LIBEVENT_LIBS)
Alan Dunnbee7b732014-07-26 13:48:43 -0500252
253OpenSSLManualInitTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200254 OpenSSLManualInitTest.cpp
Alan Dunnbee7b732014-07-26 13:48:43 -0500255
256OpenSSLManualInitTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200257 $(top_builddir)/lib/cpp/libthrift.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100258 $(BOOST_TEST_LDADD)
Alan Dunnbee7b732014-07-26 13:48:43 -0500259
David Reiss351e22b2010-08-31 16:51:19 +0000260#
261# Common thrift code generation rules
262#
263THRIFT = $(top_builddir)/compiler/cpp/thrift
264
265gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200266 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000267
Jens Geyerae0b22c2014-09-04 23:04:21 +0200268gen-cpp/EnumTest_types.cpp gen-cpp/EnumTest_types.h: $(top_srcdir)/test/EnumTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200269 $(THRIFT) --gen cpp $<
Jens Geyerae0b22c2014-09-04 23:04:21 +0200270
Jens Geyer089bcd32014-09-11 22:36:41 +0200271gen-cpp/TypedefTest_types.cpp gen-cpp/TypedefTest_types.h: $(top_srcdir)/test/TypedefTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200272 $(THRIFT) --gen cpp $<
Jens Geyer089bcd32014-09-11 22:36:41 +0200273
David Reiss351e22b2010-08-31 16:51:19 +0000274gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200275 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000276
jfarrelle0e83162014-04-08 22:45:01 -0400277gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h: $(top_srcdir)/test/Recursive.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200278 $(THRIFT) --gen cpp $<
jfarrelle0e83162014-04-08 22:45:01 -0400279
David Reiss351e22b2010-08-31 16:51:19 +0000280gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200281 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000282
283gen-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 +0200284 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000285
Roger Meier6f28c042014-11-01 20:31:44 +0100286gen-cpp/ChildService.cpp gen-cpp/ChildService.h gen-cpp/ParentService.cpp gen-cpp/ParentService.h gen-cpp/proc_types.cpp gen-cpp/proc_types.h: processor/proc.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200287 $(THRIFT) --gen cpp:templates,cob_style $<
Roger Meier2b1a5282012-05-11 10:12:39 +0000288
Konrad Grochowski1ff4a972014-09-19 23:57:57 +0200289AM_CPPFLAGS = $(BOOST_CPPFLAGS) -I$(top_srcdir)/lib/cpp/src
Roger Meier38315782011-11-06 11:29:41 +0000290AM_LDFLAGS = $(BOOST_LDFLAGS)
Roger Meiercb0754d2014-10-21 21:28:04 +0200291AM_CXXFLAGS = -Wall -Wextra -pedantic
David Reiss351e22b2010-08-31 16:51:19 +0000292
293clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +0200294 $(RM) -r gen-cpp
David Reiss351e22b2010-08-31 16:51:19 +0000295
296EXTRA_DIST = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200297 DenseProtoTest.cpp \
298 ThriftTest_extras.cpp \
299 DebugProtoTest_extras.cpp \
300 concurrency \
301 processor