Derby
  1. Derby
  2. DERBY-5512

emma-single and emma-all don't use the instrumented jars

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.9.1.0
    • Fix Version/s: 10.9.1.0
    • Component/s: Build tools, Test
    • Labels:
      None

      Description

      When running the Ant targets that produce code coverage reports for the JUnit tests, the reports are empty:

      $ ant -Dderby.junit.testclass=org.apache.derbyTesting.functionTests.tests.lang.CommentTest emma-single 2>&1
      (...)
      emma-report:
      [report] [EMMA v2.0, build 5312 (2005/06/12 19:32:43)]
      [report] input data path:
      [report]

      { [report] /code/derby/trunk/junit_20111123_1751/coverage.em [report] }

      [report] source path:
      [report]

      { [report] /code/derby/trunk/java/client [report] /code/derby/trunk/java/demo [report] /code/derby/trunk/java/drda [report] /code/derby/trunk/java/engine [report] /code/derby/trunk/java/shared [report] /code/derby/trunk/java/storeless [report] /code/derby/trunk/java/tools [report] }

      [report] processing input file [/code/derby/trunk/junit_20111123_1751/coverage.em] ...
      [report] loaded 1542 metadata entries
      [report] 1 file(s) read and merged in 194 ms
      [report] nothing to do: no runtime coverage data found in any of the data files
      (...)

      Running Ant with the -v option revealed that the JUnit test was run with the uninstrumented jar files. I suspect that this is because DERBY-4089 made the build script set derby.junit.classpath automatically if it's not already set. Since Ant properties cannot be changed once they've been assigned a value, this prevents the emma-instrumentation target from building a derby.junit.classpath that points to the instrumented jars.

      1. d5512.diff
        0.8 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          16h 2m 1 Knut Anders Hatlen 24/Nov/11 08:59
          Gavin made changes -
          Workflow jira [ 12643208 ] Default workflow, editable Closed status [ 12796807 ]
          Knut Anders Hatlen made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Fix Version/s 10.9.0.0 [ 12316344 ]
          Resolution Fixed [ 1 ]
          Hide
          Knut Anders Hatlen added a comment -

          Committed revision 1205760.

          Show
          Knut Anders Hatlen added a comment - Committed revision 1205760.
          Knut Anders Hatlen made changes -
          Attachment d5512.diff [ 12504892 ]
          Hide
          Knut Anders Hatlen added a comment -

          Attaching a patch that makes emma-instrumentation depend on junit-init-nocp instead of junit-init. junit-init-nocp does essentially the same as what junit-init did before DERBY-4089, and it skips the automatic classpath configuration so that emma-instrumentation can set the classpath the way it wants. I now get a code coverage report when I run emma-single.

          Show
          Knut Anders Hatlen added a comment - Attaching a patch that makes emma-instrumentation depend on junit-init-nocp instead of junit-init. junit-init-nocp does essentially the same as what junit-init did before DERBY-4089 , and it skips the automatic classpath configuration so that emma-instrumentation can set the classpath the way it wants. I now get a code coverage report when I run emma-single.
          Knut Anders Hatlen made changes -
          Field Original Value New Value
          Link This issue is broken by DERBY-4089 [ DERBY-4089 ]
          Knut Anders Hatlen created issue -

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development