Linus
Linus

Reputation: 23

Clover coverage with Phing

Is there a way to get Phing to output it's coverage report in clover format?

I know phpunit has --coverage-clover but I don't know how to enable this option from Phing.

I do not want to manually use the <exec command - it defeats the point of Phing.

I am using Phing 2.4RC2

Thanks.

Upvotes: 2

Views: 1971

Answers (2)

Michiel
Michiel

Reputation: 171

Phing supports output to clover format from version 2.4, see http://www.phing.info/docs/stable/hlhtml/index.html#d5e12507

<phpunit codecoverage="true">
    <formatter type="clover" outfile="clover.xml"/>
    <!-- ... -->
</phpunit>

Upvotes: 4

Linus
Linus

Reputation: 26

I did some research and Phing doesn't support Clover coverage, you have to use exec.

Here is my exec command:

<exec command="phpunit --bootstrap=${project}/test/bootstrap.php --log-junit ${report}/logfile.xml --coverage-clover ${report}/coverage/clover.xml --coverage-source ${report}/coverage --coverage-html ${report}/coverage-html/ ${project}test/*"/>

Upvotes: 1

Related Questions