ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Blaukopf <daniel.blauk...@sun.com>
Subject Re: Recursive file matching
Date Fri, 22 Jul 2005 06:55:58 GMT
You can do it without ant-contrib:


       <pathconvert property="non-matched-files" setonempty="false">
           <path>
               <fileset dir="${dir}">
                   <include name="**/*.class"/>
                   <exclude name="**/*Test.class"/>
                   <present targetdir="${dir}" present="srconly">
                       <mapper type="glob" from="*.class" 
to="*Test.class"/>
                   </present>
               </fileset>
           </path>
       </pathconvert>
       <fail if="non-matched-files"/>

Juergen Hermann wrote:

>On Fri, 22 Jul 2005 03:40:36 +0200, Danilo Buerger wrote:
>
>  
>
>>is it possible to make sure that for each class a corresponding unit 
>>test class exist? For example:
>>    
>>
>
>  
>
>>For these two classes:
>>    
>>
>
>  
>
>>/xyz/main.class
>>/xyz/whatever.class
>>    
>>
>
>define this as a fileset, use a <mapper> to map to the test files, iterate 
>over it using antcontrib:for and finally use <available> and <fail unless=>
in 
>the for loop body. ain't it easy?
>
>or better, use something like Clover which does a much more stronger check 
>than "a file exists which looks like a test case".
>
>Ciao, J├╝rgen
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message