blob: 9f174bbb3fd6ba6844abdda304a2ffe2b4d1867d [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' Wangb71f11e2021-03-22 15:01:00 -070020THRIFTARGS = -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 +020021THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
22
23# Thrift for GO has problems with complex map keys: THRIFT-2063
Roger Meier41ad4342015-03-24 22:30:40 +010024gopath: $(THRIFT) $(THRIFTTEST) \
Jens Geyer79f988c2014-10-03 20:42:54 +020025 IncludesTest.thrift \
26 NamespacedTest.thrift \
27 MultiplexedProtocolTest.thrift \
28 OnewayTest.thrift \
29 OptionalFieldsTest.thrift \
Craig Wickesser5c1ecb62018-10-16 02:40:13 -040030 RequiredFieldTest.thrift \
Jens Geyer79f988c2014-10-03 20:42:54 +020031 ServicesTest.thrift \
32 GoTagTest.thrift \
33 TypedefFieldTest.thrift \
Jens Geyer527b6d92014-11-30 15:07:18 +010034 RefAnnotationFieldsTest.thrift \
Jens Geyer0f17e152015-09-15 21:22:42 +020035 UnionDefaultValueTest.thrift \
D. Can Celasun88591e32018-05-17 08:52:11 +020036 UnionBinaryTest.thrift \
Jens Geyer28c1c192015-03-07 14:18:01 +010037 ErrorTest.thrift \
Jens Geyer1d1bca22015-03-14 16:28:27 +020038 NamesTest.thrift \
Jens Geyer70219e12015-05-20 22:00:25 +020039 InitialismsTest.thrift \
40 DontExportRWTest.thrift \
Jens Geyer86a51e72015-06-01 20:41:41 +020041 dontexportrwtest/compile_test.go \
John Boilesd9019fc2019-06-28 23:07:10 -070042 IgnoreInitialismsTest.thrift \
43 ConflictNamespaceTestA.thrift \
44 ConflictNamespaceTestB.thrift \
45 ConflictNamespaceTestC.thrift \
46 ConflictNamespaceTestD.thrift \
47 ConflictNamespaceTestSuperThing.thrift \
Duru Can Celasunf4475ff2019-11-20 15:31:35 +000048 ConflictNamespaceServiceTest.thrift \
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -080049 DuplicateImportsTest.thrift \
50 EqualsTest.thrift \
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -070051 ConflictArgNamesTest.thrift \
52 ConstOptionalFieldImport.thrift \
53 ConstOptionalField.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020054 mkdir -p gopath/src
55 grep -v list.*map.*list.*map $(THRIFTTEST) | grep -v 'set<Insanity>' > ThriftTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020056 $(THRIFT) $(THRIFTARGS) -r IncludesTest.thrift
57 $(THRIFT) $(THRIFTARGS) BinaryKeyTest.thrift
58 $(THRIFT) $(THRIFTARGS) MultiplexedProtocolTest.thrift
59 $(THRIFT) $(THRIFTARGS) OnewayTest.thrift
60 $(THRIFT) $(THRIFTARGS) OptionalFieldsTest.thrift
Craig Wickesser5c1ecb62018-10-16 02:40:13 -040061 $(THRIFT) $(THRIFTARGS) RequiredFieldTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020062 $(THRIFT) $(THRIFTARGS) ServicesTest.thrift
63 $(THRIFT) $(THRIFTARGS) GoTagTest.thrift
64 $(THRIFT) $(THRIFTARGS) TypedefFieldTest.thrift
65 $(THRIFT) $(THRIFTARGS) RefAnnotationFieldsTest.thrift
Jens Geyer0f17e152015-09-15 21:22:42 +020066 $(THRIFT) $(THRIFTARGS) UnionDefaultValueTest.thrift
D. Can Celasun88591e32018-05-17 08:52:11 +020067 $(THRIFT) $(THRIFTARGS) UnionBinaryTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020068 $(THRIFT) $(THRIFTARGS) ErrorTest.thrift
69 $(THRIFT) $(THRIFTARGS) NamesTest.thrift
70 $(THRIFT) $(THRIFTARGS) InitialismsTest.thrift
Jens Geyer70219e12015-05-20 22:00:25 +020071 $(THRIFT) $(THRIFTARGS),read_write_private DontExportRWTest.thrift
Jens Geyer86a51e72015-06-01 20:41:41 +020072 $(THRIFT) $(THRIFTARGS),ignore_initialisms IgnoreInitialismsTest.thrift
John Boilesd9019fc2019-06-28 23:07:10 -070073 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestA.thrift
74 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestB.thrift
75 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestC.thrift
76 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestD.thrift
77 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestSuperThing.thrift
78 $(THRIFT) $(THRIFTARGS) ConflictNamespaceServiceTest.thrift
Duru Can Celasunf4475ff2019-11-20 15:31:35 +000079 $(THRIFT) $(THRIFTARGS) -r DuplicateImportsTest.thrift
wangtieju4aaef752021-02-04 11:26:44 +080080 $(THRIFT) $(THRIFTARGS) EqualsTest.thrift
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -080081 $(THRIFT) $(THRIFTARGS) ConflictArgNamesTest.thrift
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -070082 $(THRIFT) $(THRIFTARGS) -r ConstOptionalField.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020083 ln -nfs ../../tests gopath/src/tests
Jens Geyer70219e12015-05-20 22:00:25 +020084 cp -r ./dontexportrwtest gopath/src
Jens Geyer79f988c2014-10-03 20:42:54 +020085 touch gopath
Jens Geyera7da4882013-07-18 00:33:05 +020086
87check: gopath
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -070088 $(GO) build -mod=mod \
89 ./gopath/src/includestest \
90 ./gopath/src/binarykeytest \
91 ./gopath/src/servicestest \
92 ./gopath/src/typedeffieldtest \
93 ./gopath/src/refannotationfieldstest \
94 ./gopath/src/errortest \
95 ./gopath/src/namestest \
96 ./gopath/src/initialismstest \
97 ./gopath/src/dontexportrwtest \
98 ./gopath/src/ignoreinitialismstest \
99 ./gopath/src/unionbinarytest \
100 ./gopath/src/conflictnamespacetestsuperthing \
101 ./gopath/src/conflict/context/conflict_service-remote \
102 ./gopath/src/servicestest/container_test-remote \
103 ./gopath/src/duplicateimportstest \
104 ./gopath/src/equalstest \
105 ./gopath/src/conflictargnamestest
106 $(GO) test -mod=mod github.com/apache/thrift/lib/go/thrift
107 $(GO) test -mod=mod ./gopath/src/tests ./gopath/src/dontexportrwtest
Jens Geyera7da4882013-07-18 00:33:05 +0200108
109clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +0200110 $(RM) -r gopath ThriftTest.thrift gen-go
Jens Geyera7da4882013-07-18 00:33:05 +0200111
112client: stubs
Yuxuan 'fishy' Wangb71f11e2021-03-22 15:01:00 -0700113 $(GO) run -mod=mod TestClient.go
jfarrell32d323e2013-08-15 20:39:58 -0400114
115EXTRA_DIST = \
jfarrellf13e4312015-08-25 00:39:29 -0400116 dontexportrwtest \
Jens Geyer79f988c2014-10-03 20:42:54 +0200117 tests \
Jens Geyer2ef01132021-02-04 22:41:50 +0100118 common \
Jens Geyer79f988c2014-10-03 20:42:54 +0200119 BinaryKeyTest.thrift \
Yuxuan 'fishy' Wangb0b35312021-02-18 09:09:20 -0800120 ConflictArgNamesTest.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100121 ConflictNamespaceServiceTest.thrift \
John Boilesd9019fc2019-06-28 23:07:10 -0700122 ConflictNamespaceTestA.thrift \
123 ConflictNamespaceTestB.thrift \
124 ConflictNamespaceTestC.thrift \
125 ConflictNamespaceTestD.thrift \
John Boiles59694a72019-11-09 11:22:26 -0800126 ConflictNamespaceTestSuperThing.thrift \
Yuxuan 'fishy' Wangf6955352021-07-29 15:59:10 -0700127 ConstOptionalField.thrift \
128 ConstOptionalFieldImport.thrift \
Jens Geyer2ef01132021-02-04 22:41:50 +0100129 DontExportRWTest.thrift \
130 DuplicateImportsTest.thrift \
131 ErrorTest.thrift \
132 EqualsTest.thrift \
133 GoTagTest.thrift \
134 IgnoreInitialismsTest.thrift \
135 IncludesTest.thrift \
136 InitialismsTest.thrift \
137 MultiplexedProtocolTest.thrift \
138 NamespacedTest.thrift \
139 NamesTest.thrift \
140 OnewayTest.thrift \
141 OptionalFieldsTest.thrift \
142 RefAnnotationFieldsTest.thrift \
143 RequiredFieldTest.thrift \
144 ServicesTest.thrift \
145 TypedefFieldTest.thrift \
146 UnionBinaryTest.thrift \
147 UnionDefaultValueTest.thrift