blob: f34b577d838ae840d9bd2e1ce60899a00a051357 [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
Jens Geyer45687922014-04-07 21:20:16 +020020THRIFT = $(top_srcdir)/compiler/cpp/thrift -out gopath/src/ --gen go:thrift_import=thrift
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
Jens Geyer20bcf382014-04-16 00:27:31 +020024gopath: $(top_srcdir)/compiler/cpp/thrift $(THRIFTTEST) \
Jens Geyer79f988c2014-10-03 20:42:54 +020025 IncludesTest.thrift \
26 NamespacedTest.thrift \
27 MultiplexedProtocolTest.thrift \
28 OnewayTest.thrift \
29 OptionalFieldsTest.thrift \
30 ServicesTest.thrift \
31 GoTagTest.thrift \
32 TypedefFieldTest.thrift \
Jens Geyer527b6d92014-11-30 15:07:18 +010033 RefAnnotationFieldsTest.thrift \
Jens Geyer28c1c192015-03-07 14:18:01 +010034 ErrorTest.thrift \
35 NamesTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020036 mkdir -p gopath/src
37 grep -v list.*map.*list.*map $(THRIFTTEST) | grep -v 'set<Insanity>' > ThriftTest.thrift
38 $(THRIFT) -r IncludesTest.thrift
39 $(THRIFT) BinaryKeyTest.thrift
40 $(THRIFT) MultiplexedProtocolTest.thrift
41 $(THRIFT) OnewayTest.thrift
42 $(THRIFT) OptionalFieldsTest.thrift
43 $(THRIFT) ServicesTest.thrift
44 $(THRIFT) GoTagTest.thrift
45 $(THRIFT) TypedefFieldTest.thrift
46 $(THRIFT) RefAnnotationFieldsTest.thrift
Jens Geyer527b6d92014-11-30 15:07:18 +010047 $(THRIFT) ErrorTest.thrift
Jens Geyer28c1c192015-03-07 14:18:01 +010048 $(THRIFT) NamesTest.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020049 GOPATH=`pwd`/gopath $(GO) get code.google.com/p/gomock/gomock
50 ln -nfs ../../../thrift gopath/src/thrift
51 ln -nfs ../../tests gopath/src/tests
52 touch gopath
Jens Geyera7da4882013-07-18 00:33:05 +020053
54check: gopath
Jens Geyer79f988c2014-10-03 20:42:54 +020055 GOPATH=`pwd`/gopath $(GO) build \
56 includestest \
57 binarykeytest \
58 servicestest \
59 typedeffieldtest \
Jens Geyer527b6d92014-11-30 15:07:18 +010060 refannotationfieldstest \
Jens Geyer28c1c192015-03-07 14:18:01 +010061 errortest \
62 namestest
Jens Geyer79f988c2014-10-03 20:42:54 +020063 GOPATH=`pwd`/gopath $(GO) test thrift tests
Jens Geyera7da4882013-07-18 00:33:05 +020064
65clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +020066 $(RM) -r gopath ThriftTest.thrift gen-go
Jens Geyera7da4882013-07-18 00:33:05 +020067
68client: stubs
Jens Geyer79f988c2014-10-03 20:42:54 +020069 $(GO) run TestClient.go
jfarrell32d323e2013-08-15 20:39:58 -040070
71EXTRA_DIST = \
Jens Geyer79f988c2014-10-03 20:42:54 +020072 tests \
73 BinaryKeyTest.thrift \
74 GoTagTest.thrift \
75 IncludesTest.thrift \
76 MultiplexedProtocolTest.thrift \
77 NamespacedTest.thrift \
78 OnewayTest.thrift \
79 OptionalFieldsTest.thrift \
80 RefAnnotationFieldsTest.thrift \
81 ServicesTest.thrift \
Jens Geyer527b6d92014-11-30 15:07:18 +010082 TypedefFieldTest.thrift \
Jens Geyer28c1c192015-03-07 14:18:01 +010083 ErrorTest.thrift \
84 NamesTest.thrift