blob: c255a8e485b0f2a7a3993ab05c0cee9092dd503f [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 \
65 ForwardTypedef.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020066 mkdir -p gopath/src
67 grep -v list.*map.*list.*map $(THRIFTTEST) | grep -v 'set<Insanity>' > ThriftTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020068 $(THRIFT) $(THRIFTARGS) -r IncludesTest.thrift
69 $(THRIFT) $(THRIFTARGS) BinaryKeyTest.thrift
70 $(THRIFT) $(THRIFTARGS) MultiplexedProtocolTest.thrift
71 $(THRIFT) $(THRIFTARGS) OnewayTest.thrift
72 $(THRIFT) $(THRIFTARGS) OptionalFieldsTest.thrift
Craig Wickesser5c1ecb62018-10-16 02:40:13 -040073 $(THRIFT) $(THRIFTARGS) RequiredFieldTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020074 $(THRIFT) $(THRIFTARGS) ServicesTest.thrift
75 $(THRIFT) $(THRIFTARGS) GoTagTest.thrift
76 $(THRIFT) $(THRIFTARGS) TypedefFieldTest.thrift
77 $(THRIFT) $(THRIFTARGS) RefAnnotationFieldsTest.thrift
Jens Geyer0f17e152015-09-15 21:22:42 +020078 $(THRIFT) $(THRIFTARGS) UnionDefaultValueTest.thrift
D. Can Celasun88591e32018-05-17 08:52:11 +020079 $(THRIFT) $(THRIFTARGS) UnionBinaryTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020080 $(THRIFT) $(THRIFTARGS) ErrorTest.thrift
81 $(THRIFT) $(THRIFTARGS) NamesTest.thrift
82 $(THRIFT) $(THRIFTARGS) InitialismsTest.thrift
Jens Geyer70219e12015-05-20 22:00:25 +020083 $(THRIFT) $(THRIFTARGS),read_write_private DontExportRWTest.thrift
Jens Geyer86a51e72015-06-01 20:41:41 +020084 $(THRIFT) $(THRIFTARGS),ignore_initialisms IgnoreInitialismsTest.thrift
John Boilesd9019fc2019-06-28 23:07:10 -070085 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestA.thrift
86 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestB.thrift
87 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestC.thrift
88 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestD.thrift
Yuxuan 'fishy' Wang2c780472021-07-31 13:44:41 -070089 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestE.thrift
90 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestF.thrift
John Boilesd9019fc2019-06-28 23:07:10 -070091 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestSuperThing.thrift
92 $(THRIFT) $(THRIFTARGS) ConflictNamespaceServiceTest.thrift
Duru Can Celasunf4475ff2019-11-20 15:31:35 +000093 $(THRIFT) $(THRIFTARGS) -r DuplicateImportsTest.thrift
wangtieju4aaef752021-02-04 11:26:44 +080094 $(THRIFT) $(THRIFTARGS) EqualsTest.thrift
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -080095 $(THRIFT) $(THRIFTARGS) ConflictArgNamesTest.thrift
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -070096 $(THRIFT) $(THRIFTARGS) -r ConstOptionalField.thrift
Yuxuan 'fishy' Wangdae14372022-05-09 11:05:11 -070097 $(THRIFT) $(THRIFTARGS_SKIP_REMOTE) ProcessorMiddlewareTest.thrift
Yuxuan 'fishy' Wang892b6732022-08-01 12:47:12 -070098 $(THRIFT) $(THRIFTARGS) ClientMiddlewareExceptionTest.thrift
Simon Wangd5927a92021-09-13 19:50:45 +080099 $(THRIFT) $(THRIFTARGS) ValidateTest.thrift
Yuxuan 'fishy' Wangb39370e2022-12-29 15:31:38 -0800100 $(THRIFT) $(THRIFTARGS) ForwardTypedef.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' Wange8353cb2022-10-28 10:29:25 -0700106 $(GO) build $(GOBUILDEXTRA) \
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 \
Simon Wangd5927a92021-09-13 19:50:45 +0800125 ./gopath/src/clientmiddlewareexceptiontest \
Yuxuan 'fishy' Wangb39370e2022-12-29 15:31:38 -0800126 ./gopath/src/validatetest \
127 ./gopath/src/forwardtypedef
Yuxuan 'fishy' Wange8353cb2022-10-28 10:29:25 -0700128 $(GO) test github.com/apache/thrift/lib/go/thrift
129 $(GO) test ./gopath/src/tests ./gopath/src/dontexportrwtest
Jens Geyera7da4882013-07-18 00:33:05 +0200130
131clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +0200132 $(RM) -r gopath ThriftTest.thrift gen-go
Jens Geyera7da4882013-07-18 00:33:05 +0200133
134client: stubs
Yuxuan 'fishy' Wange8353cb2022-10-28 10:29:25 -0700135 $(GO) run TestClient.go
jfarrell32d323e2013-08-15 20:39:58 -0400136
137EXTRA_DIST = \
jfarrellf13e4312015-08-25 00:39:29 -0400138 dontexportrwtest \
Jens Geyer79f988c2014-10-03 20:42:54 +0200139 tests \
Jens Geyer2ef01132021-02-04 22:41:50 +0100140 common \
Jens Geyer79f988c2014-10-03 20:42:54 +0200141 BinaryKeyTest.thrift \
Yuxuan 'fishy' Wang892b6732022-08-01 12:47:12 -0700142 ClientMiddlewareExceptionTest.thrift \
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -0800143 ConflictArgNamesTest.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100144 ConflictNamespaceServiceTest.thrift \
John Boilesd9019fc2019-06-28 23:07:10 -0700145 ConflictNamespaceTestA.thrift \
146 ConflictNamespaceTestB.thrift \
147 ConflictNamespaceTestC.thrift \
148 ConflictNamespaceTestD.thrift \
Jens Geyera10d4012022-02-02 22:57:46 +0100149 ConflictNamespaceTestE.thrift \
150 ConflictNamespaceTestF.thrift \
John Boiles59694a72019-11-09 11:22:26 -0800151 ConflictNamespaceTestSuperThing.thrift \
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -0700152 ConstOptionalField.thrift \
153 ConstOptionalFieldImport.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100154 DontExportRWTest.thrift \
155 DuplicateImportsTest.thrift \
156 ErrorTest.thrift \
157 EqualsTest.thrift \
158 GoTagTest.thrift \
159 IgnoreInitialismsTest.thrift \
160 IncludesTest.thrift \
161 InitialismsTest.thrift \
162 MultiplexedProtocolTest.thrift \
163 NamespacedTest.thrift \
164 NamesTest.thrift \
165 OnewayTest.thrift \
166 OptionalFieldsTest.thrift \
Yuxuan 'fishy' Wang9bee8772022-02-22 18:48:17 -0800167 ProcessorMiddlewareTest.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100168 RefAnnotationFieldsTest.thrift \
169 RequiredFieldTest.thrift \
170 ServicesTest.thrift \
171 TypedefFieldTest.thrift \
172 UnionBinaryTest.thrift \
Simon Wangd5927a92021-09-13 19:50:45 +0800173 UnionDefaultValueTest.thrift \
174 ValidateTest.thrift