blob: bf419354c7b2a6ff54d3756029bac138fe5fef6d [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
20noinst_LTLIBRARIES = libtestgencpp.la
21nodist_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
32ThriftTest_extras.o: gen-cpp/ThriftTest_types.h
33DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h
34
35libtestgencpp_la_LIBADD = $(top_builddir)/lib/cpp/libthrift.la
36
37noinst_PROGRAMS = Benchmark
38
39Benchmark_SOURCES = \
40 Benchmark.cpp
41
42Benchmark_LDADD = libtestgencpp.la
43
44check_PROGRAMS = \
45 TFDTransportTest \
46 TPipedTransportTest \
47 DebugProtoTest \
48 JSONProtoTest \
49 OptionalRequiredTest \
David Reisse71115b2010-10-06 17:09:56 +000050 SpecializationTest \
David Reiss351e22b2010-08-31 16:51:19 +000051 AllProtocolsTest \
David Reiss35dc7692010-10-06 17:10:19 +000052 TransportTest \
David Reiss9a961e72010-10-06 17:10:23 +000053 ZlibTest \
David Reiss709b69f2010-10-06 17:10:30 +000054 TFileTransportTest \
David Reiss351e22b2010-08-31 16:51:19 +000055 UnitTests
56
Roger Meier9e0f0742011-08-03 17:36:55 +000057TESTS_ENVIRONMENT= \
58 BOOST_TEST_LOG_SINK=tests.xml \
59 BOOST_TEST_LOG_LEVEL=test_suite \
60 BOOST_TEST_LOG_FORMAT=xml
61
David Reiss351e22b2010-08-31 16:51:19 +000062TESTS = \
63 $(check_PROGRAMS)
64
65UnitTests_SOURCES = \
66 UnitTestMain.cpp \
67 TMemoryBufferTest.cpp \
Roger Meier12d70532011-12-14 23:35:28 +000068 TBufferBaseTest.cpp
69
70if !WITH_BOOSTTHREADS
71UnitTests_SOURCES += \
Roger Meier3fc48192011-12-11 21:05:35 +000072 RWMutexStarveTest.cpp
Roger Meier12d70532011-12-14 23:35:28 +000073endif
David Reiss351e22b2010-08-31 16:51:19 +000074
Christian Lavoie4f42ef72010-11-04 18:51:42 +000075UnitTests_LDADD = \
Christian Lavoie4f42ef72010-11-04 18:51:42 +000076 libtestgencpp.la \
77 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
David Reiss351e22b2010-08-31 16:51:19 +000078
David Reiss35dc7692010-10-06 17:10:19 +000079TransportTest_SOURCES = \
80 TransportTest.cpp
81
Christian Lavoie4f42ef72010-11-04 18:51:42 +000082TransportTest_LDADD = \
83 libtestgencpp.la \
84 $(top_builddir)/lib/cpp/libthriftz.la \
85 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a \
86 -lz
David Reiss35dc7692010-10-06 17:10:19 +000087
David Reiss9a961e72010-10-06 17:10:23 +000088ZlibTest_SOURCES = \
89 ZlibTest.cpp
90
Christian Lavoie4f42ef72010-11-04 18:51:42 +000091ZlibTest_LDADD = \
92 libtestgencpp.la \
93 $(top_builddir)/lib/cpp/libthriftz.la \
94 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a \
95 -lz
David Reiss9a961e72010-10-06 17:10:23 +000096
David Reiss709b69f2010-10-06 17:10:30 +000097TFileTransportTest_SOURCES = \
98 TFileTransportTest.cpp
99
Christian Lavoie4f42ef72010-11-04 18:51:42 +0000100TFileTransportTest_LDADD = \
101 libtestgencpp.la \
102 $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
David Reiss709b69f2010-10-06 17:10:30 +0000103
David Reiss351e22b2010-08-31 16:51:19 +0000104#
105# TFDTransportTest
106#
107TFDTransportTest_SOURCES = \
108 TFDTransportTest.cpp
109
110TFDTransportTest_LDADD = \
111 $(top_builddir)/lib/cpp/libthrift.la
112
113
114#
115# TPipedTransportTest
116#
117TPipedTransportTest_SOURCES = \
118 TPipedTransportTest.cpp
119
120TPipedTransportTest_LDADD = \
121 $(top_builddir)/lib/cpp/libthrift.la
122
123#
124# AllProtocolsTest
125#
126AllProtocolsTest_SOURCES = \
127 AllProtocolTests.cpp \
128 AllProtocolTests.tcc \
129 GenericHelpers.h
130
131AllProtocolsTest_LDADD = libtestgencpp.la
132
133#
134# DebugProtoTest
135#
136DebugProtoTest_SOURCES = \
137 DebugProtoTest.cpp
138
139DebugProtoTest_LDADD = libtestgencpp.la
140
141
142#
143# JSONProtoTest
144#
145JSONProtoTest_SOURCES = \
146 JSONProtoTest.cpp
147
148JSONProtoTest_LDADD = libtestgencpp.la
149
150#
151# OptionalRequiredTest
152#
153OptionalRequiredTest_SOURCES = \
154 OptionalRequiredTest.cpp
155
156OptionalRequiredTest_LDADD = libtestgencpp.la
157
David Reisse71115b2010-10-06 17:09:56 +0000158#
159# SpecializationTest
160#
161SpecializationTest_SOURCES = \
162 SpecializationTest.cpp
163
164SpecializationTest_LDADD = libtestgencpp.la
165
David Reiss351e22b2010-08-31 16:51:19 +0000166
167#
168# Common thrift code generation rules
169#
170THRIFT = $(top_builddir)/compiler/cpp/thrift
171
172gen-cpp/DebugProtoTest_types.cpp gen-cpp/DebugProtoTest_types.h: $(top_srcdir)/test/DebugProtoTest.thrift
173 $(THRIFT) --gen cpp:dense $<
174
175gen-cpp/OptionalRequiredTest_types.cpp gen-cpp/OptionalRequiredTest_types.h: $(top_srcdir)/test/OptionalRequiredTest.thrift
176 $(THRIFT) --gen cpp:dense $<
177
178gen-cpp/Service.cpp gen-cpp/StressTest_types.cpp: $(top_srcdir)/test/StressTest.thrift
179 $(THRIFT) --gen cpp:dense $<
180
181gen-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
182 $(THRIFT) --gen cpp:dense $<
183
184INCLUDES = \
185 -I$(top_srcdir)/lib/cpp/src
186
187AM_CPPFLAGS = $(BOOST_CPPFLAGS)
Roger Meier38315782011-11-06 11:29:41 +0000188AM_LDFLAGS = $(BOOST_LDFLAGS)
Jake Farrellea949fb2011-12-13 20:02:33 +0000189AM_CXXFLAGS = -Wall
David Reiss351e22b2010-08-31 16:51:19 +0000190
191clean-local:
192 $(RM) -r gen-cpp
193
194EXTRA_DIST = \
David Reiss351e22b2010-08-31 16:51:19 +0000195 DenseProtoTest.cpp \
196 ThriftTest_extras.cpp \
197 DebugProtoTest_extras.cpp