diff --git a/.atoum.php b/.atoum.php index f8f8de2..207a2e2 100644 --- a/.atoum.php +++ b/.atoum.php @@ -1,16 +1,29 @@ addDefaultReport(); +$runner->addTestsFromDirectory('tests/units'); -// fun -// $report->addField(new atoum\report\fields\runner\atoum\logo()); -// $report->addField(new atoum\report\fields\runner\result\logo()); +//coveralls.io only from travis-ci +if(getenv('TRAVIS')) { + $coveralls = new reports\asynchronous\coveralls('src', 'JbFBPr0Mz22rU3mCsvQhfs0ruvMzldcrk'); + $defaultFinder = $coveralls->getBranchFinder(); + $coveralls + ->setBranchFinder(function() use ($defaultFinder) { + if (($branch = getenv('TRAVIS_BRANCH')) === false) + { + $branch = $defaultFinder(); + } -// error -// $coverageField = new atoum\report\fields\runner\coverage\html('RREST', 'coverage'); -// $coverageField->setRootUrl('https://github.com/RETFU/RREST'); -// $report->addField($coverageField); + return $branch; + }) + ->setServiceName(getenv('TRAVIS') ? 'travis-ci' : null) + ->setServiceJobId(getenv('TRAVIS_JOB_ID') ?: null) + ->addDefaultWriter() + ; + $runner->addReport($coveralls); +} -$runner->addTestsFromDirectory('tests/units'); + +$report = $script->addDefaultReport(); diff --git a/README.md b/README.md index aa7f89a..4db4b1c 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ **RREST** build good REST API in PHP. [![Build Status](https://api.travis-ci.org/RETFU/RREST.svg?branch=master)](https://travis-ci.org/RETFU/RREST) +[![Coverage Status](https://coveralls.io/repos/github/RETFU/RREST/badge.svg?branch=master)](https://coveralls.io/github/RETFU/RREST?branch=master) ![WIP](https://img.shields.io/badge/unstable-master-red.svg) > Important: **RREST** is in active development. The API is not frozen and BC break can happen at any time.