From 10050c1748ce78ec78afacb61356ae434f8b5757 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 12 Dec 2014 23:04:41 +0100 Subject: [PATCH] Run HHVM tests in parallel. --- .travis.yml | 1 + travis/run-phpunit.sh | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 03485d1b..e19f009c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ env: before_install: true install: + - sudo apt-get install parallel - eval `ssh-agent -s` - travis/setup-secure-shell.sh - sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then travis/install-php-extensions.sh; fi" diff --git a/travis/run-phpunit.sh b/travis/run-phpunit.sh index 713e98da..600a1d94 100755 --- a/travis/run-phpunit.sh +++ b/travis/run-phpunit.sh @@ -14,15 +14,21 @@ else PHPUNIT="$(dirname "$0")/../vendor/bin/phpunit" fi -PHPUNIT_EXTRA_ARGS='' +PHPUNIT_ARGS='--verbose' if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.4', '<');"` = "1" ] then - PHPUNIT_EXTRA_ARGS="$PHPUNIT_EXTRA_ARGS -d zend.enable_gc=0" + PHPUNIT_ARGS="$PHPUNIT_ARGS -d zend.enable_gc=0" fi -"$PHPUNIT" \ - $PHPUNIT_EXTRA_ARGS \ - --verbose \ - --coverage-text \ - --coverage-clover code_coverage/clover.xml \ - --coverage-html code_coverage/ +if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] +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