1
0
mirror of synced 2024-12-05 03:06:05 +03:00

[2.0] Add generation of clover coverage report into testing target of build.xml

This commit is contained in:
beberlei 2010-02-07 00:13:22 +00:00
parent 0b058c0609
commit 3fdd9e537a
2 changed files with 9 additions and 2 deletions

View File

@ -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>

View File

@ -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());
}