diff --git a/.scrutinizer.yml b/.scrutinizer.yml new file mode 100644 index 00000000..4ad008a5 --- /dev/null +++ b/.scrutinizer.yml @@ -0,0 +1,6 @@ +imports: + - php + +tools: + external_code_coverage: + runs: 5 # No Code Coverage on PHP 5.2 and HHVM diff --git a/.travis.yml b/.travis.yml index f979e558..7a782c7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: php +# When adding environments here, the number of runs specified in .scrutinizer.yml +# may have to be adjusted. php: - 5.3.3 - 5.3 @@ -24,4 +26,5 @@ script: - travis/run-phpunit.sh after_success: - - sh -c "if $TRAVIS_SECURE_ENV_VARS; then travis/upload-code-coverage.sh; fi" + - sh -c "if $TRAVIS_SECURE_ENV_VARS; then travis/upload-code-coverage-html.sh; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' != '5.2' -a '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then travis/upload-code-coverage-scrutinizer.sh; fi" diff --git a/travis/run-phpunit.sh b/travis/run-phpunit.sh index 013cf3ae..713e98da 100755 --- a/travis/run-phpunit.sh +++ b/travis/run-phpunit.sh @@ -24,4 +24,5 @@ fi $PHPUNIT_EXTRA_ARGS \ --verbose \ --coverage-text \ + --coverage-clover code_coverage/clover.xml \ --coverage-html code_coverage/ diff --git a/travis/upload-code-coverage.sh b/travis/upload-code-coverage-html.sh similarity index 100% rename from travis/upload-code-coverage.sh rename to travis/upload-code-coverage-html.sh diff --git a/travis/upload-code-coverage-scrutinizer.sh b/travis/upload-code-coverage-scrutinizer.sh new file mode 100755 index 00000000..efcff08c --- /dev/null +++ b/travis/upload-code-coverage-scrutinizer.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# This file is part of the phpseclib project. +# +# (c) Andreas Fischer +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +set -e + +wget https://scrutinizer-ci.com/ocular.phar +php ocular.phar code-coverage:upload --format=php-clover code_coverage/clover.xml