Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7900497

Report generator invoked without the '-rel_links' generates incorrect links

XMLWordPrintable

    • 1.1
    • generic
    • generic
    • Verified



      Name: dkR10031 Date: 06/23/2003



      Current JCOV User Guide contains in section "B.6 Report Generator Syntax"
      description of the following feature:
      "-rel_links: Generate links to source files relative to the output
      directory. By default, absolute links are generated."

      However, current implementation of the Report Generator does
      not generate the absolute links.

      To reproduce this bug please run the following example using script
      below. This script contains the next stages:

       1. Compilation of the test source.
       2. Generation of the coverage file java.jcov using
          Dynamic Instrumenter.
       3. Generation of the report using the Report Generator
          called without '-rel_links' option.
       4. Looking for the 'test.java' words in report files using grep. Report
          files should contain absolute link to source file but they are not.


      -------------------------- test.java source begin --------------------
      public class test { // +
          public static void main(String[] args) {

              System.out.println("-----------");
              System.exit(0);
          }
      }
      -------------------------- test.java source end ----------------------
      -------------------------- script begin ------------------------------
      uname -a
      export TESTED_JAVA=/export/home/jdk1.4.1/linux/bin/java
      export TESTED_JAVAC=/export/home/jdk1.4.1/linux/bin/javac
      export
      JCOV_JAR=/export/home/gary/QA.JCOV/ws-test/test.linux-x86/lib/jcov.jar

      # Setting the classpath
      CLASSPATH=${JCOV_JAR}
      CLASSPATH=${CLASSPATH}:.
      export CLASSPATH

      $TESTED_JAVAC -Xjcov test.java

      # For the Dynamic Instrumentation mechanism: Instrument and execute the
      test program
      $TESTED_JAVA -showversion com.sun.tdk.jcov.collect.RunMain
      -savebefore=java.lang.System.exit test

      # Execute the Report Generator with the -fmt=html and without
      # the -rel_links options for the coverage data
      # generated by the Static Instrumenter
      $TESTED_JAVA -showversion com.sun.tdk.jcov.RepGenMain -fmt=html java.jcov

      grep 'test.java' *.html
      -------------------------- script end --------------------------------
      -------------------------- output begin ------------------------------
      [gary@linux-11 #xxxxxxxx(repgen and -rel_links)]# ./run.ksh
      Linux linux-11 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386
      GNU/Linux
      java version "1.4.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
      Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

      -----------
      java version "1.4.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
      Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

      test_hd.html:<H2 ALIGN=CENTER><A HREF="test.java">test</A></H2>
      test.html:<!-- generated from test.java -->
      -------------------------- output end --------------------------------

      ======================================================================

            afedorch Alexey Fedorchenko (Inactive)
            klooney Kevin Looney (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: