blob: 44364f9d97ccbc3e91c0b19bb4b91b8e796883ca [file] [log] [blame]
Jake Farrellb95b0ff2012-03-22 21:49:10 +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
jfarrell8fd8c632014-07-10 09:14:51 -040020AUTOMAKE_OPTIONS = serial-tests
Jake Farrellb95b0ff2012-03-22 21:49:10 +000021
22# Thrift compiler rules
23
Jake Farrellb95b0ff2012-03-22 21:49:10 +000024debug_proto_gen = $(addprefix gen-d/, DebugProtoTest_types.d)
25
Jens Geyerf066d842022-06-13 23:37:25 +020026$(debug_proto_gen): $(top_srcdir)/test/v0.16/DebugProtoTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020027 $(THRIFT) --gen d -nowarn $<
Jake Farrellb95b0ff2012-03-22 21:49:10 +000028
29stress_test_gen = $(addprefix gen-d/thrift/test/stress/, Service.d \
Jens Geyer79f988c2014-10-03 20:42:54 +020030 StressTest_types.d)
Jake Farrellb95b0ff2012-03-22 21:49:10 +000031
32$(stress_test_gen): $(top_srcdir)/test/StressTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020033 $(THRIFT) --gen d $<
Jake Farrellb95b0ff2012-03-22 21:49:10 +000034
35thrift_test_gen = $(addprefix gen-d/thrift/test/, SecondService.d \
Jens Geyer79f988c2014-10-03 20:42:54 +020036 ThriftTest.d ThriftTest_constants.d ThriftTest_types.d)
Jake Farrellb95b0ff2012-03-22 21:49:10 +000037
Jens Geyerf066d842022-06-13 23:37:25 +020038$(thrift_test_gen): $(top_srcdir)/test/v0.16/ThriftTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020039 $(THRIFT) --gen d $<
Jake Farrellb95b0ff2012-03-22 21:49:10 +000040
41
42# The actual test targets.
43# There just must be some way to reassign a variable without warnings in
44# Automake...
45targets__ = async_test client_pool_test serialization_benchmark \
Jens Geyer79f988c2014-10-03 20:42:54 +020046 stress_test_server thrift_test_client thrift_test_server transport_test
Jake Farrellb95b0ff2012-03-22 21:49:10 +000047ran_tests__ = client_pool_test \
Jens Geyer79f988c2014-10-03 20:42:54 +020048 transport_test \
49 async_test_runner.sh \
50 thrift_test_runner.sh
Jake Farrellb95b0ff2012-03-22 21:49:10 +000051
52libevent_dependent_targets = async_test_client client_pool_test \
Jens Geyer79f988c2014-10-03 20:42:54 +020053 stress_test_server thrift_test_server
Roger Meier38391a72014-01-12 19:58:54 +010054libevent_dependent_ran_tests = client_pool_test async_test_runner.sh thrift_test_runner.sh
Jake Farrellb95b0ff2012-03-22 21:49:10 +000055
56openssl_dependent_targets = async_test thrift_test_client thrift_test_server
57openssl_dependent_ran_tests = async_test_runner.sh thrift_test_runner.sh
58
59d_test_flags =
60
61if WITH_D_EVENT_TESTS
62d_test_flags += $(DMD_LIBEVENT_FLAGS) ../$(D_EVENT_LIB_NAME)
63targets_ = $(targets__)
64ran_tests_ = $(ran_tests__)
65else
66targets_ = $(filter-out $(libevent_dependent_targets), $(targets__))
67ran_tests_ = $(filter-out $(libevent_dependent_ran_tests), $(ran_tests__))
68endif
69
70if WITH_D_SSL_TESTS
71d_test_flags += $(DMD_OPENSSL_FLAGS) ../$(D_SSL_LIB_NAME)
Nobuaki Sukegawa8b791b22016-03-05 13:40:25 +090072targets = $(targets_)
Jake Farrellb95b0ff2012-03-22 21:49:10 +000073ran_tests = $(ran_tests_)
74else
75targets = $(filter-out $(openssl_dependent_targets), $(targets_))
76ran_tests = $(filter-out $(openssl_dependent_ran_tests), $(ran_tests_))
77endif
78
79d_test_flags += -w -wi -O -release -inline -I$(top_srcdir)/lib/d/src -Igen-d \
Jens Geyer79f988c2014-10-03 20:42:54 +020080 $(top_builddir)/lib/d/$(D_LIB_NAME)
Jake Farrellb95b0ff2012-03-22 21:49:10 +000081
82
83async_test client_pool_test transport_test: %: %.d
Jens Geyer79f988c2014-10-03 20:42:54 +020084 $(DMD) $(d_test_flags) -of$@ $^
Jake Farrellb95b0ff2012-03-22 21:49:10 +000085
86serialization_benchmark: %: %.d $(debug_proto_gen)
Jens Geyer79f988c2014-10-03 20:42:54 +020087 $(DMD) $(d_test_flags) -of$@ $^
Jake Farrellb95b0ff2012-03-22 21:49:10 +000088
89stress_test_server: %: %.d test_utils.d $(stress_test_gen)
Jens Geyer79f988c2014-10-03 20:42:54 +020090 $(DMD) $(d_test_flags) -of$@ $^
Jake Farrellb95b0ff2012-03-22 21:49:10 +000091
92thrift_test_client: %: %.d thrift_test_common.d $(thrift_test_gen)
Jens Geyer79f988c2014-10-03 20:42:54 +020093 $(DMD) $(d_test_flags) -of$@ $^
Jake Farrellb95b0ff2012-03-22 21:49:10 +000094
95thrift_test_server: %: %.d thrift_test_common.d test_utils.d $(thrift_test_gen)
Jens Geyer79f988c2014-10-03 20:42:54 +020096 $(DMD) $(d_test_flags) -of$@ $^
Jake Farrellb95b0ff2012-03-22 21:49:10 +000097
98
Jake Farrellb95b0ff2012-03-22 21:49:10 +000099check-local: $(targets)
100
101clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +0200102 $(RM) -rf gen-d $(targets) $(addsuffix .o, $(targets))
Jake Farrellb95b0ff2012-03-22 21:49:10 +0000103
104
105# Tests ran as part of make check.
106
James E. King III93ff9b02019-06-21 17:50:34 -0400107async_test_runner.sh: async_test
108thrift_test_runner.sh: thrift_test_client thrift_test_server
Jake Farrellb95b0ff2012-03-22 21:49:10 +0000109
110TESTS = $(ran_tests)
Nobuaki Sukegawa8b791b22016-03-05 13:40:25 +0900111
112precross: $(targets)