From 9267e281f51f8240916948bee7c2fd09a50572fa Mon Sep 17 00:00:00 2001 From: El RIDO Date: Tue, 5 Jul 2016 17:01:26 +0200 Subject: [PATCH] adding support for automatic code coverage generation into codacy --- .gitignore | 4 +++- .travis.yml | 17 +++++++++++++---- composer.json | 5 +++++ tst/README.md | 2 +- tst/phpunit.xml | 1 + 5 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 composer.json diff --git a/.gitignore b/.gitignore index 3a08afe..9a3d92c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,14 @@ -# Ignore data/ and tmp/ +# Ignore data/, tmp/ and vendor/ data/ tmp/ +vendor/ # Ignore for safety .htaccess .htpasswd # Ignore unit testing logs, api docs and eclipse project files tst/log/ doc/ +composer.lock .settings .buildpath .project diff --git a/.travis.yml b/.travis.yml index a71804a..ebd3340 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,17 @@ language: php sudo: false php: - - 5.5 - - 5.6 - - 7.0 + - 5.5 + - 5.6 + - 7.0 + - hhvm + +before_script: + - curl -s http://getcomposer.org/installer | php + - php composer.phar install -n + script: - - cd tst && phpunit + - cd tst && phpunit + +after_script: + - php vendor/bin/codacycoverage clover tst/log/coverage-clover.xml diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..9f8a3bc --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ + "require-dev": { + "codacy/coverage": "dev-master" + } +} diff --git a/tst/README.md b/tst/README.md index ad21697..0ccdb4c 100644 --- a/tst/README.md +++ b/tst/README.md @@ -9,7 +9,7 @@ and its dependencies: * php5-xdebug Example for Debian and Ubuntu: - $ sudo aptitude install phpunit php5-mysql php5-xdebug + $ sudo aptitude install phpunit php5-gd php5-sqlite php5-xdebug To run the tests, just change into this directory and run phpunit: $ cd ZeroBin/tst diff --git a/tst/phpunit.xml b/tst/phpunit.xml index 4ef7c2c..660752d 100644 --- a/tst/phpunit.xml +++ b/tst/phpunit.xml @@ -12,6 +12,7 @@ +