diff --git a/.travis.yml b/.travis.yml index 2dde430f..a640462a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ matrix: - php: 7 - php: hhvm-nightly -script: ./tests/run.sh -s ./tests/cases +script: ./tests/run.sh -s $NTESTER_FLAGS ./tests/cases after_failure: # Print *.actual content & log content @@ -28,6 +28,9 @@ before_script: - cp ./tests/config.sample.neon ./tests/config.neon - cp ./tests/php-unix.ini ./tests/php.ini + - if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then cat ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini >> ./tests/php.ini; fi + - if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then NTESTER_FLAGS="--coverage ./coverage.xml --coverage-src ./src"; else TESTER_FLAGS=""; fi + - if [ "$TRAVIS_PHP_VERSION" == "hhvm" -o "$TRAVIS_PHP_VERSION" == "hhvm-nightly" ]; then cp ./tests/sections.hhvm.ini ./tests/sections.ini; fi - if ! [ "$TRAVIS_PHP_VERSION" == "hhvm" -o "$TRAVIS_PHP_VERSION" == "hhvm-nightly" ]; then cp ./tests/sections.sample.ini ./tests/sections.ini; fi @@ -36,3 +39,7 @@ before_script: - mysql -e 'CREATE DATABASE nextras_orm_test;' - mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql + +after_script: + - if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then composer require satooshi/php-coveralls; fi + - if [ "$TRAVIS_PHP_VERSION" == "5.6" ]; then php vendor/bin/coveralls -c tests/.coveralls.yml -v; fi diff --git a/README.md b/README.md index 0f4bea39..05b021cf 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Nextras\Orm [![Build Status](https://travis-ci.org/nextras/orm.svg?branch=master)](https://travis-ci.org/nextras/orm) [![Downloads this Month](https://img.shields.io/packagist/dm/nextras/orm.svg?style=flat)](https://packagist.org/packages/nextras/orm) [![Stable version](http://img.shields.io/packagist/v/nextras/orm.svg?style=flat)](https://packagist.org/packages/nextras/orm) +[![Code coverage](https://img.shields.io/coveralls/nextras/orm.svg?style=flat)](https://coveralls.io/r/nextras/orm) [![HHVM Status](http://img.shields.io/hhvm/nextras/orm.svg?style=flat)](http://hhvm.h4cc.de/package/nextras/orm) ### Installation diff --git a/composer.json b/composer.json index 353517a2..ab3d2021 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require-dev": { "tracy/tracy": "~2.3", "nette/bootstrap": "~2.3", - "nette/tester": "~1.3", + "nette/tester": "~1.4", "mockery/mockery": "~0.9" }, "autoload": { diff --git a/tests/.coveralls.yml b/tests/.coveralls.yml new file mode 100644 index 00000000..25f8e345 --- /dev/null +++ b/tests/.coveralls.yml @@ -0,0 +1,5 @@ +# for php-coveralls +service_name: travis-ci +src_dir: src +coverage_clover: coverage.xml +json_path: coverage.json