blob: dc56963c34b171fddd6d85534275aa9de16d6dae [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 -070020GOBUILDEXTRA = -buildvcs=false
Yuxuan 'fishy' Wang8045d822022-04-19 14:31:39 -070021
Yuxuan 'fishy' Wangdae14372022-05-09 11:05:11 -070022THRIFT_GO_ARGS_BASE = thrift_import=github.com/apache/thrift/lib/go/thrift,package_prefix=github.com/apache/thrift/lib/go/test/gopath/src/
23
24THRIFTARGS = -out gopath/src/ --gen go:$(THRIFT_GO_ARGS_BASE)$(COMPILER_EXTRAFLAG)
Yuxuan 'fishy' Wange8353cb2022-10-28 10:29:25 -070025THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
Jens Geyera7da4882013-07-18 00:33:05 +020026
Yuxuan 'fishy' Wangdae14372022-05-09 11:05:11 -070027THRIFTARGS_SKIP_REMOTE = -out gopath/src/ --gen go:skip_remote,$(THRIFT_GO_ARGS_BASE)$(COMPILER_EXTRAFLAG)
28
Jens Geyera7da4882013-07-18 00:33:05 +020029# Thrift for GO has problems with complex map keys: THRIFT-2063
Roger Meier41ad4342015-03-24 22:30:40 +010030gopath: $(THRIFT) $(THRIFTTEST) \
Jens Geyer79f988c2014-10-03 20:42:54 +020031 IncludesTest.thrift \
32 NamespacedTest.thrift \
33 MultiplexedProtocolTest.thrift \
34 OnewayTest.thrift \
35 OptionalFieldsTest.thrift \
Craig Wickesser5c1ecb62018-10-16 02:40:13 -040036 RequiredFieldTest.thrift \
Jens Geyer79f988c2014-10-03 20:42:54 +020037 ServicesTest.thrift \
38 GoTagTest.thrift \
39 TypedefFieldTest.thrift \
Jens Geyer527b6d92014-11-30 15:07:18 +010040 RefAnnotationFieldsTest.thrift \
Jens Geyer0f17e152015-09-15 21:22:42 +020041 UnionDefaultValueTest.thrift \
D. Can Celasun88591e32018-05-17 08:52:11 +020042 UnionBinaryTest.thrift \
Jens Geyer28c1c192015-03-07 14:18:01 +010043 ErrorTest.thrift \
Jens Geyer1d1bca22015-03-14 16:28:27 +020044 NamesTest.thrift \
Jens Geyer70219e12015-05-20 22:00:25 +020045 InitialismsTest.thrift \
46 DontExportRWTest.thrift \
Jens Geyer86a51e72015-06-01 20:41:41 +020047 dontexportrwtest/compile_test.go \
John Boilesd9019fc2019-06-28 23:07:10 -070048 IgnoreInitialismsTest.thrift \
49 ConflictNamespaceTestA.thrift \
50 ConflictNamespaceTestB.thrift \
51 ConflictNamespaceTestC.thrift \
52 ConflictNamespaceTestD.thrift \
Yuxuan 'fishy' Wang2c780472021-07-31 13:44:41 -070053 ConflictNamespaceTestE.thrift \
54 ConflictNamespaceTestF.thrift \
John Boilesd9019fc2019-06-28 23:07:10 -070055 ConflictNamespaceTestSuperThing.thrift \
Duru Can Celasunf4475ff2019-11-20 15:31:35 +000056 ConflictNamespaceServiceTest.thrift \
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -080057 DuplicateImportsTest.thrift \
58 EqualsTest.thrift \
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -070059 ConflictArgNamesTest.thrift \
60 ConstOptionalFieldImport.thrift \
Yuxuan 'fishy' Wang9bee8772022-02-22 18:48:17 -080061 ConstOptionalField.thrift \
Yuxuan 'fishy' Wang892b6732022-08-01 12:47:12 -070062 ProcessorMiddlewareTest.thrift \
Simon Wangd5927a92021-09-13 19:50:45 +080063 ClientMiddlewareExceptionTest.thrift \
Yuxuan 'fishy' Wangb39370e2022-12-29 15:31:38 -080064 ValidateTest.thrift \
k-waltona9b14632024-03-18 18:26:27 -040065 ForwardType.thrift \
66 StringParseAllocationTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020067 mkdir -p gopath/src
68 grep -v list.*map.*list.*map $(THRIFTTEST) | grep -v 'set<Insanity>' > ThriftTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020069 $(THRIFT) $(THRIFTARGS) -r IncludesTest.thrift
70 $(THRIFT) $(THRIFTARGS) BinaryKeyTest.thrift
71 $(THRIFT) $(THRIFTARGS) MultiplexedProtocolTest.thrift
72 $(THRIFT) $(THRIFTARGS) OnewayTest.thrift
73 $(THRIFT) $(THRIFTARGS) OptionalFieldsTest.thrift
Craig Wickesser5c1ecb62018-10-16 02:40:13 -040074 $(THRIFT) $(THRIFTARGS) RequiredFieldTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020075 $(THRIFT) $(THRIFTARGS) ServicesTest.thrift
76 $(THRIFT) $(THRIFTARGS) GoTagTest.thrift
77 $(THRIFT) $(THRIFTARGS) TypedefFieldTest.thrift
78 $(THRIFT) $(THRIFTARGS) RefAnnotationFieldsTest.thrift
Jens Geyer0f17e152015-09-15 21:22:42 +020079 $(THRIFT) $(THRIFTARGS) UnionDefaultValueTest.thrift
D. Can Celasun88591e32018-05-17 08:52:11 +020080 $(THRIFT) $(THRIFTARGS) UnionBinaryTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020081 $(THRIFT) $(THRIFTARGS) ErrorTest.thrift
82 $(THRIFT) $(THRIFTARGS) NamesTest.thrift
83 $(THRIFT) $(THRIFTARGS) InitialismsTest.thrift
Jens Geyer70219e12015-05-20 22:00:25 +020084 $(THRIFT) $(THRIFTARGS),read_write_private DontExportRWTest.thrift
Jens Geyer86a51e72015-06-01 20:41:41 +020085 $(THRIFT) $(THRIFTARGS),ignore_initialisms IgnoreInitialismsTest.thrift
John Boilesd9019fc2019-06-28 23:07:10 -070086 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestA.thrift
87 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestB.thrift
88 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestC.thrift
89 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestD.thrift
Yuxuan 'fishy' Wang2c780472021-07-31 13:44:41 -070090 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestE.thrift
91 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestF.thrift
John Boilesd9019fc2019-06-28 23:07:10 -070092 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestSuperThing.thrift
93 $(THRIFT) $(THRIFTARGS) ConflictNamespaceServiceTest.thrift
Duru Can Celasunf4475ff2019-11-20 15:31:35 +000094 $(THRIFT) $(THRIFTARGS) -r DuplicateImportsTest.thrift
wangtieju4aaef752021-02-04 11:26:44 +080095 $(THRIFT) $(THRIFTARGS) EqualsTest.thrift
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -080096 $(THRIFT) $(THRIFTARGS) ConflictArgNamesTest.thrift
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -070097 $(THRIFT) $(THRIFTARGS) -r ConstOptionalField.thrift
Yuxuan 'fishy' Wangdae14372022-05-09 11:05:11 -070098 $(THRIFT) $(THRIFTARGS_SKIP_REMOTE) ProcessorMiddlewareTest.thrift
Yuxuan 'fishy' Wang892b6732022-08-01 12:47:12 -070099 $(THRIFT) $(THRIFTARGS) ClientMiddlewareExceptionTest.thrift
Simon Wangd5927a92021-09-13 19:50:45 +0800100 $(THRIFT) $(THRIFTARGS) ValidateTest.thrift
Yuxuan 'fishy' Wangdca42ab2023-02-15 12:19:44 -0800101 $(THRIFT) $(THRIFTARGS) ForwardType.thrift
k-waltona9b14632024-03-18 18:26:27 -0400102 $(THRIFT) $(THRIFTARGS) StringParseAllocationTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +0200103 ln -nfs ../../tests gopath/src/tests
Jens Geyer70219e12015-05-20 22:00:25 +0200104 cp -r ./dontexportrwtest gopath/src
Jens Geyer79f988c2014-10-03 20:42:54 +0200105 touch gopath
Jens Geyera7da4882013-07-18 00:33:05 +0200106
107check: gopath
Yuxuan 'fishy' Wange8353cb2022-10-28 10:29:25 -0700108 $(GO) build $(GOBUILDEXTRA) \
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700109 ./gopath/src/includestest \
110 ./gopath/src/binarykeytest \
111 ./gopath/src/servicestest \
112 ./gopath/src/typedeffieldtest \
113 ./gopath/src/refannotationfieldstest \
114 ./gopath/src/errortest \
115 ./gopath/src/namestest \
116 ./gopath/src/initialismstest \
117 ./gopath/src/dontexportrwtest \
118 ./gopath/src/ignoreinitialismstest \
119 ./gopath/src/unionbinarytest \
Yuxuan 'fishy' Wang2c780472021-07-31 13:44:41 -0700120 ./gopath/src/conflict/super \
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700121 ./gopath/src/conflict/context/conflict_service-remote \
122 ./gopath/src/servicestest/container_test-remote \
123 ./gopath/src/duplicateimportstest \
124 ./gopath/src/equalstest \
Yuxuan 'fishy' Wang9bee8772022-02-22 18:48:17 -0800125 ./gopath/src/conflictargnamestest \
Yuxuan 'fishy' Wang892b6732022-08-01 12:47:12 -0700126 ./gopath/src/processormiddlewaretest \
Simon Wangd5927a92021-09-13 19:50:45 +0800127 ./gopath/src/clientmiddlewareexceptiontest \
Yuxuan 'fishy' Wangb39370e2022-12-29 15:31:38 -0800128 ./gopath/src/validatetest \
Yuxuan 'fishy' Wangdca42ab2023-02-15 12:19:44 -0800129 ./gopath/src/forwardtypetest
Yuxuan 'fishy' Wange8353cb2022-10-28 10:29:25 -0700130 $(GO) test github.com/apache/thrift/lib/go/thrift
131 $(GO) test ./gopath/src/tests ./gopath/src/dontexportrwtest
Jens Geyera7da4882013-07-18 00:33:05 +0200132
133clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +0200134 $(RM) -r gopath ThriftTest.thrift gen-go
Jens Geyera7da4882013-07-18 00:33:05 +0200135
136client: stubs
Yuxuan 'fishy' Wange8353cb2022-10-28 10:29:25 -0700137 $(GO) run TestClient.go
jfarrell32d323e2013-08-15 20:39:58 -0400138
139EXTRA_DIST = \
jfarrellf13e4312015-08-25 00:39:29 -0400140 dontexportrwtest \
Jens Geyer79f988c2014-10-03 20:42:54 +0200141 tests \
Jens Geyer2ef01132021-02-04 22:41:50 +0100142 common \
Jens Geyer79f988c2014-10-03 20:42:54 +0200143 BinaryKeyTest.thrift \
Yuxuan 'fishy' Wang892b6732022-08-01 12:47:12 -0700144 ClientMiddlewareExceptionTest.thrift \
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -0800145 ConflictArgNamesTest.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100146 ConflictNamespaceServiceTest.thrift \
John Boilesd9019fc2019-06-28 23:07:10 -0700147 ConflictNamespaceTestA.thrift \
148 ConflictNamespaceTestB.thrift \
149 ConflictNamespaceTestC.thrift \
150 ConflictNamespaceTestD.thrift \
Jens Geyera10d4012022-02-02 22:57:46 +0100151 ConflictNamespaceTestE.thrift \
152 ConflictNamespaceTestF.thrift \
John Boiles59694a72019-11-09 11:22:26 -0800153 ConflictNamespaceTestSuperThing.thrift \
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -0700154 ConstOptionalField.thrift \
155 ConstOptionalFieldImport.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100156 DontExportRWTest.thrift \
157 DuplicateImportsTest.thrift \
158 ErrorTest.thrift \
159 EqualsTest.thrift \
Yuxuan 'fishy' Wangdca42ab2023-02-15 12:19:44 -0800160 ForwardType.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100161 GoTagTest.thrift \
162 IgnoreInitialismsTest.thrift \
163 IncludesTest.thrift \
164 InitialismsTest.thrift \
165 MultiplexedProtocolTest.thrift \
166 NamespacedTest.thrift \
167 NamesTest.thrift \
168 OnewayTest.thrift \
169 OptionalFieldsTest.thrift \
Yuxuan 'fishy' Wang9bee8772022-02-22 18:48:17 -0800170 ProcessorMiddlewareTest.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100171 RefAnnotationFieldsTest.thrift \
172 RequiredFieldTest.thrift \
173 ServicesTest.thrift \
k-waltona9b14632024-03-18 18:26:27 -0400174 StringParseAllocationTest.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100175 TypedefFieldTest.thrift \
176 UnionBinaryTest.thrift \
Simon Wangd5927a92021-09-13 19:50:45 +0800177 UnionDefaultValueTest.thrift \
178 ValidateTest.thrift