3

I am using Corbetura-2.0.3 with java 1.7 and I am trying to instrument the classes in our build system via command line. Stuck at instrumenting classes. Please assist.

Here is the command:

./cobertura-instrument.sh --basedir /ariba/9r2_sourcing/roots-S49r2/install/classes/ariba.app.approvable.zip --destination /ariba/9r2_sourcing/Instrument -auxClasspath /ariba/9r2_sourcing/roots-S49r2/install/classes

Wherein,
/ariba/9r2_sourcing/roots-S49r2/install/classes/ariba.app.approvable.zip – zip containing classes which I would like to instrument
/ariba/9r2_sourcing/Instrument – Folder to save instrumented classes
/ariba/9r2_sourcing/roots-S49r2/install/classes – path where all other reference classes are present.

Output:

    -bash-4.1$ ./cobertura-instrument.sh --basedir /ariba/9r2_sourcing/roots-S49r2/install/classes/ariba.app.approvable.zip --destination /ariba/9r2_sourcing/Instrument -auxClasspath /ariba/9r2_sourcing/roots-S49r2/install/classes
    Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
    Apr 29, 2014 4:53:27 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData
    INFO: Cobertura: Loaded information on 0 classes.
    Apr 29, 2014 4:53:27 AM net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler saveCoverageData
    INFO: Cobertura: Saved information on 0 classes.

Also tried with:

  • ‘archivesdepth’ parameter as well; it gives the same above error.
  • I have updated the ‘cobertura-instrument.sh’ file with the right versions of jars present in Cobertura installed location.
4

1 回答 1

0

我明白了,在命令中你没有提到你需要检测的类。

示例:以下命令有效。

sh cobertura-instrument.sh --basedir `pwd` GenerateReports.class My_lib.class

注意
需要将类作为完整的文件名(例如 mycls.class)
提及 -auxClasspath:添加 cobertura 在检测期间无法找到的任何类/jar,即要从覆盖范围中排除的类

于 2016-02-08T10:55:02.897 回答