blob: 4b4f1f4ff15f1b446fef9f95114545296ca516ab [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#
19
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 \
28 gen-cpp/ThriftTest_types.h \
29 ThriftTest_extras.cpp \
30 DebugProtoTest_extras.cpp
31
Roger Meier2b1a5282012-05-11 10:12:39 +000032nodist_libprocessortest_la_SOURCES = \
33 gen-cpp/ChildService.cpp \
34 gen-cpp/ChildService.h \
35 gen-cpp/ParentService.cpp \
36 gen-cpp/ParentService.h \
37 gen-cpp/proc_types.cpp \
38 gen-cpp/proc_types.h
39
David Reiss351e22b2010-08-31 16:51:19 +000040ThriftTest_extras.o: gen-cpp/ThriftTest_types.h
41DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h
42
43libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
44
45noinst_PROGRAMS = Benchmark
46
47Benchmark_SOURCES = \
48 Benchmark.cpp
49
50Benchmark_LDADD = libtestgencpp.la
51
52check_PROGRAMS = \
53 TFDTransportTest \
54 TPipedTransportTest \
55 DebugProtoTest \
56 JSONProtoTest \
57 OptionalRequiredTest \
David Reisse71115b2010-10-06 17:09:56 +000058 SpecializationTest \
David Reiss351e22b2010-08-31 16:51:19 +000059 AllProtocolsTest \
David Reiss35dc7692010-10-06 17:10:19 +000060 TransportTest \
David Reiss9a961e72010-10-06 17:10:23 +000061 ZlibTest \
David Reiss709b69f2010-10-06 17:10:30 +000062 TFileTransportTest \
Roger Meier2b1a5282012-05-11 10:12:39 +000063 UnitTests \
Roger Meierdd16f052012-05-11 14:19:48 +000064 processor_test
Roger Meier4f260f72012-05-11 13:50:11 +000065# disable ... too strong
Roger Meierdd16f052012-05-11 14:19:48 +000066# concurrency_test
David Reiss351e22b2010-08-31 16:51:19 +000067
Roger Meier9e0f0742011-08-03 17:36:55 +000068TESTS_ENVIRONMENT= \
69 BOOST_TEST_LOG_SINK=tests.xml \
70 BOOST_TEST_LOG_LEVEL=test_suite \
71 BOOST_TEST_LOG_FORMAT=xml
72
David Reiss351e22b2010-08-31 16:51:19 +000073TESTS = \
74 $(check_PROGRAMS)
75
76UnitTests_SOURCES = \
77 UnitTestMain.cpp \
78 TMemoryBufferTest.cpp \
Roger Meier12d70532011-12-14 23:35:28 +000079 TBufferBaseTest.cpp
80
81if !WITH_BOOSTTHREADS
82UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +000083 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000084endif
David Reiss351e22b2010-08-31 16:51:19 +000085
Christian Lavoie4f42ef72010-11-04 18:51:42 +000086UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +000087 libtestgencpp.la \
88 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +000089
David Reiss35dc7692010-10-06 17:10:19 +000090TransportTest_SOURCES = \
91 TransportTest.cpp
92
Christian Lavoie4f42ef72010-11-04 18:51:42 +000093TransportTest_LDADD = \
94 libtestgencpp.la \
95 $(top_builddir)/lib/cpp/libthriftz.la \
96 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a \
97 -lz
David Reiss35dc7692010-10-06 17:10:19 +000098
David Reiss9a961e72010-10-06 17:10:23 +000099ZlibTest_SOURCES = \
100 ZlibTest.cpp
101
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000102ZlibTest_LDADD = \
103 libtestgencpp.la \
104 $(top_builddir)/lib/cpp/libthriftz.la \
105 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a \
106 -lz
David Reiss9a961e72010-10-06 17:10:23 +0000107
David Reiss709b69f2010-10-06 17:10:30 +0000108TFileTransportTest_SOURCES = \
109 TFileTransportTest.cpp
110
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000111TFileTransportTest_LDADD = \
112 libtestgencpp.la \
113 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
David Reiss709b69f2010-10-06 17:10:30 +0000114
David Reiss351e22b2010-08-31 16:51:19 +0000115#
116# TFDTransportTest
117#
118TFDTransportTest_SOURCES = \
119 TFDTransportTest.cpp
120
121TFDTransportTest_LDADD = \
122 $(top_builddir)/lib/cpp/libthrift.la
123
124
125#
126# TPipedTransportTest
127#
128TPipedTransportTest_SOURCES = \
129 TPipedTransportTest.cpp
130
131TPipedTransportTest_LDADD = \
132 $(top_builddir)/lib/cpp/libthrift.la
133
134#
135# AllProtocolsTest
136#
137AllProtocolsTest_SOURCES = \
138 AllProtocolTests.cpp \
139 AllProtocolTests.tcc \
140 GenericHelpers.h
141
142AllProtocolsTest_LDADD = libtestgencpp.la
143
144#
145# DebugProtoTest
146#
147DebugProtoTest_SOURCES = \
148 DebugProtoTest.cpp
149
150DebugProtoTest_LDADD = libtestgencpp.la
151
152
153#
154# JSONProtoTest
155#
156JSONProtoTest_SOURCES = \
157 JSONProtoTest.cpp
158
159JSONProtoTest_LDADD = libtestgencpp.la
160
161#
162# OptionalRequiredTest
163#
164OptionalRequiredTest_SOURCES = \
165 OptionalRequiredTest.cpp
166
167OptionalRequiredTest_LDADD = libtestgencpp.la
168
David Reisse71115b2010-10-06 17:09:56 +0000169#
170# SpecializationTest
171#
172SpecializationTest_SOURCES = \
173 SpecializationTest.cpp
174
175SpecializationTest_LDADD = libtestgencpp.la
176
Roger Meier2b1a5282012-05-11 10:12:39 +0000177concurrency_test_SOURCES = \
178 concurrency/Tests.cpp \
179 concurrency/ThreadFactoryTests.h \
180 concurrency/ThreadManagerTests.h \
181 concurrency/TimerManagerTests.h
David Reiss351e22b2010-08-31 16:51:19 +0000182
Roger Meier2b1a5282012-05-11 10:12:39 +0000183concurrency_test_LDADD = \
184 $(top_builddir)/lib/cpp/libthrift.la
185
186processor_test_SOURCES = \
187 processor/ProcessorTest.cpp \
188 processor/EventLog.cpp \
189 processor/ServerThread.cpp \
190 processor/EventLog.h \
191 processor/Handlers.h \
192 processor/ServerThread.h
193
194processor_test_LDADD = libprocessortest.la \
195 $(top_builddir)/lib/cpp/libthrift.la \
196 $(top_builddir)/lib/cpp/libthriftnb.la \
197 $(BOOST_LDFLAGS) \
198 -levent \
199 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +0000200#
201# Common thrift code generation rules
202#
203THRIFT = $(top_builddir)/compiler/cpp/thrift
204
205gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
206 $(THRIFT) --gen cpp:dense $<
207
208gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
209 $(THRIFT) --gen cpp:dense $<
210
211gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
212 $(THRIFT) --gen cpp:dense $<
213
214gen-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
215 $(THRIFT) --gen cpp:dense $<
216
Roger Meier2b1a5282012-05-11 10:12:39 +0000217gen-cpp/ChildService.cpp: processor/proc.thrift
218 $(THRIFT) --gen cpp:templates,cob_style $<
219
David Reiss351e22b2010-08-31 16:51:19 +0000220INCLUDES = \
221 -I$(top_srcdir)/lib/cpp/src
222
223AM_CPPFLAGS = $(BOOST_CPPFLAGS)
Roger Meier38315782011-11-06 11:29:41 +0000224AM_LDFLAGS = $(BOOST_LDFLAGS)
Jake Farrellea949fb2011-12-13 20:02:33 +0000225AM_CXXFLAGS = -Wall
David Reiss351e22b2010-08-31 16:51:19 +0000226
227clean-local:
228 $(RM) -r gen-cpp
229
230EXTRA_DIST = \
David Reiss351e22b2010-08-31 16:51:19 +0000231 DenseProtoTest.cpp \
232 ThriftTest_extras.cpp \
233 DebugProtoTest_extras.cpp