blob: 2f748c6fa59d9d7c350a53df02c88bcc2d110bcb [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
taozle5c302e02017-07-23 15:21:44 +020020THRIFTARGS = -out gopath/src/ --gen go:thrift_import=thrift$(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 \
49 DuplicateImportsTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020050 mkdir -p gopath/src
51 grep -v list.*map.*list.*map $(THRIFTTEST) | grep -v 'set<Insanity>' > ThriftTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020052 $(THRIFT) $(THRIFTARGS) -r IncludesTest.thrift
53 $(THRIFT) $(THRIFTARGS) BinaryKeyTest.thrift
54 $(THRIFT) $(THRIFTARGS) MultiplexedProtocolTest.thrift
55 $(THRIFT) $(THRIFTARGS) OnewayTest.thrift
56 $(THRIFT) $(THRIFTARGS) OptionalFieldsTest.thrift
Craig Wickesser5c1ecb62018-10-16 02:40:13 -040057 $(THRIFT) $(THRIFTARGS) RequiredFieldTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020058 $(THRIFT) $(THRIFTARGS) ServicesTest.thrift
59 $(THRIFT) $(THRIFTARGS) GoTagTest.thrift
60 $(THRIFT) $(THRIFTARGS) TypedefFieldTest.thrift
61 $(THRIFT) $(THRIFTARGS) RefAnnotationFieldsTest.thrift
Jens Geyer0f17e152015-09-15 21:22:42 +020062 $(THRIFT) $(THRIFTARGS) UnionDefaultValueTest.thrift
D. Can Celasun88591e32018-05-17 08:52:11 +020063 $(THRIFT) $(THRIFTARGS) UnionBinaryTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020064 $(THRIFT) $(THRIFTARGS) ErrorTest.thrift
65 $(THRIFT) $(THRIFTARGS) NamesTest.thrift
66 $(THRIFT) $(THRIFTARGS) InitialismsTest.thrift
Jens Geyer70219e12015-05-20 22:00:25 +020067 $(THRIFT) $(THRIFTARGS),read_write_private DontExportRWTest.thrift
Jens Geyer86a51e72015-06-01 20:41:41 +020068 $(THRIFT) $(THRIFTARGS),ignore_initialisms IgnoreInitialismsTest.thrift
John Boilesd9019fc2019-06-28 23:07:10 -070069 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestA.thrift
70 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestB.thrift
71 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestC.thrift
72 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestD.thrift
73 $(THRIFT) $(THRIFTARGS) ConflictNamespaceTestSuperThing.thrift
74 $(THRIFT) $(THRIFTARGS) ConflictNamespaceServiceTest.thrift
Duru Can Celasunf4475ff2019-11-20 15:31:35 +000075 $(THRIFT) $(THRIFTARGS) -r DuplicateImportsTest.thrift
wangtieju4aaef752021-02-04 11:26:44 +080076 $(THRIFT) $(THRIFTARGS) EqualsTest.thrift
James E. King, III0ad20bd2017-09-30 15:44:16 -070077 GOPATH=`pwd`/gopath $(GO) get github.com/golang/mock/gomock || true
78 sed -i 's/\"context\"/\"golang.org\/x\/net\/context\"/g' gopath/src/github.com/golang/mock/gomock/controller.go || true
79 GOPATH=`pwd`/gopath $(GO) get github.com/golang/mock/gomock
Jens Geyer79f988c2014-10-03 20:42:54 +020080 ln -nfs ../../../thrift gopath/src/thrift
81 ln -nfs ../../tests gopath/src/tests
Jens Geyer70219e12015-05-20 22:00:25 +020082 cp -r ./dontexportrwtest gopath/src
Jens Geyer79f988c2014-10-03 20:42:54 +020083 touch gopath
Jens Geyera7da4882013-07-18 00:33:05 +020084
85check: gopath
Jens Geyer79f988c2014-10-03 20:42:54 +020086 GOPATH=`pwd`/gopath $(GO) build \
87 includestest \
88 binarykeytest \
89 servicestest \
90 typedeffieldtest \
Jens Geyer527b6d92014-11-30 15:07:18 +010091 refannotationfieldstest \
Jens Geyer28c1c192015-03-07 14:18:01 +010092 errortest \
Jens Geyer1d1bca22015-03-14 16:28:27 +020093 namestest \
Jens Geyer70219e12015-05-20 22:00:25 +020094 initialismstest \
Jens Geyer86a51e72015-06-01 20:41:41 +020095 dontexportrwtest \
D. Can Celasun88591e32018-05-17 08:52:11 +020096 ignoreinitialismstest \
John Boilesd9019fc2019-06-28 23:07:10 -070097 unionbinarytest \
98 conflictnamespacetestsuperthing \
John Boiles59694a72019-11-09 11:22:26 -080099 conflict/context/conflict_service-remote \
Duru Can Celasunf4475ff2019-11-20 15:31:35 +0000100 servicestest/container_test-remote \
wangtieju4aaef752021-02-04 11:26:44 +0800101 duplicateimportstest \
102 equalstest
Jens Geyer70219e12015-05-20 22:00:25 +0200103 GOPATH=`pwd`/gopath $(GO) test thrift tests dontexportrwtest
Jens Geyera7da4882013-07-18 00:33:05 +0200104
105clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +0200106 $(RM) -r gopath ThriftTest.thrift gen-go
Jens Geyera7da4882013-07-18 00:33:05 +0200107
108client: stubs
Jens Geyer79f988c2014-10-03 20:42:54 +0200109 $(GO) run TestClient.go
jfarrell32d323e2013-08-15 20:39:58 -0400110
111EXTRA_DIST = \
jfarrellf13e4312015-08-25 00:39:29 -0400112 dontexportrwtest \
Jens Geyer79f988c2014-10-03 20:42:54 +0200113 tests \
Jens Geyer8411e182021-02-04 22:41:50 +0100114 common \
Jens Geyer79f988c2014-10-03 20:42:54 +0200115 BinaryKeyTest.thrift \
Jens Geyer8411e182021-02-04 22:41:50 +0100116 ConflictNamespaceServiceTest.thrift \
John Boilesd9019fc2019-06-28 23:07:10 -0700117 ConflictNamespaceTestA.thrift \
118 ConflictNamespaceTestB.thrift \
119 ConflictNamespaceTestC.thrift \
120 ConflictNamespaceTestD.thrift \
John Boiles59694a72019-11-09 11:22:26 -0800121 ConflictNamespaceTestSuperThing.thrift \
Jens Geyer8411e182021-02-04 22:41:50 +0100122 DontExportRWTest.thrift \
123 DuplicateImportsTest.thrift \
124 ErrorTest.thrift \
125 EqualsTest.thrift \
126 GoTagTest.thrift \
127 IgnoreInitialismsTest.thrift \
128 IncludesTest.thrift \
129 InitialismsTest.thrift \
130 MultiplexedProtocolTest.thrift \
131 NamespacedTest.thrift \
132 NamesTest.thrift \
133 OnewayTest.thrift \
134 OptionalFieldsTest.thrift \
135 RefAnnotationFieldsTest.thrift \
136 RequiredFieldTest.thrift \
137 ServicesTest.thrift \
138 TypedefFieldTest.thrift \
139 UnionBinaryTest.thrift \
140 UnionDefaultValueTest.thrift