[2.0] Add generation of clover coverage report into testing target of build.xml
This commit is contained in:
parent
0b058c0609
commit
3fdd9e537a
@ -134,7 +134,7 @@
|
||||
-->
|
||||
<nativephpunit
|
||||
testfile="./tests/Doctrine/Tests/AllTests.php" junitlogfile="${build.dir}/logs/testsuites.xml"
|
||||
testdirectory="./tests"
|
||||
testdirectory="./tests" coverageclover="${build.dir}/logs/clover.xml"
|
||||
/>
|
||||
<phpunitreport infile="${build.dir}/logs/testsuites.xml" format="frames" todir="${report.dir}/tests" />
|
||||
|
||||
@ -213,4 +213,4 @@
|
||||
</d51pearpkg2>
|
||||
<tar destfile="${dist.dir}/DoctrineORM-${version_name}.tgz" basedir="${build.dir}/orm" compression="gzip" />
|
||||
</target>
|
||||
</project>
|
||||
</project>
|
||||
|
@ -114,6 +114,13 @@ class NativePhpunitTask extends Task
|
||||
$this->log("PHPUnit Success: ".count($result->passed())." tests passed, no ".
|
||||
"failures (".$result->skippedCount()." skipped, ".$result->notImplementedCount()." not implemented)");
|
||||
|
||||
if (file_exists($this->coverageClover)) {
|
||||
$content = file_get_contents($this->coverageClover);
|
||||
$content = str_replace("\\", ".", $content);
|
||||
file_put_contents($this->coverageClover, $content);
|
||||
unset($content);
|
||||
}
|
||||
|
||||
} catch(\Exception $e) {
|
||||
throw new BuildException("NativePhpunitTask failed: ".$e->getMessage());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user