home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 June / june_2001.iso / Tools / StockNChart / setup.exe / disk1 / data1.cab / Program_Executable_Files / lib / jvm.jcov.txt < prev    next >
Encoding:
Text File  |  2000-06-02  |  3.4 KB  |  76 lines

  1. version : @(#)jvm.jcov.txt    1.1 99/06/22
  2.         JCOV support in JDK1.3
  3.  
  4. Up to JDK1.2.x Jcov runtime support has been an integral part of the
  5. debug version of the Javasoft's JVM, therefore it could not work with
  6. any other JVMs. In JDK1.3 all Jcov support was isolated in a separate
  7. library and implemented basing upon the Java Virtual Machine Profiler
  8. Interface (JVMPI), so it theoretically can work with any JVM that
  9. support JVMPI. This library is loaded by a JVM at its startup, if the
  10. -Xrunjcov option is specified. For more information about how JVM finds
  11. and loads libraries passed via the -Xrun<libname> JVM's option, please
  12. consult JVMPI docs.
  13.  
  14. usage:
  15.  
  16. java [other java options] -Xrunjcov[:][help]|[<option>=<value>, ...] classname
  17.  
  18. where <option> is the name of an option, <value> is its value. The
  19. recognized command-line options are :
  20.  
  21. include=<class name prefix>
  22.     makes Jcov profile only those classes whose names begin with given
  23.     class name prefix. This option may be specified multiple times - in
  24.     this case class name must satisfy at least one of the class name
  25.     prefixes to be profiled.
  26. exclude=<class name prefix>
  27.     tells Jcov not to profile classes whose names begin with given
  28.     class name prefix. This option may be given multiple times - if a
  29.     class name satisfies at least one of the class name prefixes then
  30.     it will not be profiled.
  31. type=<value>
  32.     value can be either B or M. Sets jcov data gathering mode : in B
  33.     mode method/block/branch coverage data is gathered, in M only
  34.     method coverage data is gathered. Default value is B.
  35. file=<filename>
  36.     specifies savefile name, default - java.jcov.
  37.  
  38. Example 1.
  39.     > java -Xrunjcov class
  40.  
  41. This command will make Jcov profile all loaded classes which have the
  42. CoverageTable class attribute (i.e. all loaded classes which had been
  43. compiled with the -Xjcov compiler option) and save method/block/branch
  44. coverage data to a file named java.jcov in current directory.
  45.  
  46. Example 2.
  47.     > java -Xrunjcov:include=java,exclude=java.lang,exclude=java.io,type=M,file=/tmp/sys.jcov class
  48.  
  49. This command will make Jcov profile all classes from the java package
  50. and its subpackages except java.lang and java.io, only method coverage
  51. statistics will be gathered and saved to a file named sys.jcov' in the
  52. /tmp directory.
  53.  
  54. Note that
  55.  
  56.   1.JVM must not be run in debug mode (-Xdebug option must not be
  57.     specified), since Jcov cannot work correctly in this
  58.     JVM's mode.  
  59.   2.When gathered data is saved to an existing Jcov data
  60.     file, then it is merged (on per-class basis) with the corresponding
  61.     data found in the file. If the data types of two classes being
  62.     merged don't match, then both classes are saved in the resulting
  63.     jcov data file.
  64.   3.For Jcov to work correctly any JIT compiler must be turned off (for
  65.     example, by specifying the -Djava.compiler=NONE JVM's option)
  66.   4.If a class or an interface contains only abstract methods then it will
  67.     not be profiled at all (i.e. no code coverage data will be gathered
  68.     for it). 
  69.   5.Only non-abstract methods are profiled.
  70.   6.If data gathering mode is set to B then those classes, having no
  71.     CoverageTable class attribute, will not be profiled.
  72.   7.For Jcov to be able to gather block/branch coverage data for a certain
  73.     class, this class must have CoverageTable class attribute. This can be
  74.     achived by compiling this class with the -prof=jcov (JDK1.1 - JDK
  75.     1.1.x) option or the -Xjcov (JDK1.2 - JDK 1.2.x) option.
  76.