blob: 46ff9114dfa58657e2df106339fab17c4a57f98b [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
Nobuaki Sukegawaa0c5ab72015-02-01 00:27:12 +090021BUILT_SOURCES = gen-cpp/DebugProtoTest_types.h \
22 gen-cpp/EnumTest_types.h \
23 gen-cpp/OptionalRequiredTest_types.h \
24 gen-cpp/Recursive_types.h \
25 gen-cpp/ThriftTest_types.h \
26 gen-cpp/TypedefTest_types.h \
27 gen-cpp/ChildService.h \
28 gen-cpp/ParentService.h \
29 gen-cpp/proc_types.h
30
Roger Meier2b1a5282012-05-11 10:12:39 +000031noinst_LTLIBRARIES = libtestgencpp.la libprocessortest.la
David Reiss351e22b2010-08-31 16:51:19 +000032nodist_libtestgencpp_la_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020033 gen-cpp/DebugProtoTest_types.cpp \
34 gen-cpp/DebugProtoTest_types.h \
35 gen-cpp/EnumTest_types.cpp \
36 gen-cpp/EnumTest_types.h \
37 gen-cpp/OptionalRequiredTest_types.cpp \
38 gen-cpp/OptionalRequiredTest_types.h \
39 gen-cpp/Recursive_types.cpp \
40 gen-cpp/Recursive_types.h \
41 gen-cpp/ThriftTest_types.cpp \
42 gen-cpp/ThriftTest_types.h \
Roger Meiera5bf1a12014-10-22 23:26:01 +020043 gen-cpp/ThriftTest_constants.cpp \
44 gen-cpp/ThriftTest_constants.h \
Jens Geyer79f988c2014-10-03 20:42:54 +020045 gen-cpp/TypedefTest_types.cpp \
46 gen-cpp/TypedefTest_types.h \
47 ThriftTest_extras.cpp \
48 DebugProtoTest_extras.cpp
David Reiss351e22b2010-08-31 16:51:19 +000049
Roger Meier2b1a5282012-05-11 10:12:39 +000050nodist_libprocessortest_la_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020051 gen-cpp/ChildService.cpp \
52 gen-cpp/ChildService.h \
53 gen-cpp/ParentService.cpp \
54 gen-cpp/ParentService.h \
55 gen-cpp/proc_types.cpp \
56 gen-cpp/proc_types.h
Roger Meier2b1a5282012-05-11 10:12:39 +000057
David Reiss351e22b2010-08-31 16:51:19 +000058ThriftTest_extras.o: gen-cpp/ThriftTest_types.h
59DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h
60
61libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
62
Roger Meiera5bf1a12014-10-22 23:26:01 +020063noinst_PROGRAMS = Benchmark \
Roger Meiera5bf1a12014-10-22 23:26:01 +020064 concurrency_test
David Reiss351e22b2010-08-31 16:51:19 +000065
66Benchmark_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020067 Benchmark.cpp
David Reiss351e22b2010-08-31 16:51:19 +000068
69Benchmark_LDADD = libtestgencpp.la
70
71check_PROGRAMS = \
Roger Meier01144552015-04-04 16:14:08 +020072 UnitTests \
Jens Geyer79f988c2014-10-03 20:42:54 +020073 TFDTransportTest \
74 TPipedTransportTest \
75 DebugProtoTest \
76 JSONProtoTest \
77 OptionalRequiredTest \
78 RecursiveTest \
79 SpecializationTest \
80 AllProtocolsTest \
81 TransportTest \
82 ZlibTest \
83 TFileTransportTest \
Jens Geyer79f988c2014-10-03 20:42:54 +020084 link_test \
85 OpenSSLManualInitTest \
86 EnumTest
David Reiss351e22b2010-08-31 16:51:19 +000087
Jens Geyer4461a2f2014-12-23 18:22:54 +010088if AMX_HAVE_LIBEVENT
Nobuaki Sukegawa208738a2015-02-01 00:27:22 +090089noinst_PROGRAMS += \
Jens Geyer4461a2f2014-12-23 18:22:54 +010090 processor_test
91check_PROGRAMS += \
92 TNonblockingServerTest
93endif
94
Roger Meier9e0f0742011-08-03 17:36:55 +000095TESTS_ENVIRONMENT= \
Jens Geyer79f988c2014-10-03 20:42:54 +020096 BOOST_TEST_LOG_SINK=tests.xml \
97 BOOST_TEST_LOG_LEVEL=test_suite \
98 BOOST_TEST_LOG_FORMAT=xml
Roger Meier9e0f0742011-08-03 17:36:55 +000099
David Reiss351e22b2010-08-31 16:51:19 +0000100TESTS = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200101 $(check_PROGRAMS)
David Reiss351e22b2010-08-31 16:51:19 +0000102
103UnitTests_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200104 UnitTestMain.cpp \
105 TMemoryBufferTest.cpp \
106 TBufferBaseTest.cpp \
107 Base64Test.cpp \
108 ToStringTest.cpp \
Roger Meier01144552015-04-04 16:14:08 +0200109 TypedefTest.cpp \
110 TServerSocketTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +0000111
112if !WITH_BOOSTTHREADS
113UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +0000114 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +0000115endif
David Reiss351e22b2010-08-31 16:51:19 +0000116
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000117UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000118 libtestgencpp.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100119 $(BOOST_TEST_LDADD)
David Reiss351e22b2010-08-31 16:51:19 +0000120
David Reiss35dc7692010-10-06 17:10:19 +0000121TransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200122 TransportTest.cpp
David Reiss35dc7692010-10-06 17:10:19 +0000123
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000124TransportTest_LDADD = \
125 libtestgencpp.la \
126 $(top_builddir)/lib/cpp/libthriftz.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100127 $(BOOST_TEST_LDADD) \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000128 -lz
David Reiss35dc7692010-10-06 17:10:19 +0000129
David Reiss9a961e72010-10-06 17:10:23 +0000130ZlibTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200131 ZlibTest.cpp
David Reiss9a961e72010-10-06 17:10:23 +0000132
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000133ZlibTest_LDADD = \
134 libtestgencpp.la \
135 $(top_builddir)/lib/cpp/libthriftz.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100136 $(BOOST_TEST_LDADD) \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000137 -lz
David Reiss9a961e72010-10-06 17:10:23 +0000138
Jens Geyerae0b22c2014-09-04 23:04:21 +0200139EnumTest_SOURCES = \
140 EnumTest.cpp
141
142EnumTest_LDADD = \
143 libtestgencpp.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100144 $(BOOST_TEST_LDADD)
Jens Geyerae0b22c2014-09-04 23:04:21 +0200145
David Reiss709b69f2010-10-06 17:10:30 +0000146TFileTransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200147 TFileTransportTest.cpp
David Reiss709b69f2010-10-06 17:10:30 +0000148
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000149TFileTransportTest_LDADD = \
150 libtestgencpp.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100151 $(BOOST_TEST_LDADD)
David Reiss709b69f2010-10-06 17:10:30 +0000152
David Reiss351e22b2010-08-31 16:51:19 +0000153#
154# TFDTransportTest
155#
156TFDTransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200157 TFDTransportTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000158
159TFDTransportTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200160 $(top_builddir)/lib/cpp/libthrift.la
David Reiss351e22b2010-08-31 16:51:19 +0000161
162
163#
164# TPipedTransportTest
165#
166TPipedTransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200167 TPipedTransportTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000168
169TPipedTransportTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200170 $(top_builddir)/lib/cpp/libthrift.la
David Reiss351e22b2010-08-31 16:51:19 +0000171
172#
173# AllProtocolsTest
174#
175AllProtocolsTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200176 AllProtocolTests.cpp \
177 AllProtocolTests.tcc \
178 GenericHelpers.h
David Reiss351e22b2010-08-31 16:51:19 +0000179
180AllProtocolsTest_LDADD = libtestgencpp.la
181
182#
183# DebugProtoTest
184#
185DebugProtoTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200186 DebugProtoTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000187
188DebugProtoTest_LDADD = libtestgencpp.la
189
190
191#
192# JSONProtoTest
193#
194JSONProtoTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200195 JSONProtoTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000196
197JSONProtoTest_LDADD = libtestgencpp.la
198
199#
Nobuaki Sukegawad0d7a652014-12-07 21:36:51 +0900200# TNonblockingServerTest
201#
202TNonblockingServerTest_SOURCES = TNonblockingServerTest.cpp
203
204TNonblockingServerTest_LDADD = libprocessortest.la \
205 $(top_builddir)/lib/cpp/libthrift.la \
206 $(top_builddir)/lib/cpp/libthriftnb.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100207 $(BOOST_TEST_LDADD) \
Nobuaki Sukegawad0d7a652014-12-07 21:36:51 +0900208 $(BOOST_LDFLAGS) \
Jens Geyer4461a2f2014-12-23 18:22:54 +0100209 $(LIBEVENT_LIBS)
Nobuaki Sukegawad0d7a652014-12-07 21:36:51 +0900210
211#
David Reiss351e22b2010-08-31 16:51:19 +0000212# OptionalRequiredTest
213#
214OptionalRequiredTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200215 OptionalRequiredTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000216
217OptionalRequiredTest_LDADD = libtestgencpp.la
218
David Reisse71115b2010-10-06 17:09:56 +0000219#
jfarrelle0e83162014-04-08 22:45:01 -0400220# OptionalRequiredTest
221#
222RecursiveTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200223 RecursiveTest.cpp
jfarrelle0e83162014-04-08 22:45:01 -0400224
225RecursiveTest_LDADD = libtestgencpp.la
226
227#
David Reisse71115b2010-10-06 17:09:56 +0000228# SpecializationTest
229#
230SpecializationTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200231 SpecializationTest.cpp
David Reisse71115b2010-10-06 17:09:56 +0000232
233SpecializationTest_LDADD = libtestgencpp.la
234
Roger Meier2b1a5282012-05-11 10:12:39 +0000235concurrency_test_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200236 concurrency/Tests.cpp \
237 concurrency/ThreadFactoryTests.h \
238 concurrency/ThreadManagerTests.h \
239 concurrency/TimerManagerTests.h
David Reiss351e22b2010-08-31 16:51:19 +0000240
Roger Meier2b1a5282012-05-11 10:12:39 +0000241concurrency_test_LDADD = \
242 $(top_builddir)/lib/cpp/libthrift.la
243
Roger Meier63fcb7e2014-06-15 21:48:59 +0200244link_test_SOURCES = \
245 link/LinkTest.cpp \
246 link/TemplatedService1.cpp \
247 link/TemplatedService2.cpp
248
Roger Meier2b1a5282012-05-11 10:12:39 +0000249processor_test_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200250 processor/ProcessorTest.cpp \
251 processor/EventLog.cpp \
252 processor/ServerThread.cpp \
253 processor/EventLog.h \
254 processor/Handlers.h \
255 processor/ServerThread.h
Roger Meier2b1a5282012-05-11 10:12:39 +0000256
257processor_test_LDADD = libprocessortest.la \
258 $(top_builddir)/lib/cpp/libthrift.la \
259 $(top_builddir)/lib/cpp/libthriftnb.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100260 $(BOOST_TEST_LDADD) \
Roger Meier2b1a5282012-05-11 10:12:39 +0000261 $(BOOST_LDFLAGS) \
Jens Geyer4461a2f2014-12-23 18:22:54 +0100262 $(LIBEVENT_LIBS)
Alan Dunnbee7b732014-07-26 13:48:43 -0500263
264OpenSSLManualInitTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200265 OpenSSLManualInitTest.cpp
Alan Dunnbee7b732014-07-26 13:48:43 -0500266
267OpenSSLManualInitTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200268 $(top_builddir)/lib/cpp/libthrift.la \
Konrad Grochowskiec8d8772014-12-20 12:19:00 +0100269 $(BOOST_TEST_LDADD)
Alan Dunnbee7b732014-07-26 13:48:43 -0500270
David Reiss351e22b2010-08-31 16:51:19 +0000271#
272# Common thrift code generation rules
273#
274THRIFT = $(top_builddir)/compiler/cpp/thrift
275
276gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200277 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000278
Jens Geyerae0b22c2014-09-04 23:04:21 +0200279gen-cpp/EnumTest_types.cpp gen-cpp/EnumTest_types.h: $(top_srcdir)/test/EnumTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200280 $(THRIFT) --gen cpp $<
Jens Geyerae0b22c2014-09-04 23:04:21 +0200281
Jens Geyer089bcd32014-09-11 22:36:41 +0200282gen-cpp/TypedefTest_types.cpp gen-cpp/TypedefTest_types.h: $(top_srcdir)/test/TypedefTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200283 $(THRIFT) --gen cpp $<
Jens Geyer089bcd32014-09-11 22:36:41 +0200284
David Reiss351e22b2010-08-31 16:51:19 +0000285gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200286 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000287
jfarrelle0e83162014-04-08 22:45:01 -0400288gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h: $(top_srcdir)/test/Recursive.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200289 $(THRIFT) --gen cpp $<
jfarrelle0e83162014-04-08 22:45:01 -0400290
David Reiss351e22b2010-08-31 16:51:19 +0000291gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200292 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000293
294gen-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 +0200295 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000296
Roger Meier6f28c042014-11-01 20:31:44 +0100297gen-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 +0200298 $(THRIFT) --gen cpp:templates,cob_style $<
Roger Meier2b1a5282012-05-11 10:12:39 +0000299
Konrad Grochowski1ff4a972014-09-19 23:57:57 +0200300AM_CPPFLAGS = $(BOOST_CPPFLAGS) -I$(top_srcdir)/lib/cpp/src
Roger Meier38315782011-11-06 11:29:41 +0000301AM_LDFLAGS = $(BOOST_LDFLAGS)
Roger Meiercb0754d2014-10-21 21:28:04 +0200302AM_CXXFLAGS = -Wall -Wextra -pedantic
David Reiss351e22b2010-08-31 16:51:19 +0000303
304clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +0200305 $(RM) -r gen-cpp
David Reiss351e22b2010-08-31 16:51:19 +0000306
307EXTRA_DIST = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200308 DenseProtoTest.cpp \
309 ThriftTest_extras.cpp \
310 DebugProtoTest_extras.cpp \
311 concurrency \
312 processor