2014-03-03 01:10:01 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2014-03-03 00:43:58 +00:00
|
|
|
export PHPSECLIB_SSH_HOSTNAME='localhost'
|
|
|
|
export PHPSECLIB_SSH_USERNAME='phpseclib'
|
|
|
|
export PHPSECLIB_SSH_PASSWORD='EePoov8po1aethu2kied1ne0'
|
2014-04-02 14:23:22 +00:00
|
|
|
export PHPSECLIB_SSH_HOME='/home/phpseclib'
|
2014-03-03 00:43:58 +00:00
|
|
|
|
2014-04-12 02:09:18 +00:00
|
|
|
if [ "$TRAVIS_PHP_VERSION" = '5.2' ]
|
|
|
|
then
|
|
|
|
PHPUNIT="phpunit"
|
|
|
|
else
|
|
|
|
PHPUNIT="$(dirname "$0")/../vendor/bin/phpunit"
|
|
|
|
fi
|
|
|
|
|
2014-12-12 22:04:41 +00:00
|
|
|
PHPUNIT_ARGS='--verbose'
|
2014-04-12 05:13:44 +00:00
|
|
|
if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.4', '<');"` = "1" ]
|
2014-04-10 18:00:48 +00:00
|
|
|
then
|
2014-12-12 22:04:41 +00:00
|
|
|
PHPUNIT_ARGS="$PHPUNIT_ARGS -d zend.enable_gc=0"
|
2014-04-10 18:00:48 +00:00
|
|
|
fi
|
|
|
|
|
2015-07-21 11:08:08 +00:00
|
|
|
if [ "$TRAVIS_PHP_VERSION" = 'hhvm' -o "$TRAVIS_PHP_VERSION" = '7.0' ]
|
2014-12-12 22:04:41 +00:00
|
|
|
then
|
|
|
|
find tests -type f -name "*Test.php" | \
|
|
|
|
parallel --gnu --keep-order \
|
|
|
|
"echo '== {} =='; \"$PHPUNIT\" $PHPUNIT_ARGS {};"
|
|
|
|
else
|
|
|
|
"$PHPUNIT" \
|
|
|
|
$PHPUNIT_ARGS \
|
|
|
|
--coverage-text \
|
|
|
|
--coverage-clover code_coverage/clover.xml \
|
|
|
|
--coverage-html code_coverage/
|
|
|
|
fi
|