Uploaded image for project: 'Clover'
  1. Clover
  2. CLOV-918

<fileset> in <current> report does not get resolved correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 3.0 M5, 3.0
    • 3.0 M4
    • None
    • None

    Description

      A customer is trying to gather coverage info across multiple "projects" with ant. All projects are writing into the same clover database and then using an ant macro we try to generate reports on a per project basis:

      <macrodef name="clover2xml">
              <attribute name="projectName"  />
              <sequential>
      			<clover-report initstring="${initstring}">
      				<current outfile="@{projectName}_clover.xml">
      					 <fileset dir="../@{projectName}/src" includes="**/*.java"/>
      				</current>	
      			</clover-report>
      			<echo message="@{projectName}" />
              </sequential>
      </macrodef>
      

      The problem is that the fileset is not working correctly.

      Chat with Nick:

      it seems we have a problem with fuzzyMatch:

          private boolean fuzzyMatch(FileInfo fileInfo) {
              final Set<String> paths = fileNamesToPaths.get(fileInfo.getName());
              if (paths != null) {
                  final String packagePath = fileInfo.getPackagePath();
                  for (String path : paths) {
                      if (path.endsWith(packagePath)) {
                          return true;
                      }
                  }
              }
              return false;
          } 
      

      we are doing our best, to detect where a package name ends/starts in relation to a directory
      the accept logic is:

       if (exactMatch(fileInfo) || fuzzyMatch(fileInfo)) { 

      we may need another option to not try and fuzzyMatch... or, we remove it altogether
      here are some fuzzy matching fails:
      [clover-report] TRYING TO FUZZY MATCH = /Users/niick/Downloads/clv-5397/CLV-5397_2/src/bar1/Test1.java
      [clover-report] FUZZY MATCHED PACKAGE path = /Users/niick/Downloads/clv-5397/CLV-5397_1/src/foo/Test1.java

      and: [clover-report] TRYING TO FUZZY MATCH = /Users/niick/Downloads/clv-5397/CLV-5397_2/src/bar2/Test2.java
      [clover-report] FUZZY MATCHED PACKAGE path = /Users/niick/Downloads/clv-5397/CLV-5397_1/src/foo/Test2.java

      Attachments

        Activity

          People

            mstudman Michael Studman (Inactive)
            andrew.myers Andrew Myers [Atlassian]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: