Ignore a couple of files for code coverage that should not be covered;
add a simle run-tests script that steals some code from photon to return the code coverage at the end of the test execution (we're only at about 8% - lots of work left...)
This commit is contained in:
parent
002fa05c7f
commit
39ba5b37ef
12
phpunit.xml
12
phpunit.xml
@ -12,4 +12,16 @@
|
|||||||
<directory>test/IDF/</directory>
|
<directory>test/IDF/</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
|
|
||||||
|
<filter>
|
||||||
|
<whitelist>
|
||||||
|
<directory suffix=".php">src/IDF</directory>
|
||||||
|
<exclude>
|
||||||
|
<directory suffix=".php">src/IDF/Tests</directory>
|
||||||
|
<directory suffix=".php">src/IDF/conf</directory>
|
||||||
|
<file>src/IDF/version.php</file>
|
||||||
|
</exclude>
|
||||||
|
</whitelist>
|
||||||
|
</filter>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|
||||||
|
14
run-tests
Executable file
14
run-tests
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$xmlfile = dirname(__FILE__) .'/test/report.xml';
|
||||||
|
passthru('phpunit --coverage-clover='.$xmlfile);
|
||||||
|
$xml = simplexml_load_string(file_get_contents($xmlfile));
|
||||||
|
unlink($xmlfile);
|
||||||
|
printf(
|
||||||
|
'>>> code coverage %s/%s (%s%%)'."\n",
|
||||||
|
$xml->project->metrics['coveredstatements'],
|
||||||
|
$xml->project->metrics['statements'],
|
||||||
|
round(($xml->project->metrics['coveredstatements']/(float)$xml->project->metrics['statements']) * 100.0, 2)
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user