blob: c4dcde342518e30bc4df608282c372f4e23acb50 [file] [log] [blame]
Roger Meier33b720a2012-01-24 18:42:46 +00001#
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
Robert Lua15060a2017-12-28 15:29:39 +080020PHPUNIT=php $(top_srcdir)/vendor/bin/phpunit
21
Jens Geyer577f4072014-07-23 19:04:12 +020022stubs: ../../../test/ThriftTest.thrift TestValidators.thrift
Jens Geyer79f988c2014-10-03 20:42:54 +020023 mkdir -p ./packages
24 $(THRIFT) --gen php -r --out ./packages ../../../test/ThriftTest.thrift
25 mkdir -p ./packages/phpv
26 mkdir -p ./packages/phpvo
Roger Meier964082a2014-10-08 23:28:09 +020027 mkdir -p ./packages/phpjs
28 $(THRIFT) --gen php:validate -r --out ./packages/phpv TestValidators.thrift
29 $(THRIFT) --gen php:validate,oop -r --out ./packages/phpvo TestValidators.thrift
30 $(THRIFT) --gen php:json -r --out ./packages/phpjs TestValidators.thrift
31
Robert Lua15060a2017-12-28 15:29:39 +080032deps: $(top_srcdir)/composer.json
33 composer install --working-dir=$(top_srcdir)
Roger Meier964082a2014-10-08 23:28:09 +020034
Robert Lua15060a2017-12-28 15:29:39 +080035all-local: deps
36
37check-json-serializer: deps stubs
38 $(PHPUNIT) --log-junit=TEST-json-serializer.xml Test/Thrift/JsonSerialize/
39
40check-validator: deps stubs
jfarrellf13e4312015-08-25 00:39:29 -040041 php Test/Thrift/TestValidators.php
42 php Test/Thrift/TestValidators.php -oop
Roger Meier33b720a2012-01-24 18:42:46 +000043
Robert Lua15060a2017-12-28 15:29:39 +080044check-protocol: deps stubs
Roger Meier964082a2014-10-08 23:28:09 +020045 $(PHPUNIT) --log-junit=TEST-log-json-protocol.xml Test/Thrift/Protocol/TestTJSONProtocol.php
46 $(PHPUNIT) --log-junit=TEST-binary-serializer.xml Test/Thrift/Protocol/TestBinarySerializer.php
Atsushi Takayamaaede9752015-09-08 00:33:09 +090047 $(PHPUNIT) --log-junit=TEST-log-simple-json-protocol.xml Test/Thrift/Protocol/TestTSimpleJSONProtocol.php
Roger Meier964082a2014-10-08 23:28:09 +020048
Robert Lua15060a2017-12-28 15:29:39 +080049check: deps stubs \
Jens Geyer577f4072014-07-23 19:04:12 +020050 check-protocol \
Roger Meier964082a2014-10-08 23:28:09 +020051 check-validator \
52 check-json-serializer
Roger Meier33b720a2012-01-24 18:42:46 +000053
54clean-local:
Jens Geyer79f988c2014-10-03 20:42:54 +020055 $(RM) -r ./packages
Roger Meier964082a2014-10-08 23:28:09 +020056 $(RM) TEST-*.xml
Roger Meier33b720a2012-01-24 18:42:46 +000057
jfarrellf13e4312015-08-25 00:39:29 -040058EXTRA_DIST = \
59 Test \
60 TestValidators.thrift