blob: 7850a168931a228b47a06a641efd133fb2612840 [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 Meier2d59b9e2012-05-23 19:40:40 +000066 UnitTests
67# disable these test ... too strong
68# processor_test
Roger Meierdd16f052012-05-11 14:19:48 +000069# concurrency_test
David Reiss351e22b2010-08-31 16:51:19 +000070
Roger Meier9e0f0742011-08-03 17:36:55 +000071TESTS_ENVIRONMENT= \
72 BOOST_TEST_LOG_SINK=tests.xml \
73 BOOST_TEST_LOG_LEVEL=test_suite \
74 BOOST_TEST_LOG_FORMAT=xml
75
David Reiss351e22b2010-08-31 16:51:19 +000076TESTS = \
77 $(check_PROGRAMS)
78
79UnitTests_SOURCES = \
80 UnitTestMain.cpp \
81 TMemoryBufferTest.cpp \
Roger Meier4cb8e402012-05-27 18:05:16 +000082 TBufferBaseTest.cpp \
83 Base64Test.cpp
Roger Meier12d70532011-12-14 23:35:28 +000084
85if !WITH_BOOSTTHREADS
86UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +000087 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000088endif
David Reiss351e22b2010-08-31 16:51:19 +000089
Christian Lavoie4f42ef72010-11-04 18:51:42 +000090UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +000091 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +020092 -l:libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +000093
David Reiss35dc7692010-10-06 17:10:19 +000094TransportTest_SOURCES = \
95 TransportTest.cpp
96
Christian Lavoie4f42ef72010-11-04 18:51:42 +000097TransportTest_LDADD = \
98 libtestgencpp.la \
99 $(top_builddir)/lib/cpp/libthriftz.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200100 -l:libboost_unit_test_framework.a \
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000101 -lz
David Reiss35dc7692010-10-06 17:10:19 +0000102
David Reiss9a961e72010-10-06 17:10:23 +0000103ZlibTest_SOURCES = \
104 ZlibTest.cpp
105
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000106ZlibTest_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 Reiss9a961e72010-10-06 17:10:23 +0000111
David Reiss709b69f2010-10-06 17:10:30 +0000112TFileTransportTest_SOURCES = \
113 TFileTransportTest.cpp
114
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000115TFileTransportTest_LDADD = \
116 libtestgencpp.la \
Roger Meier73b58a22014-05-11 17:39:34 +0200117 -l:libboost_unit_test_framework.a
David Reiss709b69f2010-10-06 17:10:30 +0000118
David Reiss351e22b2010-08-31 16:51:19 +0000119#
120# TFDTransportTest
121#
122TFDTransportTest_SOURCES = \
123 TFDTransportTest.cpp
124
125TFDTransportTest_LDADD = \
126 $(top_builddir)/lib/cpp/libthrift.la
127
128
129#
130# TPipedTransportTest
131#
132TPipedTransportTest_SOURCES = \
133 TPipedTransportTest.cpp
134
135TPipedTransportTest_LDADD = \
136 $(top_builddir)/lib/cpp/libthrift.la
137
138#
139# AllProtocolsTest
140#
141AllProtocolsTest_SOURCES = \
142 AllProtocolTests.cpp \
143 AllProtocolTests.tcc \
144 GenericHelpers.h
145
146AllProtocolsTest_LDADD = libtestgencpp.la
147
148#
149# DebugProtoTest
150#
151DebugProtoTest_SOURCES = \
152 DebugProtoTest.cpp
153
154DebugProtoTest_LDADD = libtestgencpp.la
155
156
157#
158# JSONProtoTest
159#
160JSONProtoTest_SOURCES = \
161 JSONProtoTest.cpp
162
163JSONProtoTest_LDADD = libtestgencpp.la
164
165#
166# OptionalRequiredTest
167#
168OptionalRequiredTest_SOURCES = \
169 OptionalRequiredTest.cpp
170
171OptionalRequiredTest_LDADD = libtestgencpp.la
172
David Reisse71115b2010-10-06 17:09:56 +0000173#
jfarrelle0e83162014-04-08 22:45:01 -0400174# OptionalRequiredTest
175#
176RecursiveTest_SOURCES = \
177 RecursiveTest.cpp
178
179RecursiveTest_LDADD = libtestgencpp.la
180
181#
David Reisse71115b2010-10-06 17:09:56 +0000182# SpecializationTest
183#
184SpecializationTest_SOURCES = \
185 SpecializationTest.cpp
186
187SpecializationTest_LDADD = libtestgencpp.la
188
Roger Meier2b1a5282012-05-11 10:12:39 +0000189concurrency_test_SOURCES = \
190 concurrency/Tests.cpp \
191 concurrency/ThreadFactoryTests.h \
192 concurrency/ThreadManagerTests.h \
193 concurrency/TimerManagerTests.h
David Reiss351e22b2010-08-31 16:51:19 +0000194
Roger Meier2b1a5282012-05-11 10:12:39 +0000195concurrency_test_LDADD = \
196 $(top_builddir)/lib/cpp/libthrift.la
197
198processor_test_SOURCES = \
199 processor/ProcessorTest.cpp \
200 processor/EventLog.cpp \
201 processor/ServerThread.cpp \
202 processor/EventLog.h \
203 processor/Handlers.h \
204 processor/ServerThread.h
205
206processor_test_LDADD = libprocessortest.la \
207 $(top_builddir)/lib/cpp/libthrift.la \
208 $(top_builddir)/lib/cpp/libthriftnb.la \
209 $(BOOST_LDFLAGS) \
210 -levent \
Roger Meier73b58a22014-05-11 17:39:34 +0200211 -l:libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +0000212#
213# Common thrift code generation rules
214#
215THRIFT = $(top_builddir)/compiler/cpp/thrift
216
217gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
218 $(THRIFT) --gen cpp:dense $<
219
220gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
221 $(THRIFT) --gen cpp:dense $<
222
jfarrelle0e83162014-04-08 22:45:01 -0400223gen-cpp/Recursive_types.cpp gen-cpp/Recursive_types.h: $(top_srcdir)/test/Recursive.thrift
224 $(THRIFT) --gen cpp $<
225
David Reiss351e22b2010-08-31 16:51:19 +0000226gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
227 $(THRIFT) --gen cpp:dense $<
228
229gen-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
230 $(THRIFT) --gen cpp:dense $<
231
Roger Meier2b1a5282012-05-11 10:12:39 +0000232gen-cpp/ChildService.cpp: processor/proc.thrift
233 $(THRIFT) --gen cpp:templates,cob_style $<
234
David Reiss351e22b2010-08-31 16:51:19 +0000235INCLUDES = \
236 -I$(top_srcdir)/lib/cpp/src
237
238AM_CPPFLAGS = $(BOOST_CPPFLAGS)
Roger Meier38315782011-11-06 11:29:41 +0000239AM_LDFLAGS = $(BOOST_LDFLAGS)
Jake Farrellea949fb2011-12-13 20:02:33 +0000240AM_CXXFLAGS = -Wall
David Reiss351e22b2010-08-31 16:51:19 +0000241
242clean-local:
243 $(RM) -r gen-cpp
244
245EXTRA_DIST = \
David Reiss351e22b2010-08-31 16:51:19 +0000246 DenseProtoTest.cpp \
247 ThriftTest_extras.cpp \
Jake Farrell7c7a5e02012-10-11 00:29:11 +0000248 DebugProtoTest_extras.cpp \
249 concurrency \
250 processor