aboutsummaryrefslogtreecommitdiff
path: root/tests.sh
diff options
context:
space:
mode:
authorBo Yang <teboring@google.com>2016-09-30 19:07:33 +0000
committerBo Yang <teboring@google.com>2016-10-10 11:44:54 -0700
commitc8bd36e5b91fa7cc3ca56abfd33db13da8ce3077 (patch)
treea63fa0c5740e1871231b43b97f0d80f8e2cdd71c /tests.sh
parentc0719f062c1e8b140fa90ce6e8af8ad32ee61583 (diff)
downloadprotobuf-c8bd36e5b91fa7cc3ca56abfd33db13da8ce3077.tar.gz
protobuf-c8bd36e5b91fa7cc3ca56abfd33db13da8ce3077.tar.bz2
protobuf-c8bd36e5b91fa7cc3ca56abfd33db13da8ce3077.zip
Test php5.5_c test on jenkins
Diffstat (limited to 'tests.sh')
-rwxr-xr-xtests.sh49
1 files changed, 30 insertions, 19 deletions
diff --git a/tests.sh b/tests.sh
index e6595044..f0d2abc9 100755
--- a/tests.sh
+++ b/tests.sh
@@ -334,54 +334,64 @@ build_javascript() {
cd js && npm install && npm test && cd ..
}
+use_php() {
+ VERSION=$1
+ PHP=`which php`
+ PHP_CONFIG=`which php-config`
+ PHPIZE=`which phpize`
+ rm $PHP
+ rm $PHP_CONFIG
+ rm $PHPIZE
+ cp "/usr/bin/php$VERSION" $PHP
+ cp "/usr/bin/php-config$VERSION" $PHP_CONFIG
+ cp "/usr/bin/phpize$VERSION" $PHPIZE
+}
+
build_php5.5_c() {
- ln -sfn /usr/bin/php5.5 /usr/bin/php
- ln -sfn /usr/bin/php-config5.5 /usr/bin/php-config
- ln -sfn /usr/bin/phpize5.5 /usr/bin/phpize
+ use_php 5.5
cd php/tests && /bin/bash ./test.sh && cd ../..
}
build_php5.5() {
- ln -sfn /usr/bin/php5.5 /usr/bin/php
- ln -sfn /usr/bin/php-config5.5 /usr/bin/php-config
- ln -sfn /usr/bin/phpize5.5 /usr/bin/phpize
+ use_php 5.5
rm -rf vendor
cp -r /usr/local/vendor-5.5 vendor
./vendor/bin/phpunit
}
build_php5.6_c() {
- ln -sfn /usr/bin/php5.6 /usr/bin/php
- ln -sfn /usr/bin/php-config5.6 /usr/bin/php-config
- ln -sfn /usr/bin/phpize5.6 /usr/bin/phpize
+ use_php 5.6
cd php/tests && /bin/bash ./test.sh && cd ../..
}
build_php5.6() {
- ln -sfn /usr/bin/php5.6 /usr/bin/php
- ln -sfn /usr/bin/php-config5.6 /usr/bin/php-config
- ln -sfn /usr/bin/phpize5.6 /usr/bin/phpize
+ use_php 5.6
rm -rf vendor
cp -r /usr/local/vendor-5.6 vendor
./vendor/bin/phpunit
}
build_php7.0_c() {
- ln -sfn /usr/bin/php7.0 /usr/bin/php
- ln -sfn /usr/bin/php-config7.0 /usr/bin/php-config
- ln -sfn /usr/bin/phpize7.0 /usr/bin/phpize
+ use_php 7.0
cd php/tests && /bin/bash ./test.sh && cd ../..
}
build_php7.0() {
- ln -sfn /usr/bin/php7.0 /usr/bin/php
- ln -sfn /usr/bin/php-config7.0 /usr/bin/php-config
- ln -sfn /usr/bin/phpize7.0 /usr/bin/phpize
+ use_php 7.0
rm -rf vendor
cp -r /usr/local/vendor-7.0 vendor
./vendor/bin/phpunit
}
+build_php_all() {
+ build_php5.5
+ build_php5.6
+ build_php7.0
+ build_php5.5_c
+ build_php5.6_c
+ # build_php7.0_c
+}
+
# Note: travis currently does not support testing more than one language so the
# .travis.yml cheats and claims to only be cpp. If they add multiple language
# support, this should probably get updated to install steps and/or
@@ -418,7 +428,8 @@ Usage: $0 { cpp |
php5.6 |
php5.6_c |
php7.0 |
- php7.0_c)
+ php7.0_c |
+ php_all)
"
exit 1
fi