blob: f2ffa45502d17ba65b8fa92507fafce5e5c9e526 [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 Meier2d59b9e2012-05-23 19:40:40 +000063 UnitTests
64# disable these test ... too strong
65# processor_test
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 Meier4cb8e402012-05-27 18:05:16 +000079 TBufferBaseTest.cpp \
80 Base64Test.cpp
Roger Meier12d70532011-12-14 23:35:28 +000081
82if !WITH_BOOSTTHREADS
83UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +000084 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000085endif
David Reiss351e22b2010-08-31 16:51:19 +000086
Christian Lavoie4f42ef72010-11-04 18:51:42 +000087UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +000088 libtestgencpp.la \
89 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +000090
David Reiss35dc7692010-10-06 17:10:19 +000091TransportTest_SOURCES = \
92 TransportTest.cpp
93
Christian Lavoie4f42ef72010-11-04 18:51:42 +000094TransportTest_LDADD = \
95 libtestgencpp.la \
96 $(top_builddir)/lib/cpp/libthriftz.la \
97 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a \
98 -lz
David Reiss35dc7692010-10-06 17:10:19 +000099
David Reiss9a961e72010-10-06 17:10:23 +0000100ZlibTest_SOURCES = \
101 ZlibTest.cpp
102
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000103ZlibTest_LDADD = \
104 libtestgencpp.la \
105 $(top_builddir)/lib/cpp/libthriftz.la \
106 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a \
107 -lz
David Reiss9a961e72010-10-06 17:10:23 +0000108
David Reiss709b69f2010-10-06 17:10:30 +0000109TFileTransportTest_SOURCES = \
110 TFileTransportTest.cpp
111
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000112TFileTransportTest_LDADD = \
113 libtestgencpp.la \
114 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
David Reiss709b69f2010-10-06 17:10:30 +0000115
David Reiss351e22b2010-08-31 16:51:19 +0000116#
117# TFDTransportTest
118#
119TFDTransportTest_SOURCES = \
120 TFDTransportTest.cpp
121
122TFDTransportTest_LDADD = \
123 $(top_builddir)/lib/cpp/libthrift.la
124
125
126#
127# TPipedTransportTest
128#
129TPipedTransportTest_SOURCES = \
130 TPipedTransportTest.cpp
131
132TPipedTransportTest_LDADD = \
133 $(top_builddir)/lib/cpp/libthrift.la
134
135#
136# AllProtocolsTest
137#
138AllProtocolsTest_SOURCES = \
139 AllProtocolTests.cpp \
140 AllProtocolTests.tcc \
141 GenericHelpers.h
142
143AllProtocolsTest_LDADD = libtestgencpp.la
144
145#
146# DebugProtoTest
147#
148DebugProtoTest_SOURCES = \
149 DebugProtoTest.cpp
150
151DebugProtoTest_LDADD = libtestgencpp.la
152
153
154#
155# JSONProtoTest
156#
157JSONProtoTest_SOURCES = \
158 JSONProtoTest.cpp
159
160JSONProtoTest_LDADD = libtestgencpp.la
161
162#
163# OptionalRequiredTest
164#
165OptionalRequiredTest_SOURCES = \
166 OptionalRequiredTest.cpp
167
168OptionalRequiredTest_LDADD = libtestgencpp.la
169
David Reisse71115b2010-10-06 17:09:56 +0000170#
171# SpecializationTest
172#
173SpecializationTest_SOURCES = \
174 SpecializationTest.cpp
175
176SpecializationTest_LDADD = libtestgencpp.la
177
Roger Meier2b1a5282012-05-11 10:12:39 +0000178concurrency_test_SOURCES = \
179 concurrency/Tests.cpp \
180 concurrency/ThreadFactoryTests.h \
181 concurrency/ThreadManagerTests.h \
182 concurrency/TimerManagerTests.h
David Reiss351e22b2010-08-31 16:51:19 +0000183
Roger Meier2b1a5282012-05-11 10:12:39 +0000184concurrency_test_LDADD = \
185 $(top_builddir)/lib/cpp/libthrift.la
186
187processor_test_SOURCES = \
188 processor/ProcessorTest.cpp \
189 processor/EventLog.cpp \
190 processor/ServerThread.cpp \
191 processor/EventLog.h \
192 processor/Handlers.h \
193 processor/ServerThread.h
194
195processor_test_LDADD = libprocessortest.la \
196 $(top_builddir)/lib/cpp/libthrift.la \
197 $(top_builddir)/lib/cpp/libthriftnb.la \
198 $(BOOST_LDFLAGS) \
199 -levent \
200 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +0000201#
202# Common thrift code generation rules
203#
204THRIFT = $(top_builddir)/compiler/cpp/thrift
205
206gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
207 $(THRIFT) --gen cpp:dense $<
208
209gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
210 $(THRIFT) --gen cpp:dense $<
211
212gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
213 $(THRIFT) --gen cpp:dense $<
214
215gen-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
216 $(THRIFT) --gen cpp:dense $<
217
Roger Meier2b1a5282012-05-11 10:12:39 +0000218gen-cpp/ChildService.cpp: processor/proc.thrift
219 $(THRIFT) --gen cpp:templates,cob_style $<
220
David Reiss351e22b2010-08-31 16:51:19 +0000221INCLUDES = \
222 -I$(top_srcdir)/lib/cpp/src
223
224AM_CPPFLAGS = $(BOOST_CPPFLAGS)
Roger Meier38315782011-11-06 11:29:41 +0000225AM_LDFLAGS = $(BOOST_LDFLAGS)
Jake Farrellea949fb2011-12-13 20:02:33 +0000226AM_CXXFLAGS = -Wall
David Reiss351e22b2010-08-31 16:51:19 +0000227
228clean-local:
229 $(RM) -r gen-cpp
230
231EXTRA_DIST = \
David Reiss351e22b2010-08-31 16:51:19 +0000232 DenseProtoTest.cpp \
233 ThriftTest_extras.cpp \
234 DebugProtoTest_extras.cpp