mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-23 15:06:53 +00:00
Add a script to check the coverage of the tests and the configuration for phpunit.
This commit is contained in:
parent
d097a872fe
commit
206d29d52d
34
tests/coverageTest.php
Normal file
34
tests/coverageTest.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
require_once 'lib/RssBridge.php';
|
||||
|
||||
|
||||
Bridge::setDir('bridges/');
|
||||
Format::setDir('formats/');
|
||||
Cache::setDir('caches/');
|
||||
|
||||
class coverageTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
public function testCoverage() {
|
||||
|
||||
$covered = true;
|
||||
|
||||
foreach(Bridge::listBridges() as $bridgeName) {
|
||||
|
||||
$testPath = 'tests/' . $bridgeName . 'Test.php';
|
||||
if(!file_exists($testPath)) {
|
||||
echo 'Bridge ' . $bridgeName . ' does not have a test !' . "\n";
|
||||
$covered = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($covered) {
|
||||
$this->success('Everything is covered !');
|
||||
} else {
|
||||
$this->fail('Some bridges are missing tests !');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
12
tests/phpunit.xml
Normal file
12
tests/phpunit.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
|
||||
|
||||
colors="true"
|
||||
bootstrap="../lib/Tests.php"
|
||||
processIsolation="true"
|
||||
timeoutForSmallTests="1"
|
||||
timeoutForMediumTests="1"
|
||||
timeoutForLargeTests="6" >
|
||||
|
||||
</phpunit>
|
Loading…
Reference in New Issue
Block a user