我一直在尝试为我的 android 测试项目生成 android 代码覆盖率,该项目测试一个包含外部 jar 的 android 项目。当我运行命令时
ant emma install debug test
它仅显示了 android 项目的覆盖范围,但不包括包含的外部 jar 的包和功能。根据我的研究,我发现应该在ant.properties
文件和emma report tag
.build.xml
任何建议都非常受欢迎。
[编辑]
在进一步研究中,我浏览了一个博客,上面写着输入变量
tested.android.library.source.dir="path to external jars" in ant.properties
并且应该在报告源路径中添加相同的变量
<emma>
<report sourcepath="${tested.project.source.absolute.dir}:${tested.project.lib.source.path.value}:${tested.android.library.source.dir}" verbosity="${verbosity}">
<!-- TODO: report.dir or something like should be introduced if necessary -->
<infileset file="${out.absolute.dir}/coverage.ec" />
<infileset file="${tested.project.out.absolute.dir}/coverage.em" />
<!-- TODO: reports in other, indicated by user formats -->
<html outfile="${out.absolute.dir}/coverage.html" />
</report>
</emma>
但仍然没有显示外部 jar 的功能和包。
我想知道我的 jar 不在 android 测试项目中,而是在被测试的 android 项目中。那么如何为ant.properties
测试项目中的那些外部 jar 提供路径。