【问题标题】:Cobertura 2.0.3 - unable to instrumentCobertura 2.0.3 - 无法检测
【发布时间】:2014-06-16 01:46:16
【问题描述】:

我正在使用带有 java 1.7 的 Corbetura-2.0.3,并且我正在尝试通过命令行在我们的构建系统中检测类。卡在仪表类。请帮忙。

命令如下:

./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

其中,
/ariba/9r2_sourcing/roots-S49r2/install/classes/ariba.app.approvable.zip – 包含我想要检测的类的 zip
/ariba/9r2_sourcing/Instrument – 用于保存检测类的文件夹
/ariba/9r2_sourcing/roots-S49r2/install/classes - 存在所有其他参考类的路径。

输出:

-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 许可证(无担保) - 请参阅版权文件 2014 年 4 月 29 日上午 4:53:27 net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler loadCoverageData 信息:Cobertura:加载了 0 个类的信息。 2014 年 4 月 29 日上午 4:53:27 net.sourceforge.cobertura.coveragedata.CoverageDataFileHandler saveCoverageData 信息:Cobertura:保存了 0 个班级的信息。

也尝试过:

  • ‘archivesdepth’参数;它给出了与上述相同的错误。
  • 我已使用 Cobertura 安装位置中存在的正确版本的 jar 更新了“cobertura-instrument.sh”文件。

【问题讨论】:

    标签: java test-coverage cobertura


    【解决方案1】:

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

    示例:以下命令有效。

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-21
      • 1970-01-01
      • 2016-07-28
      • 1970-01-01
      • 2017-05-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多