blob: 4d61e37dd3941b042b2259af8b48ff22f9fd7800 [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 \
33 gen-cpp/TypedefTest_types.cpp \
34 gen-cpp/TypedefTest_types.h \
35 ThriftTest_extras.cpp \
36 DebugProtoTest_extras.cpp
David Reiss351e22b2010-08-31 16:51:19 +000037
Roger Meier2b1a5282012-05-11 10:12:39 +000038nodist_libprocessortest_la_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020039 gen-cpp/ChildService.cpp \
40 gen-cpp/ChildService.h \
41 gen-cpp/ParentService.cpp \
42 gen-cpp/ParentService.h \
43 gen-cpp/proc_types.cpp \
44 gen-cpp/proc_types.h
Roger Meier2b1a5282012-05-11 10:12:39 +000045
David Reiss351e22b2010-08-31 16:51:19 +000046ThriftTest_extras.o: gen-cpp/ThriftTest_types.h
47DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h
48
49libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
50
51noinst_PROGRAMS = Benchmark
52
53Benchmark_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020054 Benchmark.cpp
David Reiss351e22b2010-08-31 16:51:19 +000055
56Benchmark_LDADD = libtestgencpp.la
57
58check_PROGRAMS = \
Jens Geyer79f988c2014-10-03 20:42:54 +020059 TFDTransportTest \
60 TPipedTransportTest \
61 DebugProtoTest \
62 JSONProtoTest \
63 OptionalRequiredTest \
64 RecursiveTest \
65 SpecializationTest \
66 AllProtocolsTest \
67 TransportTest \
68 ZlibTest \
69 TFileTransportTest \
70 UnitTests \
71 link_test \
72 OpenSSLManualInitTest \
73 EnumTest
Roger Meier2d59b9e2012-05-23 19:40:40 +000074# disable these test ... too strong
75# processor_test
Jens Geyer79f988c2014-10-03 20:42:54 +020076# concurrency_test
David Reiss351e22b2010-08-31 16:51:19 +000077
Roger Meier9e0f0742011-08-03 17:36:55 +000078TESTS_ENVIRONMENT= \
Jens Geyer79f988c2014-10-03 20:42:54 +020079 BOOST_TEST_LOG_SINK=tests.xml \
80 BOOST_TEST_LOG_LEVEL=test_suite \
81 BOOST_TEST_LOG_FORMAT=xml
Roger Meier9e0f0742011-08-03 17:36:55 +000082
David Reiss351e22b2010-08-31 16:51:19 +000083TESTS = \
Jens Geyer79f988c2014-10-03 20:42:54 +020084 $(check_PROGRAMS)
David Reiss351e22b2010-08-31 16:51:19 +000085
86UnitTests_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +020087 UnitTestMain.cpp \
88 TMemoryBufferTest.cpp \
89 TBufferBaseTest.cpp \
90 Base64Test.cpp \
91 ToStringTest.cpp \
92 TypedefTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000093
94if !WITH_BOOSTTHREADS
95UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +000096 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000097endif
David Reiss351e22b2010-08-31 16:51:19 +000098
Christian Lavoie4f42ef72010-11-04 18:51:42 +000099UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000100 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200101 -l:libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +0000102
David Reiss35dc7692010-10-06 17:10:19 +0000103TransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200104 TransportTest.cpp
David Reiss35dc7692010-10-06 17:10:19 +0000105
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000106TransportTest_LDADD = \
107 libtestgencpp.la \
108 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200109 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000110 -lz
David Reiss35dc7692010-10-06 17:10:19 +0000111
David Reiss9a961e72010-10-06 17:10:23 +0000112ZlibTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200113 ZlibTest.cpp
David Reiss9a961e72010-10-06 17:10:23 +0000114
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000115ZlibTest_LDADD = \
116 libtestgencpp.la \
117 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200118 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000119 -lz
David Reiss9a961e72010-10-06 17:10:23 +0000120
Jens Geyerae0b22c2014-09-04 23:04:21 +0200121EnumTest_SOURCES = \
122 EnumTest.cpp
123
124EnumTest_LDADD = \
125 libtestgencpp.la \
Jens Geyer089bcd32014-09-11 22:36:41 +0200126 -l:libboost_unit_test_framework.a
Jens Geyerae0b22c2014-09-04 23:04:21 +0200127
David Reiss709b69f2010-10-06 17:10:30 +0000128TFileTransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200129 TFileTransportTest.cpp
David Reiss709b69f2010-10-06 17:10:30 +0000130
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000131TFileTransportTest_LDADD = \
132 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200133 -l:libboost_unit_test_framework.a
David Reiss709b69f2010-10-06 17:10:30 +0000134
David Reiss351e22b2010-08-31 16:51:19 +0000135#
136# TFDTransportTest
137#
138TFDTransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200139 TFDTransportTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000140
141TFDTransportTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200142 $(top_builddir)/lib/cpp/libthrift.la
David Reiss351e22b2010-08-31 16:51:19 +0000143
144
145#
146# TPipedTransportTest
147#
148TPipedTransportTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200149 TPipedTransportTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000150
151TPipedTransportTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200152 $(top_builddir)/lib/cpp/libthrift.la
David Reiss351e22b2010-08-31 16:51:19 +0000153
154#
155# AllProtocolsTest
156#
157AllProtocolsTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200158 AllProtocolTests.cpp \
159 AllProtocolTests.tcc \
160 GenericHelpers.h
David Reiss351e22b2010-08-31 16:51:19 +0000161
162AllProtocolsTest_LDADD = libtestgencpp.la
163
164#
165# DebugProtoTest
166#
167DebugProtoTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200168 DebugProtoTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000169
170DebugProtoTest_LDADD = libtestgencpp.la
171
172
173#
174# JSONProtoTest
175#
176JSONProtoTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200177 JSONProtoTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000178
179JSONProtoTest_LDADD = libtestgencpp.la
180
181#
182# OptionalRequiredTest
183#
184OptionalRequiredTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200185 OptionalRequiredTest.cpp
David Reiss351e22b2010-08-31 16:51:19 +0000186
187OptionalRequiredTest_LDADD = libtestgencpp.la
188
David Reisse71115b2010-10-06 17:09:56 +0000189#
jfarrelle0e83162014-04-08 22:45:01 -0400190# OptionalRequiredTest
191#
192RecursiveTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200193 RecursiveTest.cpp
jfarrelle0e83162014-04-08 22:45:01 -0400194
195RecursiveTest_LDADD = libtestgencpp.la
196
197#
David Reisse71115b2010-10-06 17:09:56 +0000198# SpecializationTest
199#
200SpecializationTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200201 SpecializationTest.cpp
David Reisse71115b2010-10-06 17:09:56 +0000202
203SpecializationTest_LDADD = libtestgencpp.la
204
Roger Meier2b1a5282012-05-11 10:12:39 +0000205concurrency_test_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200206 concurrency/Tests.cpp \
207 concurrency/ThreadFactoryTests.h \
208 concurrency/ThreadManagerTests.h \
209 concurrency/TimerManagerTests.h
David Reiss351e22b2010-08-31 16:51:19 +0000210
Roger Meier2b1a5282012-05-11 10:12:39 +0000211concurrency_test_LDADD = \
212 $(top_builddir)/lib/cpp/libthrift.la
213
Roger Meier63fcb7e2014-06-15 21:48:59 +0200214link_test_SOURCES = \
215 link/LinkTest.cpp \
216 link/TemplatedService1.cpp \
217 link/TemplatedService2.cpp
218
Roger Meier2b1a5282012-05-11 10:12:39 +0000219processor_test_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200220 processor/ProcessorTest.cpp \
221 processor/EventLog.cpp \
222 processor/ServerThread.cpp \
223 processor/EventLog.h \
224 processor/Handlers.h \
225 processor/ServerThread.h
Roger Meier2b1a5282012-05-11 10:12:39 +0000226
227processor_test_LDADD = libprocessortest.la \
228 $(top_builddir)/lib/cpp/libthrift.la \
229 $(top_builddir)/lib/cpp/libthriftnb.la \
230 $(BOOST_LDFLAGS) \
231 -levent \
Roger Meier73b58a22014-05-11 17:39:34 +0200232 -l:libboost_unit_test_framework.a
Alan Dunnbee7b732014-07-26 13:48:43 -0500233
234OpenSSLManualInitTest_SOURCES = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200235 OpenSSLManualInitTest.cpp
Alan Dunnbee7b732014-07-26 13:48:43 -0500236
237OpenSSLManualInitTest_LDADD = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200238 $(top_builddir)/lib/cpp/libthrift.la \
239 -l:libboost_unit_test_framework.a
Alan Dunnbee7b732014-07-26 13:48:43 -0500240
David Reiss351e22b2010-08-31 16:51:19 +0000241#
242# Common thrift code generation rules
243#
244THRIFT = $(top_builddir)/compiler/cpp/thrift
245
246gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200247 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000248
Jens Geyerae0b22c2014-09-04 23:04:21 +0200249gen-cpp/EnumTest_types.cpp gen-cpp/EnumTest_types.h: $(top_srcdir)/test/EnumTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200250 $(THRIFT) --gen cpp $<
Jens Geyerae0b22c2014-09-04 23:04:21 +0200251
Jens Geyer089bcd32014-09-11 22:36:41 +0200252gen-cpp/TypedefTest_types.cpp gen-cpp/TypedefTest_types.h: $(top_srcdir)/test/TypedefTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200253 $(THRIFT) --gen cpp $<
Jens Geyer089bcd32014-09-11 22:36:41 +0200254
David Reiss351e22b2010-08-31 16:51:19 +0000255gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200256 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000257
jfarrelle0e83162014-04-08 22:45:01 -0400258gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h: $(top_srcdir)/test/Recursive.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200259 $(THRIFT) --gen cpp $<
jfarrelle0e83162014-04-08 22:45:01 -0400260
David Reiss351e22b2010-08-31 16:51:19 +0000261gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200262 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000263
264gen-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 +0200265 $(THRIFT) --gen cpp:dense $<
David Reiss351e22b2010-08-31 16:51:19 +0000266
Roger Meier2b1a5282012-05-11 10:12:39 +0000267gen-cpp/ChildService.cpp: processor/proc.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200268 $(THRIFT) --gen cpp:templates,cob_style $<
Roger Meier2b1a5282012-05-11 10:12:39 +0000269
Konrad Grochowski1ff4a972014-09-19 23:57:57 +0200270AM_CPPFLAGS = $(BOOST_CPPFLAGS) -I$(top_srcdir)/lib/cpp/src
Roger Meier38315782011-11-06 11:29:41 +0000271AM_LDFLAGS = $(BOOST_LDFLAGS)
Roger Meiercb0754d2014-10-21 21:28:04 +0200272AM_CXXFLAGS = -Wall -Wextra -pedantic
David Reiss351e22b2010-08-31 16:51:19 +0000273
274clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +0200275 $(RM) -r gen-cpp
David Reiss351e22b2010-08-31 16:51:19 +0000276
277EXTRA_DIST = \
Jens Geyer79f988c2014-10-03 20:42:54 +0200278 DenseProtoTest.cpp \
279 ThriftTest_extras.cpp \
280 DebugProtoTest_extras.cpp \
281 concurrency \
282 processor