Commit 3fdd9e53 authored by beberlei's avatar beberlei

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

parent 0b058c06
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
--> -->
<nativephpunit <nativephpunit
testfile="./tests/Doctrine/Tests/AllTests.php" junitlogfile="${build.dir}/logs/testsuites.xml" 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" /> <phpunitreport infile="${build.dir}/logs/testsuites.xml" format="frames" todir="${report.dir}/tests" />
......
...@@ -114,6 +114,13 @@ class NativePhpunitTask extends Task ...@@ -114,6 +114,13 @@ class NativePhpunitTask extends Task
$this->log("PHPUnit Success: ".count($result->passed())." tests passed, no ". $this->log("PHPUnit Success: ".count($result->passed())." tests passed, no ".
"failures (".$result->skippedCount()." skipped, ".$result->notImplementedCount()." not implemented)"); "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) { } catch(\Exception $e) {
throw new BuildException("NativePhpunitTask failed: ".$e->getMessage()); throw new BuildException("NativePhpunitTask failed: ".$e->getMessage());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment