Do not execute Clover if there are no tests to run Clover on. This prevents an error happening in the <code>clover:on</code> goal.

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115093 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
vmassol 2004-04-30 08:21:06 +00:00
parent b11afec96f
commit c48891dd9f
2 changed files with 41 additions and 17 deletions

View File

@ -184,9 +184,17 @@
--> -->
<goal name="clover:test"> <goal name="clover:test">
<!-- Only run clover if there are tests to execute -->
<j:choose>
<j:when test="${unitTestSourcesPresent == 'true'}">
<attainGoal name="clover:on"/> <attainGoal name="clover:on"/>
<attainGoal name="test:test"/> <attainGoal name="test:test"/>
<attainGoal name="clover:off"/> <attainGoal name="clover:off"/>
</j:when>
<j:otherwise>
<ant:echo>No tests to run Clover on</ant:echo>
</j:otherwise>
</j:choose>
</goal> </goal>
@ -196,7 +204,12 @@
be generated. be generated.
======================================================================== ========================================================================
--> -->
<goal name="clover:report" prereqs="clover:test"> <goal name="clover:report">
<j:choose>
<j:when test="${unitTestSourcesPresent == 'true'}">
<attainGoal name="clover:test"/>
<!-- Skip reports if no coverage database has been created. --> <!-- Skip reports if no coverage database has been created. -->
<u:file var="cloverDatabaseAsFile" name="${cloverDatabase}"/> <u:file var="cloverDatabaseAsFile" name="${cloverDatabase}"/>
@ -219,6 +232,12 @@
</j:otherwise> </j:otherwise>
</j:choose> </j:choose>
</j:when>
<j:otherwise>
<ant:echo>No tests to run Clover on</ant:echo>
</j:otherwise>
</j:choose>
</goal> </goal>
<!-- <!--

View File

@ -1,4 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!-- <!--
/* /*
* Copyright 2001-2004 The Apache Software Foundation. * Copyright 2001-2004 The Apache Software Foundation.
@ -28,6 +29,10 @@
<body> <body>
<release version="1.5" date="in CVS"> <release version="1.5" date="in CVS">
<action dev="vmassol" type="fix">
Do not execute Clover if there are no tests to run Clover on. This
prevents an error happening in the <code>clover:on</code> goal.
</action>
<action dev="vmassol" type="update"> <action dev="vmassol" type="update">
Allow generating XML and/or Swing reports during the web site generation Allow generating XML and/or Swing reports during the web site generation
too. too.