Jens Geyer | a7da488 | 2013-07-18 00:33:05 +0200 | [diff] [blame] | 1 | # |
| 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 | |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame^] | 20 | if GOVERSION_LT_17 |
| 21 | COMPILER_EXTRAFLAG=",legacy_context" |
| 22 | endif |
| 23 | |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 24 | THRIFT = $(top_builddir)/compiler/cpp/thrift |
taozle | 5c302e0 | 2017-07-23 15:21:44 +0200 | [diff] [blame^] | 25 | THRIFTARGS = -out gopath/src/ --gen go:thrift_import=thrift$(COMPILER_EXTRAFLAG) |
Jens Geyer | a7da488 | 2013-07-18 00:33:05 +0200 | [diff] [blame] | 26 | THRIFTTEST = $(top_srcdir)/test/ThriftTest.thrift |
| 27 | |
| 28 | # Thrift for GO has problems with complex map keys: THRIFT-2063 |
Roger Meier | 41ad434 | 2015-03-24 22:30:40 +0100 | [diff] [blame] | 29 | gopath: $(THRIFT) $(THRIFTTEST) \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 30 | IncludesTest.thrift \ |
| 31 | NamespacedTest.thrift \ |
| 32 | MultiplexedProtocolTest.thrift \ |
| 33 | OnewayTest.thrift \ |
| 34 | OptionalFieldsTest.thrift \ |
| 35 | ServicesTest.thrift \ |
| 36 | GoTagTest.thrift \ |
| 37 | TypedefFieldTest.thrift \ |
Jens Geyer | 527b6d9 | 2014-11-30 15:07:18 +0100 | [diff] [blame] | 38 | RefAnnotationFieldsTest.thrift \ |
Jens Geyer | 0f17e15 | 2015-09-15 21:22:42 +0200 | [diff] [blame] | 39 | UnionDefaultValueTest.thrift \ |
Jens Geyer | 28c1c19 | 2015-03-07 14:18:01 +0100 | [diff] [blame] | 40 | ErrorTest.thrift \ |
Jens Geyer | 1d1bca2 | 2015-03-14 16:28:27 +0200 | [diff] [blame] | 41 | NamesTest.thrift \ |
Jens Geyer | 70219e1 | 2015-05-20 22:00:25 +0200 | [diff] [blame] | 42 | InitialismsTest.thrift \ |
| 43 | DontExportRWTest.thrift \ |
Jens Geyer | 86a51e7 | 2015-06-01 20:41:41 +0200 | [diff] [blame] | 44 | dontexportrwtest/compile_test.go \ |
| 45 | IgnoreInitialismsTest.thrift |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 46 | mkdir -p gopath/src |
| 47 | grep -v list.*map.*list.*map $(THRIFTTEST) | grep -v 'set<Insanity>' > ThriftTest.thrift |
Jens Geyer | 9f74f32 | 2015-04-17 23:33:48 +0200 | [diff] [blame] | 48 | $(THRIFT) $(THRIFTARGS) -r IncludesTest.thrift |
| 49 | $(THRIFT) $(THRIFTARGS) BinaryKeyTest.thrift |
| 50 | $(THRIFT) $(THRIFTARGS) MultiplexedProtocolTest.thrift |
| 51 | $(THRIFT) $(THRIFTARGS) OnewayTest.thrift |
| 52 | $(THRIFT) $(THRIFTARGS) OptionalFieldsTest.thrift |
| 53 | $(THRIFT) $(THRIFTARGS) ServicesTest.thrift |
| 54 | $(THRIFT) $(THRIFTARGS) GoTagTest.thrift |
| 55 | $(THRIFT) $(THRIFTARGS) TypedefFieldTest.thrift |
| 56 | $(THRIFT) $(THRIFTARGS) RefAnnotationFieldsTest.thrift |
Jens Geyer | 0f17e15 | 2015-09-15 21:22:42 +0200 | [diff] [blame] | 57 | $(THRIFT) $(THRIFTARGS) UnionDefaultValueTest.thrift |
Jens Geyer | 9f74f32 | 2015-04-17 23:33:48 +0200 | [diff] [blame] | 58 | $(THRIFT) $(THRIFTARGS) ErrorTest.thrift |
| 59 | $(THRIFT) $(THRIFTARGS) NamesTest.thrift |
| 60 | $(THRIFT) $(THRIFTARGS) InitialismsTest.thrift |
Jens Geyer | 70219e1 | 2015-05-20 22:00:25 +0200 | [diff] [blame] | 61 | $(THRIFT) $(THRIFTARGS),read_write_private DontExportRWTest.thrift |
Jens Geyer | 86a51e7 | 2015-06-01 20:41:41 +0200 | [diff] [blame] | 62 | $(THRIFT) $(THRIFTARGS),ignore_initialisms IgnoreInitialismsTest.thrift |
Jens Geyer | 56a03be | 2015-06-17 22:21:27 +0200 | [diff] [blame] | 63 | GOPATH=`pwd`/gopath $(GO) get github.com/golang/mock/gomock |
taozle | c0d384a | 2017-07-17 18:40:42 +0200 | [diff] [blame] | 64 | GOPATH=`pwd`/gopath $(GO) get golang.org/x/net/context |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 65 | ln -nfs ../../../thrift gopath/src/thrift |
| 66 | ln -nfs ../../tests gopath/src/tests |
Jens Geyer | 70219e1 | 2015-05-20 22:00:25 +0200 | [diff] [blame] | 67 | cp -r ./dontexportrwtest gopath/src |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 68 | touch gopath |
Jens Geyer | a7da488 | 2013-07-18 00:33:05 +0200 | [diff] [blame] | 69 | |
| 70 | check: gopath |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 71 | GOPATH=`pwd`/gopath $(GO) build \ |
| 72 | includestest \ |
| 73 | binarykeytest \ |
| 74 | servicestest \ |
| 75 | typedeffieldtest \ |
Jens Geyer | 527b6d9 | 2014-11-30 15:07:18 +0100 | [diff] [blame] | 76 | refannotationfieldstest \ |
Jens Geyer | 28c1c19 | 2015-03-07 14:18:01 +0100 | [diff] [blame] | 77 | errortest \ |
Jens Geyer | 1d1bca2 | 2015-03-14 16:28:27 +0200 | [diff] [blame] | 78 | namestest \ |
Jens Geyer | 70219e1 | 2015-05-20 22:00:25 +0200 | [diff] [blame] | 79 | initialismstest \ |
Jens Geyer | 86a51e7 | 2015-06-01 20:41:41 +0200 | [diff] [blame] | 80 | dontexportrwtest \ |
| 81 | ignoreinitialismstest |
Jens Geyer | 70219e1 | 2015-05-20 22:00:25 +0200 | [diff] [blame] | 82 | GOPATH=`pwd`/gopath $(GO) test thrift tests dontexportrwtest |
Jens Geyer | a7da488 | 2013-07-18 00:33:05 +0200 | [diff] [blame] | 83 | |
| 84 | clean-local: |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 85 | $(RM) -r gopath ThriftTest.thrift gen-go |
Jens Geyer | a7da488 | 2013-07-18 00:33:05 +0200 | [diff] [blame] | 86 | |
| 87 | client: stubs |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 88 | $(GO) run TestClient.go |
jfarrell | 32d323e | 2013-08-15 20:39:58 -0400 | [diff] [blame] | 89 | |
| 90 | EXTRA_DIST = \ |
jfarrell | f13e431 | 2015-08-25 00:39:29 -0400 | [diff] [blame] | 91 | dontexportrwtest \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 92 | tests \ |
| 93 | BinaryKeyTest.thrift \ |
| 94 | GoTagTest.thrift \ |
| 95 | IncludesTest.thrift \ |
| 96 | MultiplexedProtocolTest.thrift \ |
| 97 | NamespacedTest.thrift \ |
| 98 | OnewayTest.thrift \ |
| 99 | OptionalFieldsTest.thrift \ |
| 100 | RefAnnotationFieldsTest.thrift \ |
Jens Geyer | 0f17e15 | 2015-09-15 21:22:42 +0200 | [diff] [blame] | 101 | UnionDefaultValueTest.thrift \ |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 102 | ServicesTest.thrift \ |
Jens Geyer | 527b6d9 | 2014-11-30 15:07:18 +0100 | [diff] [blame] | 103 | TypedefFieldTest.thrift \ |
Jens Geyer | 28c1c19 | 2015-03-07 14:18:01 +0100 | [diff] [blame] | 104 | ErrorTest.thrift \ |
Jens Geyer | 1d1bca2 | 2015-03-14 16:28:27 +0200 | [diff] [blame] | 105 | NamesTest.thrift \ |
Jens Geyer | 70219e1 | 2015-05-20 22:00:25 +0200 | [diff] [blame] | 106 | InitialismsTest.thrift \ |
Jens Geyer | 86a51e7 | 2015-06-01 20:41:41 +0200 | [diff] [blame] | 107 | DontExportRWTest.thrift \ |
| 108 | IgnoreInitialismsTest.thrift |