- Made the following goals public by documenting them: <code>clover:report</code>, <code>clover:on</code>, <code>clover:off</code>, <code>clover:test</code>, <code>clover:test-single</code>

- Added new <code>clover:test-single</code> goal to execute a single test case and to view the test coverage result directly using the Clover Swing viewer. This is useful if you wish to quickly see the action that a single unit test has on the code it tests.


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115838 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
vmassol 2004-07-16 18:36:26 +00:00
parent 3e136f2c14
commit 52892d03bf
3 changed files with 94 additions and 9 deletions

View File

@ -92,7 +92,8 @@
need to call clover:off to reset them as they were initially.
========================================================================
-->
<goal name="clover:on" prereqs="clover:init">
<goal name="clover:on" prereqs="clover:init"
description="Activates Clover">
<!-- Save properties so that they can be reset afterwards -->
<maven:get var="ignoreTestFailureOld" plugin="maven-test-plugin"
@ -166,7 +167,7 @@
the call to clover:on.
========================================================================
-->
<goal name="clover:off">
<goal name="clover:off" description="Deactivates Clover">
<j:set var="maven.build.dest" value="${mavenBuildDestTestOld}" scope="parent" />
${context.removeVariable('build.compiler')}
@ -186,7 +187,8 @@
data.
========================================================================
-->
<goal name="clover:test">
<goal name="clover:test"
description="Compile project code with Clover and executes the unit tests">
<!-- Only run clover if there are tests to execute -->
<j:choose>
@ -202,13 +204,38 @@
</goal>
<!--
========================================================================
Execute unit tests and Clover on a single class and generate a Swing
clover report. Need to pass the "testcase" property
(maven -Dtestcase=myclass).
========================================================================
-->
<goal name="clover:test-single"
description="Compile code with Clover and execute a single unit test"
<j:choose>
<j:when test="${unitTestSourcesPresent == 'true'}">
<attainGoal name="clover:on"/>
<attainGoal name="test:single"/>
<attainGoal name="clover:swing-report-internal"/>
<attainGoal name="clover:off"/>
</j:when>
<j:otherwise>
<ant:echo>No tests to run Clover on</ant:echo>
</j:otherwise>
</j:choose>
</goal>
<!--
========================================================================
Generate test coverage reports. It decides what kind of reports should
be generated.
========================================================================
-->
<goal name="clover:report" prereqs="clover:on">
<goal name="clover:report" prereqs="clover:on"
description="Generates the Clover reports"
<!-- Skip reports if no coverage database has been created. -->
<u:file var="cloverDatabaseAsFile" name="${cloverDatabase}"/>

View File

@ -26,6 +26,18 @@
</properties>
<body>
<release version="1.6-SNAPSHOT" date="in CVS">
<action dev="vmassol" type="update">
Made the following goals public by documenting them:
<code>clover:report</code>, <code>clover:on</code>,
<code>clover:off</code>, <code>clover:test</code>,
<code>clover:test-single</code>.
</action>
<action dev="vmassol" type="add" issue="MPCLOVER-9">
Added new <code>clover:test-single</code> goal to execute a single test
case and to view the test coverage result directly using the Clover
Swing viewer. This is useful if you wish to quickly see the action that
a single unit test has on the code it tests.
</action>
<action dev="vmassol" type="fix" issue="MPCLOVER-19">
Now using <code>maven:get</code> and <code>maven:set</code>.
</action>

View File

@ -41,20 +41,66 @@
<goal>
<name>clover</name>
<description>
This is the default goal. Does the same as the
This is the default goal. It compiles the project code with Clover,
executes the unit tests and generate Clover reports by calling the
<code>clover:report</code> goal.
</description>
</goal>
<goal>
<name>clover:test</name>
<description>
Compiles the project code with Clover and executes the unit tests.
</description>
</goal>
<goal>
<name>clover:test-single</name>
<description>
Execute a single unit test and view the test coverage result directly
using the Clover Swing viewer. This is useful if you wish to quickly
see the action that a single unit test has on the code it tests.
</description>
</goal>
<goal>
<name>clover:report</name>
<description>
Generate Clover test coverage reports with Clover. There are 3
possible reports: HTML, XML or Swing. Whether a report is generated
is controller by the <code>maven.clover.report.[report name]</code>
<a href="properties.html">properties</a>. Before generating a
report, the goal recompiles the source code with Clover and reruns
the unit tests. The generated reports show exactly what lines of
your code were exercised by your tests.
<a href="properties.html">properties</a>. The generated reports show
exactly what lines of your code were exercised by your tests.
</description>
</goal>
<goal>
<name>clover:xml-report</name>
<description>
Generate an XML test coverage report with Clover.
</description>
</goal>
<goal>
<name>clover:html-report</name>
<description>
Generate an HTML test coverage report with Clover.
</description>
</goal>
<goal>
<name>clover:swing-report</name>
<description>
Generate a Swing test coverage report with Clover.
</description>
</goal>
<goal>
<name>clover:on</name>
<description>
Activates Clover, which means that any other plugin calling the Ant
<code>javac</code> task will find its code compiled with Clover. This
is useful for example to Clover Cactus tests:
<code>maven clover:on cactus</code>.
</description>
</goal>
<goal>
<name>clover:off</name>
<description>
Deactivates Clover, resetting back the normal <code>javac</code> compiler.
</description>
</goal>
</goals>