blob: d938449a17baeb0852c114ca8a740f02ffc7101a [file] [log] [blame]
Jens Geyera7da4882013-07-18 00:33:05 +02001#
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
Yuxuan 'fishy' Wang8045d822022-04-19 14:31:39 -070020if GOVERSION_GE_118
21GOBUILDEXTRA = -buildvcs=false
22else
23GOBUILDEXTRA =
24endif
25
Yuxuan 'fishy' Wangdae14372022-05-09 11:05:11 -070026THRIFT_GO_ARGS_BASE = thrift_import=github.com/apache/thrift/lib/go/thrift,package_prefix=github.com/apache/thrift/lib/go/test/gopath/src/
27
28THRIFTARGS = -out gopath/src/ --gen go:$(THRIFT_GO_ARGS_BASE)$(COMPILER_EXTRAFLAG)
Jens Geyera7da4882013-07-18 00:33:05 +020029THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
30
Yuxuan 'fishy' Wangdae14372022-05-09 11:05:11 -070031THRIFTARGS_SKIP_REMOTE = -out gopath/src/ --gen go:skip_remote,$(THRIFT_GO_ARGS_BASE)$(COMPILER_EXTRAFLAG)
32
Jens Geyera7da4882013-07-18 00:33:05 +020033# Thrift for GO has problems with complex map keys: THRIFT-2063
Roger Meier41ad4342015-03-24 22:30:40 +010034gopath: $(THRIFT) $(THRIFTTEST) \
Jens Geyer79f988c2014-10-03 20:42:54 +020035 IncludesTest.thrift \
36 NamespacedTest.thrift \
37 MultiplexedProtocolTest.thrift \
38 OnewayTest.thrift \
39 OptionalFieldsTest.thrift \
Craig Wickesser5c1ecb62018-10-16 02:40:13 -040040 RequiredFieldTest.thrift \
Jens Geyer79f988c2014-10-03 20:42:54 +020041 ServicesTest.thrift \
42 GoTagTest.thrift \
43 TypedefFieldTest.thrift \
Jens Geyer527b6d92014-11-30 15:07:18 +010044 RefAnnotationFieldsTest.thrift \
Jens Geyer0f17e152015-09-15 21:22:42 +020045 UnionDefaultValueTest.thrift \
D. Can Celasun88591e32018-05-17 08:52:11 +020046 UnionBinaryTest.thrift \
Jens Geyer28c1c192015-03-07 14:18:01 +010047 ErrorTest.thrift \
Jens Geyer1d1bca22015-03-14 16:28:27 +020048 NamesTest.thrift \
Jens Geyer70219e12015-05-20 22:00:25 +020049 InitialismsTest.thrift \
50 DontExportRWTest.thrift \
Jens Geyer86a51e72015-06-01 20:41:41 +020051 dontexportrwtest/compile_test.go \
John Boilesd9019fc2019-06-28 23:07:10 -070052 IgnoreInitialismsTest.thrift \
53 ConflictNamespaceTestA.thrift \
54 ConflictNamespaceTestB.thrift \
55 ConflictNamespaceTestC.thrift \
56 ConflictNamespaceTestD.thrift \
Yuxuan 'fishy' Wang2c780472021-07-31 13:44:41 -070057 ConflictNamespaceTestE.thrift \
58 ConflictNamespaceTestF.thrift \
John Boilesd9019fc2019-06-28 23:07:10 -070059 ConflictNamespaceTestSuperThing.thrift \
Duru Can Celasunf4475ff2019-11-20 15:31:35 +000060 ConflictNamespaceServiceTest.thrift \
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -080061 DuplicateImportsTest.thrift \
62 EqualsTest.thrift \
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -070063 ConflictArgNamesTest.thrift \
64 ConstOptionalFieldImport.thrift \
Yuxuan 'fishy' Wang9bee8772022-02-22 18:48:17 -080065 ConstOptionalField.thrift \
Yuxuan 'fishy' Wang892b6732022-08-01 12:47:12 -070066 ProcessorMiddlewareTest.thrift \
67 ClientMiddlewareExceptionTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020068 mkdir -p gopath/src
69 grep -v list.*map.*list.*map $(THRIFTTEST) | grep -v 'set<Insanity>' > ThriftTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020070 $(THRIFT) $(THRIFTARGS) -r IncludesTest.thrift
71 $(THRIFT) $(THRIFTARGS) BinaryKeyTest.thrift
72 $(THRIFT) $(THRIFTARGS) MultiplexedProtocolTest.thrift
73 $(THRIFT) $(THRIFTARGS) OnewayTest.thrift
74 $(THRIFT) $(THRIFTARGS) OptionalFieldsTest.thrift
Craig Wickesser5c1ecb62018-10-16 02:40:13 -040075 $(THRIFT) $(THRIFTARGS) RequiredFieldTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020076 $(THRIFT) $(THRIFTARGS) ServicesTest.thrift
77 $(THRIFT) $(THRIFTARGS) GoTagTest.thrift
78 $(THRIFT) $(THRIFTARGS) TypedefFieldTest.thrift
79 $(THRIFT) $(THRIFTARGS) RefAnnotationFieldsTest.thrift
Jens Geyer0f17e152015-09-15 21:22:42 +020080 $(THRIFT) $(THRIFTARGS) UnionDefaultValueTest.thrift
D. Can Celasun88591e32018-05-17 08:52:11 +020081 $(THRIFT) $(THRIFTARGS) UnionBinaryTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020082 $(THRIFT) $(THRIFTARGS) ErrorTest.thrift
83 $(THRIFT) $(THRIFTARGS) NamesTest.thrift
84 $(THRIFT) $(THRIFTARGS) InitialismsTest.thrift
Jens Geyer70219e12015-05-20 22:00:25 +020085 $(THRIFT) $(THRIFTARGS),read_write_private DontExportRWTest.thrift
Jens Geyer86a51e72015-06-01 20:41:41 +020086 $(THRIFT) $(THRIFTARGS),ignore_initialisms IgnoreInitialismsTest.thrift
John Boilesd9019fc2019-06-28 23:07:10 -070087 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestA.thrift
88 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestB.thrift
89 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestC.thrift
90 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestD.thrift
Yuxuan 'fishy' Wang2c780472021-07-31 13:44:41 -070091 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestE.thrift
92 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestF.thrift
John Boilesd9019fc2019-06-28 23:07:10 -070093 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestSuperThing.thrift
94 $(THRIFT) $(THRIFTARGS) ConflictNamespaceServiceTest.thrift
Duru Can Celasunf4475ff2019-11-20 15:31:35 +000095 $(THRIFT) $(THRIFTARGS) -r DuplicateImportsTest.thrift
wangtieju4aaef752021-02-04 11:26:44 +080096 $(THRIFT) $(THRIFTARGS) EqualsTest.thrift
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -080097 $(THRIFT) $(THRIFTARGS) ConflictArgNamesTest.thrift
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -070098 $(THRIFT) $(THRIFTARGS) -r ConstOptionalField.thrift
Yuxuan 'fishy' Wangdae14372022-05-09 11:05:11 -070099 $(THRIFT) $(THRIFTARGS_SKIP_REMOTE) ProcessorMiddlewareTest.thrift
Yuxuan 'fishy' Wang892b6732022-08-01 12:47:12 -0700100 $(THRIFT) $(THRIFTARGS) ClientMiddlewareExceptionTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200101 ln -nfs ../../tests gopath/src/tests
Jens Geyer70219e12015-05-20 22:00:25 +0200102 cp -r ./dontexportrwtest gopath/src
Jens Geyer79f988c2014-10-03 20:42:54 +0200103 touch gopath
Jens Geyera7da4882013-07-18 00:33:05 +0200104
105check: gopath
Yuxuan 'fishy' Wang8045d822022-04-19 14:31:39 -0700106 $(GO) build $(GOBUILDEXTRA) -mod=mod \
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700107 ./gopath/src/includestest \
108 ./gopath/src/binarykeytest \
109 ./gopath/src/servicestest \
110 ./gopath/src/typedeffieldtest \
111 ./gopath/src/refannotationfieldstest \
112 ./gopath/src/errortest \
113 ./gopath/src/namestest \
114 ./gopath/src/initialismstest \
115 ./gopath/src/dontexportrwtest \
116 ./gopath/src/ignoreinitialismstest \
117 ./gopath/src/unionbinarytest \
Yuxuan 'fishy' Wang2c780472021-07-31 13:44:41 -0700118 ./gopath/src/conflict/super \
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700119 ./gopath/src/conflict/context/conflict_service-remote \
120 ./gopath/src/servicestest/container_test-remote \
121 ./gopath/src/duplicateimportstest \
122 ./gopath/src/equalstest \
Yuxuan 'fishy' Wang9bee8772022-02-22 18:48:17 -0800123 ./gopath/src/conflictargnamestest \
Yuxuan 'fishy' Wang892b6732022-08-01 12:47:12 -0700124 ./gopath/src/processormiddlewaretest \
125 ./gopath/src/clientmiddlewareexceptiontest
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700126 $(GO) test -mod=mod github.com/apache/thrift/lib/go/thrift
127 $(GO) test -mod=mod ./gopath/src/tests ./gopath/src/dontexportrwtest
Jens Geyera7da4882013-07-18 00:33:05 +0200128
129clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +0200130 $(RM) -r gopath ThriftTest.thrift gen-go
Jens Geyera7da4882013-07-18 00:33:05 +0200131
132client: stubs
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700133 $(GO) run -mod=mod TestClient.go
jfarrell32d323e2013-08-15 20:39:58 -0400134
135EXTRA_DIST = \
jfarrellf13e4312015-08-25 00:39:29 -0400136 dontexportrwtest \
Jens Geyer79f988c2014-10-03 20:42:54 +0200137 tests \
Jens Geyer2ef01132021-02-04 22:41:50 +0100138 common \
Jens Geyer79f988c2014-10-03 20:42:54 +0200139 BinaryKeyTest.thrift \
Yuxuan 'fishy' Wang892b6732022-08-01 12:47:12 -0700140 ClientMiddlewareExceptionTest.thrift \
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -0800141 ConflictArgNamesTest.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100142 ConflictNamespaceServiceTest.thrift \
John Boilesd9019fc2019-06-28 23:07:10 -0700143 ConflictNamespaceTestA.thrift \
144 ConflictNamespaceTestB.thrift \
145 ConflictNamespaceTestC.thrift \
146 ConflictNamespaceTestD.thrift \
Jens Geyera10d4012022-02-02 22:57:46 +0100147 ConflictNamespaceTestE.thrift \
148 ConflictNamespaceTestF.thrift \
John Boiles59694a72019-11-09 11:22:26 -0800149 ConflictNamespaceTestSuperThing.thrift \
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -0700150 ConstOptionalField.thrift \
151 ConstOptionalFieldImport.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100152 DontExportRWTest.thrift \
153 DuplicateImportsTest.thrift \
154 ErrorTest.thrift \
155 EqualsTest.thrift \
156 GoTagTest.thrift \
157 IgnoreInitialismsTest.thrift \
158 IncludesTest.thrift \
159 InitialismsTest.thrift \
160 MultiplexedProtocolTest.thrift \
161 NamespacedTest.thrift \
162 NamesTest.thrift \
163 OnewayTest.thrift \
164 OptionalFieldsTest.thrift \
Yuxuan 'fishy' Wang9bee8772022-02-22 18:48:17 -0800165 ProcessorMiddlewareTest.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100166 RefAnnotationFieldsTest.thrift \
167 RequiredFieldTest.thrift \
168 ServicesTest.thrift \
169 TypedefFieldTest.thrift \
170 UnionBinaryTest.thrift \
171 UnionDefaultValueTest.thrift