blob: f7b1c26cd4313eadc396a9577e03be602b847026 [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 \
64 concurrency_test \
65 processor_test
David Reiss351e22b2010-08-31 16:51:19 +000066
Roger Meier9e0f0742011-08-03 17:36:55 +000067TESTS_ENVIRONMENT= \
68 BOOST_TEST_LOG_SINK=tests.xml \
69 BOOST_TEST_LOG_LEVEL=test_suite \
70 BOOST_TEST_LOG_FORMAT=xml
71
David Reiss351e22b2010-08-31 16:51:19 +000072TESTS = \
73 $(check_PROGRAMS)
74
75UnitTests_SOURCES = \
76 UnitTestMain.cpp \
77 TMemoryBufferTest.cpp \
Roger Meier12d70532011-12-14 23:35:28 +000078 TBufferBaseTest.cpp
79
80if !WITH_BOOSTTHREADS
81UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +000082 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000083endif
David Reiss351e22b2010-08-31 16:51:19 +000084
Christian Lavoie4f42ef72010-11-04 18:51:42 +000085UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +000086 libtestgencpp.la \
87 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +000088
David Reiss35dc7692010-10-06 17:10:19 +000089TransportTest_SOURCES = \
90 TransportTest.cpp
91
Christian Lavoie4f42ef72010-11-04 18:51:42 +000092TransportTest_LDADD = \
93 libtestgencpp.la \
94 $(top_builddir)/lib/cpp/libthriftz.la \
95 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a \
96 -lz
David Reiss35dc7692010-10-06 17:10:19 +000097
David Reiss9a961e72010-10-06 17:10:23 +000098ZlibTest_SOURCES = \
99 ZlibTest.cpp
100
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000101ZlibTest_LDADD = \
102 libtestgencpp.la \
103 $(top_builddir)/lib/cpp/libthriftz.la \
104 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a \
105 -lz
David Reiss9a961e72010-10-06 17:10:23 +0000106
David Reiss709b69f2010-10-06 17:10:30 +0000107TFileTransportTest_SOURCES = \
108 TFileTransportTest.cpp
109
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000110TFileTransportTest_LDADD = \
111 libtestgencpp.la \
112 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
David Reiss709b69f2010-10-06 17:10:30 +0000113
David Reiss351e22b2010-08-31 16:51:19 +0000114#
115# TFDTransportTest
116#
117TFDTransportTest_SOURCES = \
118 TFDTransportTest.cpp
119
120TFDTransportTest_LDADD = \
121 $(top_builddir)/lib/cpp/libthrift.la
122
123
124#
125# TPipedTransportTest
126#
127TPipedTransportTest_SOURCES = \
128 TPipedTransportTest.cpp
129
130TPipedTransportTest_LDADD = \
131 $(top_builddir)/lib/cpp/libthrift.la
132
133#
134# AllProtocolsTest
135#
136AllProtocolsTest_SOURCES = \
137 AllProtocolTests.cpp \
138 AllProtocolTests.tcc \
139 GenericHelpers.h
140
141AllProtocolsTest_LDADD = libtestgencpp.la
142
143#
144# DebugProtoTest
145#
146DebugProtoTest_SOURCES = \
147 DebugProtoTest.cpp
148
149DebugProtoTest_LDADD = libtestgencpp.la
150
151
152#
153# JSONProtoTest
154#
155JSONProtoTest_SOURCES = \
156 JSONProtoTest.cpp
157
158JSONProtoTest_LDADD = libtestgencpp.la
159
160#
161# OptionalRequiredTest
162#
163OptionalRequiredTest_SOURCES = \
164 OptionalRequiredTest.cpp
165
166OptionalRequiredTest_LDADD = libtestgencpp.la
167
David Reisse71115b2010-10-06 17:09:56 +0000168#
169# SpecializationTest
170#
171SpecializationTest_SOURCES = \
172 SpecializationTest.cpp
173
174SpecializationTest_LDADD = libtestgencpp.la
175
Roger Meier2b1a5282012-05-11 10:12:39 +0000176concurrency_test_SOURCES = \
177 concurrency/Tests.cpp \
178 concurrency/ThreadFactoryTests.h \
179 concurrency/ThreadManagerTests.h \
180 concurrency/TimerManagerTests.h
David Reiss351e22b2010-08-31 16:51:19 +0000181
Roger Meier2b1a5282012-05-11 10:12:39 +0000182concurrency_test_LDADD = \
183 $(top_builddir)/lib/cpp/libthrift.la
184
185processor_test_SOURCES = \
186 processor/ProcessorTest.cpp \
187 processor/EventLog.cpp \
188 processor/ServerThread.cpp \
189 processor/EventLog.h \
190 processor/Handlers.h \
191 processor/ServerThread.h
192
193processor_test_LDADD = libprocessortest.la \
194 $(top_builddir)/lib/cpp/libthrift.la \
195 $(top_builddir)/lib/cpp/libthriftnb.la \
196 $(BOOST_LDFLAGS) \
197 -levent \
198 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +0000199#
200# Common thrift code generation rules
201#
202THRIFT = $(top_builddir)/compiler/cpp/thrift
203
204gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
205 $(THRIFT) --gen cpp:dense $<
206
207gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
208 $(THRIFT) --gen cpp:dense $<
209
210gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
211 $(THRIFT) --gen cpp:dense $<
212
213gen-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
214 $(THRIFT) --gen cpp:dense $<
215
Roger Meier2b1a5282012-05-11 10:12:39 +0000216gen-cpp/ChildService.cpp: processor/proc.thrift
217 $(THRIFT) --gen cpp:templates,cob_style $<
218
David Reiss351e22b2010-08-31 16:51:19 +0000219INCLUDES = \
220 -I$(top_srcdir)/lib/cpp/src
221
222AM_CPPFLAGS = $(BOOST_CPPFLAGS)
Roger Meier38315782011-11-06 11:29:41 +0000223AM_LDFLAGS = $(BOOST_LDFLAGS)
Jake Farrellea949fb2011-12-13 20:02:33 +0000224AM_CXXFLAGS = -Wall
David Reiss351e22b2010-08-31 16:51:19 +0000225
226clean-local:
227 $(RM) -r gen-cpp
228
229EXTRA_DIST = \
David Reiss351e22b2010-08-31 16:51:19 +0000230 DenseProtoTest.cpp \
231 ThriftTest_extras.cpp \
232 DebugProtoTest_extras.cpp