如何生成HTML的Andr​​oid测试报告自动测试报告、HTML、Andr、oid

2023-09-03 21:58:19 作者:愛我不用說出來つ

我想自动生成HTML格式的单元测试报告Hudson持续集成服务器上的Andr​​oid应用程序。

I would like to automatically generate unit testing report in html format for Android application on Hudson continuous integration server.

所以,我试着先运行测试用例,并聚集在XML格式的测试结果文件。然后,我用JUnitReport任务来转换XML结果文件转换成HTML格式。

Therefore, I try to run test cases first and gather test result files in xml format. Then, I use JUnitReport Task to transform the XML result files into HTML format.

我通过运行Android的规范框架的测试用例。但是,它仅提供了详细的输出信息,而不是标准的JUnit XML格式。我不知道如何生成不JUnit的XML结果文件,HTML单元测试报告。

I run test cases through Android instrumentation framework. However, it only provides verbose output information rather than the standard JUnit XML format. I have no idea how to generate HTML unit test report without JUnit XML result files.

如果我在运行使用Eclipse测试的情况下,它可以在XML文件导出的结果与消耗的时间每个测试用例的信息。这些XML文件可以被正确地转换成HTML由JUnitReport任务。其结果是,似乎有可能收集随时间消耗的信息的测试结果。

If I run test cases using Eclipse, it can export results in XML files with time consumed information per test case. Those XML files can be transformed into HTML by JUnitReport Task correctly. As a result, it seems that it is possible to collect the test result with time consumed information.

有没有办法在Android仪表框架运行测试用例后自动获得标准的JUnit XML结果文件?

Is there any way to get the standard JUnit XML result file automatically after running test cases on Android instrumentation framework?

推荐答案

我们已经在我们公司类似的问题。我们检查了所有可用的开​​源解决方案,其中没有一个是真正的完美。因此,我们开发了,只是开源它的解决方案。我还是不说了一个终极之一,但肯定比任何雅典娜或蟒蛇记者或任何后处理分析好得多。你可以在这里找到它: http://$c$c.google.com/p/the-missing-android-xml-junit-test-runner/

We had similar problem in our company. We checked all the available open-source solutions and none of them was really perfect. So we developed and just open-sourced a solution for it. I still do not say an "ultimate" one but certainly much better than either athena or the python reporter or any after-test analysis. You can find it here: http://code.google.com/p/the-missing-android-xml-junit-test-runner/

它提供了:

在每个涉及的每个包单独的XML文件 在设备上生成的XML文件(需要先试验后,亚行pull'ed) 完全支持的测试时间 我们有充分的堆栈跟踪报道,故障/错误的情况下

,我们扩展了Android的仪表亚军。因此,我们得到使用标准的命令行选项测试选择,使覆盖范围等的所有优势 - 所有的描述如下:http://developer.android.com/guide/developing/testing/testing_otheride.html#RunTestsCommand.

Instead of analysing java source code (as in athena) or analysing the output (the python script), we extended android instrumentation runner. So we get all the benefits of using standard command line options for test selection, coverage enabling etc. - all described here: http://developer.android.com/guide/developing/testing/testing_otheride.html#RunTestsCommand.

我们能够使用与覆盖率艾玛,均能报道詹金斯分析标准测试规则成功运行code。

We were able to successfully run the code using standard test rules with coverage analysed by emma, all nicely reported in Jenkins.