Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 1 | # |
| 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 | |
jfarrell | 8fd8c63 | 2014-07-10 09:14:51 -0400 | [diff] [blame] | 20 | AUTOMAKE_OPTIONS = serial-tests |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 21 | |
Nobuaki Sukegawa | 4d28b60 | 2016-02-28 13:25:54 +0900 | [diff] [blame] | 22 | BUILT_SOURCES = trusted-ca-certificate.pem server-certificate.pem |
| 23 | |
| 24 | |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 25 | # Thrift compiler rules |
| 26 | |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 27 | debug_proto_gen = $(addprefix gen-d/, DebugProtoTest_types.d) |
| 28 | |
| 29 | $(debug_proto_gen): $(top_srcdir)/test/DebugProtoTest.thrift |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 30 | $(THRIFT) --gen d -nowarn $< |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 31 | |
| 32 | stress_test_gen = $(addprefix gen-d/thrift/test/stress/, Service.d \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 33 | StressTest_types.d) |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 34 | |
| 35 | $(stress_test_gen): $(top_srcdir)/test/StressTest.thrift |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 36 | $(THRIFT) --gen d $< |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 37 | |
| 38 | thrift_test_gen = $(addprefix gen-d/thrift/test/, SecondService.d \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 39 | ThriftTest.d ThriftTest_constants.d ThriftTest_types.d) |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 40 | |
| 41 | $(thrift_test_gen): $(top_srcdir)/test/ThriftTest.thrift |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 42 | $(THRIFT) --gen d $< |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 43 | |
| 44 | |
| 45 | # The actual test targets. |
| 46 | # There just must be some way to reassign a variable without warnings in |
| 47 | # Automake... |
| 48 | targets__ = async_test client_pool_test serialization_benchmark \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 49 | stress_test_server thrift_test_client thrift_test_server transport_test |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 50 | ran_tests__ = client_pool_test \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 51 | transport_test \ |
| 52 | async_test_runner.sh \ |
| 53 | thrift_test_runner.sh |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 54 | |
| 55 | libevent_dependent_targets = async_test_client client_pool_test \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 56 | stress_test_server thrift_test_server |
Roger Meier | 38391a7 | 2014-01-12 19:58:54 +0100 | [diff] [blame] | 57 | libevent_dependent_ran_tests = client_pool_test async_test_runner.sh thrift_test_runner.sh |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 58 | |
| 59 | openssl_dependent_targets = async_test thrift_test_client thrift_test_server |
| 60 | openssl_dependent_ran_tests = async_test_runner.sh thrift_test_runner.sh |
| 61 | |
| 62 | d_test_flags = |
| 63 | |
| 64 | if WITH_D_EVENT_TESTS |
| 65 | d_test_flags += $(DMD_LIBEVENT_FLAGS) ../$(D_EVENT_LIB_NAME) |
| 66 | targets_ = $(targets__) |
| 67 | ran_tests_ = $(ran_tests__) |
| 68 | else |
| 69 | targets_ = $(filter-out $(libevent_dependent_targets), $(targets__)) |
| 70 | ran_tests_ = $(filter-out $(libevent_dependent_ran_tests), $(ran_tests__)) |
| 71 | endif |
| 72 | |
| 73 | if WITH_D_SSL_TESTS |
| 74 | d_test_flags += $(DMD_OPENSSL_FLAGS) ../$(D_SSL_LIB_NAME) |
Nobuaki Sukegawa | 8b791b2 | 2016-03-05 13:40:25 +0900 | [diff] [blame] | 75 | targets = $(targets_) |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 76 | ran_tests = $(ran_tests_) |
| 77 | else |
| 78 | targets = $(filter-out $(openssl_dependent_targets), $(targets_)) |
| 79 | ran_tests = $(filter-out $(openssl_dependent_ran_tests), $(ran_tests_)) |
| 80 | endif |
| 81 | |
| 82 | d_test_flags += -w -wi -O -release -inline -I$(top_srcdir)/lib/d/src -Igen-d \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 83 | $(top_builddir)/lib/d/$(D_LIB_NAME) |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 84 | |
| 85 | |
| 86 | async_test client_pool_test transport_test: %: %.d |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 87 | $(DMD) $(d_test_flags) -of$@ $^ |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 88 | |
| 89 | serialization_benchmark: %: %.d $(debug_proto_gen) |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 90 | $(DMD) $(d_test_flags) -of$@ $^ |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 91 | |
| 92 | stress_test_server: %: %.d test_utils.d $(stress_test_gen) |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 93 | $(DMD) $(d_test_flags) -of$@ $^ |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 94 | |
| 95 | thrift_test_client: %: %.d thrift_test_common.d $(thrift_test_gen) |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 96 | $(DMD) $(d_test_flags) -of$@ $^ |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 97 | |
| 98 | thrift_test_server: %: %.d thrift_test_common.d test_utils.d $(thrift_test_gen) |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 99 | $(DMD) $(d_test_flags) -of$@ $^ |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 100 | |
| 101 | |
| 102 | # Certificate generation targets (for the SSL tests). |
| 103 | # Currently, we just assume that the "openssl" tool is on the path, could be |
| 104 | # replaced by a more elaborate mechanism. |
| 105 | |
| 106 | server-certificate.pem: openssl.test.cnf |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 107 | openssl req -new -x509 -nodes -config openssl.test.cnf \ |
| 108 | -out server-certificate.pem |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 109 | |
| 110 | trusted-ca-certificate.pem: server-certificate.pem |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 111 | cat server-certificate.pem > $@ |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 112 | |
| 113 | check-local: $(targets) |
| 114 | |
| 115 | clean-local: |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 116 | $(RM) -rf gen-d $(targets) $(addsuffix .o, $(targets)) |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 117 | |
| 118 | |
| 119 | # Tests ran as part of make check. |
| 120 | |
| 121 | async_test_runner.sh: async_test trusted-ca-certificate.pem server-certificate.pem |
| 122 | thrift_test_runner.sh: thrift_test_client thrift_test_server \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 123 | trusted-ca-certificate.pem server-certificate.pem |
Jake Farrell | b95b0ff | 2012-03-22 21:49:10 +0000 | [diff] [blame] | 124 | |
| 125 | TESTS = $(ran_tests) |
Nobuaki Sukegawa | 8b791b2 | 2016-03-05 13:40:25 +0900 | [diff] [blame] | 126 | |
| 127 | precross: $(targets) |