Enabling dynamic instrumented code coverage and generating statistics in the command line
You can enable code coverage and instrument your application
from the command line.
About this task
Procedure
- Configure your environment:
- Set the following environment variables:
- ECLIPSE_HOME - The installation directory for eclipse. If not defined, this environment variable defaults to the default Rational® installation directory.
- JAVA_HOME - The installation directory for Java™. <JAVA_HOME>/bin must contain java.exe. If not defined, this environment variable defaults to the default RAD JRE directory.
- Add the RLC.jar file to the classpath: <RAD_PLUGINS>\com.ibm.rational.llc.engine_<version&date>\RLC.jar)
- Set the following environment variables:
- Run the appinfo script: appinfo.bat/sh
-in <class-dir> -probescript <probescript-file> [-baseline <baseline-file>]
- <class-dir>: "Path separated" list of the directories which contain the class files that are to be analyzed.
- <probescript-file>: Probescript file output location.
- <baseline-file>: Baseline file output location. Use only if you intend to generate code coverage reports from outside the workbench.
- Run the program and generating the code coverage statistics: The general format of the command to run is:
The following examples use sample values for Windows and Linux:java -agentpath:<absolute_path_to_org.eclipse.tptp.platform.jvmti.runtime>/agent_files/<platform>/JPIBootLoader=JPIAgent:server=standalone,file=;ProbekitAgent:ext-pk-BCILibraryName=BCIEngProbe,ext-pk-probescript=<absolute_path_to_probescript> -Dcoverage.out.file=<absolute_path_to_output> -cp <path to RLC.jar> <class to execute>
- On Windows:
-agentpath:D:\Program Files\IBM\IBMIMShared\plugins\org.eclipse.tptp.platform.jvmti.runtime_4.6.0.v201005141900\agent_files\win_ia32\JPIBootLoader=JPIAgent:server=standalone,file=;ProbekitAgent:ext-pk-BCILibraryName=BCIEngProbe,ext-pk-probescript=${probescriptFile}
- On Linux:
agentpath:/opt/IBM/IBMIMShared/plugins/org.eclipse.tptp.platform.jvmti.runtime_4.6.0.v201005141900/agent_files/linux_ia32/libJPIBootLoader.so=JPIAgent:server=standalone,file=;ProbekitAgent:ext-pk-BCILibraryName=BCIEngProbe,ext-pk-probescript=${probescriptFile}
- On Windows:
Related concepts:
Related tasks:
Feedback