blob: 8cedfb0077344f87bab796350a50fd3c772d61f4 [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 Geyer28c1c192015-03-07 14:18:01 +010035 ErrorTest.thrift \
Jens Geyer1d1bca22015-03-14 16:28:27 +020036 NamesTest.thrift \
Jens Geyer70219e12015-05-20 22:00:25 +020037 InitialismsTest.thrift \
38 DontExportRWTest.thrift \
39 dontexportrwtest/compile_test.go
Jens Geyer79f988c2014-10-03 20:42:54 +020040 mkdir -p gopath/src
41 grep -v list.*map.*list.*map $(THRIFTTEST) | grep -v 'set<Insanity>' > ThriftTest.thrift
Jens Geyer9f74f322015-04-17 23:33:48 +020042 $(THRIFT) $(THRIFTARGS) -r IncludesTest.thrift
43 $(THRIFT) $(THRIFTARGS) BinaryKeyTest.thrift
44 $(THRIFT) $(THRIFTARGS) MultiplexedProtocolTest.thrift
45 $(THRIFT) $(THRIFTARGS) OnewayTest.thrift
46 $(THRIFT) $(THRIFTARGS) OptionalFieldsTest.thrift
47 $(THRIFT) $(THRIFTARGS) ServicesTest.thrift
48 $(THRIFT) $(THRIFTARGS) GoTagTest.thrift
49 $(THRIFT) $(THRIFTARGS) TypedefFieldTest.thrift
50 $(THRIFT) $(THRIFTARGS) RefAnnotationFieldsTest.thrift
51 $(THRIFT) $(THRIFTARGS) ErrorTest.thrift
52 $(THRIFT) $(THRIFTARGS) NamesTest.thrift
53 $(THRIFT) $(THRIFTARGS) InitialismsTest.thrift
Jens Geyer70219e12015-05-20 22:00:25 +020054 $(THRIFT) $(THRIFTARGS),read_write_private DontExportRWTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020055 GOPATH=`pwd`/gopath $(GO) get code.google.com/p/gomock/gomock
56 ln -nfs ../../../thrift gopath/src/thrift
57 ln -nfs ../../tests gopath/src/tests
Jens Geyer70219e12015-05-20 22:00:25 +020058 cp -r ./dontexportrwtest gopath/src
Jens Geyer79f988c2014-10-03 20:42:54 +020059 touch gopath
Jens Geyera7da4882013-07-18 00:33:05 +020060
61check: gopath
Jens Geyer79f988c2014-10-03 20:42:54 +020062 GOPATH=`pwd`/gopath $(GO) build \
63 includestest \
64 binarykeytest \
65 servicestest \
66 typedeffieldtest \
Jens Geyer527b6d92014-11-30 15:07:18 +010067 refannotationfieldstest \
Jens Geyer28c1c192015-03-07 14:18:01 +010068 errortest \
Jens Geyer1d1bca22015-03-14 16:28:27 +020069 namestest \
Jens Geyer70219e12015-05-20 22:00:25 +020070 initialismstest \
71 dontexportrwtest
72 GOPATH=`pwd`/gopath $(GO) test thrift tests dontexportrwtest
Jens Geyera7da4882013-07-18 00:33:05 +020073
74clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +020075 $(RM) -r gopath ThriftTest.thrift gen-go
Jens Geyera7da4882013-07-18 00:33:05 +020076
77client: stubs
Jens Geyer79f988c2014-10-03 20:42:54 +020078 $(GO) run TestClient.go
jfarrell32d323e2013-08-15 20:39:58 -040079
80EXTRA_DIST = \
Jens Geyer79f988c2014-10-03 20:42:54 +020081 tests \
82 BinaryKeyTest.thrift \
83 GoTagTest.thrift \
84 IncludesTest.thrift \
85 MultiplexedProtocolTest.thrift \
86 NamespacedTest.thrift \
87 OnewayTest.thrift \
88 OptionalFieldsTest.thrift \
89 RefAnnotationFieldsTest.thrift \
90 ServicesTest.thrift \
Jens Geyer527b6d92014-11-30 15:07:18 +010091 TypedefFieldTest.thrift \
Jens Geyer28c1c192015-03-07 14:18:01 +010092 ErrorTest.thrift \
Jens Geyer1d1bca22015-03-14 16:28:27 +020093 NamesTest.thrift \
Jens Geyer70219e12015-05-20 22:00:25 +020094 InitialismsTest.thrift \
95 DontExportRWTest.thrift