THRIFT-2632 add "validate" option to generate read/write validation code
Client: PHP
Patch: Stig Bakken & Jens Geyer
Modifications made to the original pull request:
- moved TestValidators.* to lib/php/test
- created new TestValidators.thrift to house the UnionOfStrings union
- modified makefiles accordingly
This closes #159
diff --git a/lib/php/test/Makefile.am b/lib/php/test/Makefile.am
index 1292b81..a529d8c 100755
--- a/lib/php/test/Makefile.am
+++ b/lib/php/test/Makefile.am
@@ -19,15 +19,27 @@
THRIFT = $(top_builddir)/compiler/cpp/thrift
-stubs: ../../../test/ThriftTest.thrift
+stubs: ../../../test/ThriftTest.thrift TestValidators.thrift
mkdir -p ./packages
$(THRIFT) --gen php -r --out ./packages ../../../test/ThriftTest.thrift
+ mkdir -p ./packages/phpv
+ mkdir -p ./packages/phpvo
+ $(THRIFT) --gen php:validate -r --out ./packages/phpv TestValidators.thrift
+ $(THRIFT) --gen php:validate,oop -r --out ./packages/phpvo TestValidators.thrift
+
+check-validator: stubs
+ php Test/Thrift/TestValidators.php
+ php Test/Thrift/TestValidators.php -oop
+check-protocol: stubs
if HAVE_PHPUNIT
-check: stubs
$(PHPUNIT) --log-junit=phpunit.xml Test/Thrift/Protocol/TestTJSONProtocol.php
$(PHPUNIT) --log-junit=phpunit.xml Test/Thrift/Protocol/TestBinarySerializer.php
endif
+
+check: stubs \
+ check-protocol \
+ check-validator
clean-local:
$(RM) -r ./packages