Professional Documents
Culture Documents
Turism
Turism
txt
1.1 99/06/22
JCOV support in JDK1.3
Up to JDK1.2.x Jcov runtime support has been an integral part of the
debug version of the Javasoft's JVM, therefore it could not work with
any other JVMs. In JDK1.3 all Jcov support was isolated in a separate
library and implemented basing upon the Java Virtual Machine Profiler
Interface (JVMPI), so it theoretically can work with any JVM that
support JVMPI. This library is loaded by a JVM at its startup, if the
-Xrunjcov option is specified. For more information about how JVM finds
and loads libraries passed via the -Xrun<libname> JVM's option, please
consult JVMPI docs.
usage:
java [other java options] -Xrunjcov[:][help]|[<option>=<value>, ...] classname
where <option> is the name of an option, <value> is its value. The
recognized command-line options are :
include=<class name prefix>
makes Jcov profile only those classes whose names begin with given
class name prefix. This option may be specified multiple times - in
this case class name must satisfy at least one of the class name
prefixes to be profiled.
exclude=<class name prefix>
tells Jcov not to profile classes whose names begin with given
class name prefix. This option may be given multiple times - if a
class name satisfies at least one of the class name prefixes then
it will not be profiled.
type=<value>
value can be either B or M. Sets jcov data gathering mode : in B
mode method/block/branch coverage data is gathered, in M only
method coverage data is gathered. Default value is B.
file=<filename>
specifies savefile name, default - java.jcov.
Example 1.
> java -Xrunjcov class
This command will make Jcov profile all loaded classes which have the
CoverageTable class attribute (i.e. all loaded classes which had been
compiled with the -Xjcov compiler option) and save method/block/branch
coverage data to a file named java.jcov in current directory.
Example 2.
> java -Xrunjcov:include=java,exclude=java.lang,exclude=java.io,type=M,f
ile=/tmp/sys.jcov class
This command will make Jcov profile all classes from the java package
and its subpackages except java.lang and java.io, only method coverage
statistics will be gathered and saved to a file named sys.jcov' in the
/tmp directory.
Note that
1.JVM must not be run in debug mode (-Xdebug option must not be
specified), since Jcov cannot work correctly in this
JVM's mode.
2.When gathered data is saved to an existing Jcov data