Skip to content

Commit

Permalink
tests/travis: running code coverage & report to coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Apr 4, 2015
1 parent 72202ae commit 7254f09
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
5 changes: 5 additions & 0 deletions tests/.coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# for php-coveralls
service_name: travis-ci
src_dir: src
coverage_clover: coverage.xml
json_path: coverage.json

0 comments on commit 7254f09

Please sign in to comment.