blob: e1cf8cda7efe03a292b81e1996ed8ee25015744c [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' Wangb71f11e2021-03-22 15:01:00 -070026THRIFTARGS = -out gopath/src/ --gen go:thrift_import=github.com/apache/thrift/lib/go/thrift,package_prefix=github.com/apache/thrift/lib/go/test/gopath/src/$(COMPILER_EXTRAFLAG)
Jens Geyera7da4882013-07-18 00:33:05 +020027THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
28
29# 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 \
62 ProcessorMiddlewareTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020063 mkdir -p gopath/src
64 grep -v list.*map.*list.*map $(THRIFTTEST) | grep -v 'set<Insanity>' > ThriftTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020065 $(THRIFT) $(THRIFTARGS) -r IncludesTest.thrift
66 $(THRIFT) $(THRIFTARGS) BinaryKeyTest.thrift
67 $(THRIFT) $(THRIFTARGS) MultiplexedProtocolTest.thrift
68 $(THRIFT) $(THRIFTARGS) OnewayTest.thrift
69 $(THRIFT) $(THRIFTARGS) OptionalFieldsTest.thrift
Craig Wickesser5c1ecb62018-10-16 02:40:13 -040070 $(THRIFT) $(THRIFTARGS) RequiredFieldTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020071 $(THRIFT) $(THRIFTARGS) ServicesTest.thrift
72 $(THRIFT) $(THRIFTARGS) GoTagTest.thrift
73 $(THRIFT) $(THRIFTARGS) TypedefFieldTest.thrift
74 $(THRIFT) $(THRIFTARGS) RefAnnotationFieldsTest.thrift
Jens Geyer0f17e152015-09-15 21:22:42 +020075 $(THRIFT) $(THRIFTARGS) UnionDefaultValueTest.thrift
D. Can Celasun88591e32018-05-17 08:52:11 +020076 $(THRIFT) $(THRIFTARGS) UnionBinaryTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020077 $(THRIFT) $(THRIFTARGS) ErrorTest.thrift
78 $(THRIFT) $(THRIFTARGS) NamesTest.thrift
79 $(THRIFT) $(THRIFTARGS) InitialismsTest.thrift
Jens Geyer70219e12015-05-20 22:00:25 +020080 $(THRIFT) $(THRIFTARGS),read_write_private DontExportRWTest.thrift
Jens Geyer86a51e72015-06-01 20:41:41 +020081 $(THRIFT) $(THRIFTARGS),ignore_initialisms IgnoreInitialismsTest.thrift
John Boilesd9019fc2019-06-28 23:07:10 -070082 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestA.thrift
83 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestB.thrift
84 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestC.thrift
85 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestD.thrift
Yuxuan 'fishy' Wang2c780472021-07-31 13:44:41 -070086 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestE.thrift
87 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestF.thrift
John Boilesd9019fc2019-06-28 23:07:10 -070088 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestSuperThing.thrift
89 $(THRIFT) $(THRIFTARGS) ConflictNamespaceServiceTest.thrift
Duru Can Celasunf4475ff2019-11-20 15:31:35 +000090 $(THRIFT) $(THRIFTARGS) -r DuplicateImportsTest.thrift
wangtieju4aaef752021-02-04 11:26:44 +080091 $(THRIFT) $(THRIFTARGS) EqualsTest.thrift
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -080092 $(THRIFT) $(THRIFTARGS) ConflictArgNamesTest.thrift
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -070093 $(THRIFT) $(THRIFTARGS) -r ConstOptionalField.thrift
Yuxuan 'fishy' Wang9bee8772022-02-22 18:48:17 -080094 $(THRIFT) $(THRIFTARGS) ProcessorMiddlewareTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020095 ln -nfs ../../tests gopath/src/tests
Jens Geyer70219e12015-05-20 22:00:25 +020096 cp -r ./dontexportrwtest gopath/src
Jens Geyer79f988c2014-10-03 20:42:54 +020097 touch gopath
Jens Geyera7da4882013-07-18 00:33:05 +020098
99check: gopath
Yuxuan 'fishy' Wang8045d822022-04-19 14:31:39 -0700100 $(GO) build $(GOBUILDEXTRA) -mod=mod \
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700101 ./gopath/src/includestest \
102 ./gopath/src/binarykeytest \
103 ./gopath/src/servicestest \
104 ./gopath/src/typedeffieldtest \
105 ./gopath/src/refannotationfieldstest \
106 ./gopath/src/errortest \
107 ./gopath/src/namestest \
108 ./gopath/src/initialismstest \
109 ./gopath/src/dontexportrwtest \
110 ./gopath/src/ignoreinitialismstest \
111 ./gopath/src/unionbinarytest \
Yuxuan 'fishy' Wang2c780472021-07-31 13:44:41 -0700112 ./gopath/src/conflict/super \
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700113 ./gopath/src/conflict/context/conflict_service-remote \
114 ./gopath/src/servicestest/container_test-remote \
115 ./gopath/src/duplicateimportstest \
116 ./gopath/src/equalstest \
Yuxuan 'fishy' Wang9bee8772022-02-22 18:48:17 -0800117 ./gopath/src/conflictargnamestest \
118 ./gopath/src/processormiddlewaretest
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700119 $(GO) test -mod=mod github.com/apache/thrift/lib/go/thrift
120 $(GO) test -mod=mod ./gopath/src/tests ./gopath/src/dontexportrwtest
Jens Geyera7da4882013-07-18 00:33:05 +0200121
122clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +0200123 $(RM) -r gopath ThriftTest.thrift gen-go
Jens Geyera7da4882013-07-18 00:33:05 +0200124
125client: stubs
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700126 $(GO) run -mod=mod TestClient.go
jfarrell32d323e2013-08-15 20:39:58 -0400127
128EXTRA_DIST = \
jfarrellf13e4312015-08-25 00:39:29 -0400129 dontexportrwtest \
Jens Geyer79f988c2014-10-03 20:42:54 +0200130 tests \
Jens Geyer2ef01132021-02-04 22:41:50 +0100131 common \
Jens Geyer79f988c2014-10-03 20:42:54 +0200132 BinaryKeyTest.thrift \
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -0800133 ConflictArgNamesTest.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100134 ConflictNamespaceServiceTest.thrift \
John Boilesd9019fc2019-06-28 23:07:10 -0700135 ConflictNamespaceTestA.thrift \
136 ConflictNamespaceTestB.thrift \
137 ConflictNamespaceTestC.thrift \
138 ConflictNamespaceTestD.thrift \
Jens Geyera10d4012022-02-02 22:57:46 +0100139 ConflictNamespaceTestE.thrift \
140 ConflictNamespaceTestF.thrift \
John Boiles59694a72019-11-09 11:22:26 -0800141 ConflictNamespaceTestSuperThing.thrift \
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -0700142 ConstOptionalField.thrift \
143 ConstOptionalFieldImport.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100144 DontExportRWTest.thrift \
145 DuplicateImportsTest.thrift \
146 ErrorTest.thrift \
147 EqualsTest.thrift \
148 GoTagTest.thrift \
149 IgnoreInitialismsTest.thrift \
150 IncludesTest.thrift \
151 InitialismsTest.thrift \
152 MultiplexedProtocolTest.thrift \
153 NamespacedTest.thrift \
154 NamesTest.thrift \
155 OnewayTest.thrift \
156 OptionalFieldsTest.thrift \
Yuxuan 'fishy' Wang9bee8772022-02-22 18:48:17 -0800157 ProcessorMiddlewareTest.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100158 RefAnnotationFieldsTest.thrift \
159 RequiredFieldTest.thrift \
160 ServicesTest.thrift \
161 TypedefFieldTest.thrift \
162 UnionBinaryTest.thrift \
163 UnionDefaultValueTest.thrift