blob: bbcec960827690331b6f265190b7dd30ad059b52 [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
Roger Meier41ad4342015-03-24 22:30:40 +010020THRIFT = $(top_builddir)/compiler/cpp/thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020021THRIFTARGS = -out gopath/src/ --gen go:thrift_import=thrift
Jens Geyera7da4882013-07-18 00:33:05 +020022THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift
23
24# Thrift for GO has problems with complex map keys: THRIFT-2063
Roger Meier41ad4342015-03-24 22:30:40 +010025gopath: $(THRIFT) $(THRIFTTEST) \
Jens Geyer79f988c2014-10-03 20:42:54 +020026 IncludesTest.thrift \
27 NamespacedTest.thrift \
28 MultiplexedProtocolTest.thrift \
29 OnewayTest.thrift \
30 OptionalFieldsTest.thrift \
31 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 \
Jens Geyer28c1c192015-03-07 14:18:01 +010036 ErrorTest.thrift \
Jens Geyer1d1bca22015-03-14 16:28:27 +020037 NamesTest.thrift \
Jens Geyer70219e12015-05-20 22:00:25 +020038 InitialismsTest.thrift \
39 DontExportRWTest.thrift \
Jens Geyer86a51e72015-06-01 20:41:41 +020040 dontexportrwtest/compile_test.go \
41 IgnoreInitialismsTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020042 mkdir -p gopath/src
43 grep -v list.*map.*list.*map $(THRIFTTEST) | grep -v 'set<Insanity>' > ThriftTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020044 $(THRIFT) $(THRIFTARGS) -r IncludesTest.thrift
45 $(THRIFT) $(THRIFTARGS) BinaryKeyTest.thrift
46 $(THRIFT) $(THRIFTARGS) MultiplexedProtocolTest.thrift
47 $(THRIFT) $(THRIFTARGS) OnewayTest.thrift
48 $(THRIFT) $(THRIFTARGS) OptionalFieldsTest.thrift
49 $(THRIFT) $(THRIFTARGS) ServicesTest.thrift
50 $(THRIFT) $(THRIFTARGS) GoTagTest.thrift
51 $(THRIFT) $(THRIFTARGS) TypedefFieldTest.thrift
52 $(THRIFT) $(THRIFTARGS) RefAnnotationFieldsTest.thrift
Jens Geyer0f17e152015-09-15 21:22:42 +020053 $(THRIFT) $(THRIFTARGS) UnionDefaultValueTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020054 $(THRIFT) $(THRIFTARGS) ErrorTest.thrift
55 $(THRIFT) $(THRIFTARGS) NamesTest.thrift
56 $(THRIFT) $(THRIFTARGS) InitialismsTest.thrift
Jens Geyer70219e12015-05-20 22:00:25 +020057 $(THRIFT) $(THRIFTARGS),read_write_private DontExportRWTest.thrift
Jens Geyer86a51e72015-06-01 20:41:41 +020058 $(THRIFT) $(THRIFTARGS),ignore_initialisms IgnoreInitialismsTest.thrift
Jens Geyer56a03be2015-06-17 22:21:27 +020059 GOPATH=`pwd`/gopath $(GO) get github.com/golang/mock/gomock
Jens Geyer79f988c2014-10-03 20:42:54 +020060 ln -nfs ../../../thrift gopath/src/thrift
61 ln -nfs ../../tests gopath/src/tests
Jens Geyer70219e12015-05-20 22:00:25 +020062 cp -r ./dontexportrwtest gopath/src
Jens Geyer79f988c2014-10-03 20:42:54 +020063 touch gopath
Jens Geyera7da4882013-07-18 00:33:05 +020064
65check: gopath
Jens Geyer79f988c2014-10-03 20:42:54 +020066 GOPATH=`pwd`/gopath $(GO) build \
67 includestest \
68 binarykeytest \
69 servicestest \
70 typedeffieldtest \
Jens Geyer527b6d92014-11-30 15:07:18 +010071 refannotationfieldstest \
Jens Geyer28c1c192015-03-07 14:18:01 +010072 errortest \
Jens Geyer1d1bca22015-03-14 16:28:27 +020073 namestest \
Jens Geyer70219e12015-05-20 22:00:25 +020074 initialismstest \
Jens Geyer86a51e72015-06-01 20:41:41 +020075 dontexportrwtest \
76 ignoreinitialismstest
Jens Geyer70219e12015-05-20 22:00:25 +020077 GOPATH=`pwd`/gopath $(GO) test thrift tests dontexportrwtest
Jens Geyera7da4882013-07-18 00:33:05 +020078
79clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +020080 $(RM) -r gopath ThriftTest.thrift gen-go
Jens Geyera7da4882013-07-18 00:33:05 +020081
82client: stubs
Jens Geyer79f988c2014-10-03 20:42:54 +020083 $(GO) run TestClient.go
jfarrell32d323e2013-08-15 20:39:58 -040084
85EXTRA_DIST = \
jfarrellf13e4312015-08-25 00:39:29 -040086 dontexportrwtest \
Jens Geyer79f988c2014-10-03 20:42:54 +020087 tests \
88 BinaryKeyTest.thrift \
89 GoTagTest.thrift \
90 IncludesTest.thrift \
91 MultiplexedProtocolTest.thrift \
92 NamespacedTest.thrift \
93 OnewayTest.thrift \
94 OptionalFieldsTest.thrift \
95 RefAnnotationFieldsTest.thrift \
Jens Geyer0f17e152015-09-15 21:22:42 +020096 UnionDefaultValueTest.thrift \
Jens Geyer79f988c2014-10-03 20:42:54 +020097 ServicesTest.thrift \
Jens Geyer527b6d92014-11-30 15:07:18 +010098 TypedefFieldTest.thrift \
Jens Geyer28c1c192015-03-07 14:18:01 +010099 ErrorTest.thrift \
Jens Geyer1d1bca22015-03-14 16:28:27 +0200100 NamesTest.thrift \
Jens Geyer70219e12015-05-20 22:00:25 +0200101 InitialismsTest.thrift \
Jens Geyer86a51e72015-06-01 20:41:41 +0200102 DontExportRWTest.thrift \
103 IgnoreInitialismsTest.thrift