FOP
  1. FOP
  2. FOP-1991

[PATCH] A code-coverage tool for code analysis

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Component/s: unqualified
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: PC
    • External issue ID:
      52151

      Description

      This patch adds a code-coverage ant task in jacoco.xml such that the invoking command would be:
      ant -f jacoco.xml clean code-coverage

      This, like the find-bugs task, requires that $

      {jacoco.lib}

      property is set best done in a build-local.properties file.

      Jacoco is the successor to Emma, which is a well established code analysis tool

      1. jacoco.patch
        9 kB
        Mehdi Houshmand
      2. jacoco.patch
        7 kB
        Mehdi Houshmand

        Activity

        Hide
        Vincent Hennebert added a comment -

        Patch applied in rev. 1203749:
        http://svn.apache.org/viewvc?rev=1203749&view=rev

        I made the following changes to jacoco.xml:

        • removed unnecessary ivy namespace declaration
        • removed unused result.jacoco.report property
        • renamed jacoco report dir to report_jacoco to follow the same pattern as the other tools (Checkstyle, FindBugs, etc.)
        • changed classpath of task definition to only include $ {jacocoant.jar}
        • removed unused errorproperty and failureproperty from junit task
        • removed unnecessary JUnit formatters: I think we can safely assume that, prior to getting coverage report, 'ant junit' has been run and that tests passed
        • removed unnecessary merging of jacoco execution data since only one file is generated
        • renamed targets to more descriptive names and added description to coverage-report target so that it appears when running ant -p
        • other small clean ups

        Thanks,
        Vincent

        Show
        Vincent Hennebert added a comment - Patch applied in rev. 1203749: http://svn.apache.org/viewvc?rev=1203749&view=rev I made the following changes to jacoco.xml: removed unnecessary ivy namespace declaration removed unused result.jacoco.report property renamed jacoco report dir to report_jacoco to follow the same pattern as the other tools (Checkstyle, FindBugs, etc.) changed classpath of task definition to only include $ {jacocoant.jar} removed unused errorproperty and failureproperty from junit task removed unnecessary JUnit formatters: I think we can safely assume that, prior to getting coverage report, 'ant junit' has been run and that tests passed removed unnecessary merging of jacoco execution data since only one file is generated renamed targets to more descriptive names and added description to coverage-report target so that it appears when running ant -p other small clean ups Thanks, Vincent
        Hide
        Mehdi Houshmand added a comment -

        Made the changes requested

        Show
        Mehdi Houshmand added a comment - Made the changes requested
        Hide
        Mehdi Houshmand added a comment -

        Attachment jacoco.patch has been added with description: code coverage tool

        Show
        Mehdi Houshmand added a comment - Attachment jacoco.patch has been added with description: code coverage tool
        Hide
        Vincent Hennebert added a comment -

        Hi Mehdi,

        There's no jacoco.xml in the patch?

        Also, I assume you changed the hyphenation test so that it matches the *TestCase pattern. This is a good idea but setting the system property in the getParameters method probably is a bit too much magic. Plus you have to reset the property afterwards, which is brittle. Maybe the LayoutEngingTestUtils.getLayoutTestFiles method should be overloaded with a parameter that directly sets the test set instead of getting it from a system property.

        Small detail in the junit-compile-copy-resources task in build.xml: by using the '*/' pattern the Java files will also be copied, which will create unnecessary I/O.

        Thanks,
        Vincent

        Show
        Vincent Hennebert added a comment - Hi Mehdi, There's no jacoco.xml in the patch? Also, I assume you changed the hyphenation test so that it matches the *TestCase pattern. This is a good idea but setting the system property in the getParameters method probably is a bit too much magic. Plus you have to reset the property afterwards, which is brittle. Maybe the LayoutEngingTestUtils.getLayoutTestFiles method should be overloaded with a parameter that directly sets the test set instead of getting it from a system property. Small detail in the junit-compile-copy-resources task in build.xml: by using the '* / ' pattern the Java files will also be copied, which will create unnecessary I/O. Thanks, Vincent
        Hide
        Mehdi Houshmand added a comment -

        Attachment jacoco.patch has been added with description: jacoco code coverage

        Show
        Mehdi Houshmand added a comment - Attachment jacoco.patch has been added with description: jacoco code coverage

          People

          • Assignee:
            fop-dev
            Reporter:
            Mehdi Houshmand
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development