blob: 01892216f96f11554f919a3af2c057c519489bb1 [file] [log] [blame]
<html devsite><head>
<title>解读 CTS 测试结果</title>
<meta name="project_path" value="/_project.yaml"/>
<meta name="book_path" value="/_book.yaml"/>
</head>
<body>
<!--
Copyright 2017 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<p>CTS 测试结果位于以下文件中:</p>
<pre class="devsite-click-to-copy">
$CTS_ROOT/android-cts/repository/results/&lt;start_time&gt;.zip
</pre>
<p>如果您自行编译了 CTS,则 $CTS_ROOT 将类似于路径 out/host/linux-x86/cts(但会因平台而异)。<em></em><em></em>该路径取决于您解压缩从此网站<a href="downloads.html">下载</a>的预编译官方 CTS 文件时所在的路径。</p>
<p>在 zip 压缩包中,testResult.xml 文件会包含实际的结果。在任何网络浏览器(推荐使用与 HTML 5 技术兼容的浏览器)中打开此文件,即可查看测试结果。</p>
<p>使用 Chrome 浏览器时,如果 testResult.xml 显示空白页,请<a href="https://www.chromium.org/developers/how-tos/run-chromium-with-flags">更改浏览器配置</a>,以启用 --allow-file-access-from-files 命令行标记。<em></em></p>
<h3 id="reading-the-test-results">阅读测试结果</h3>
<p>测试结果的详细信息取决于您目前使用的 CTS 版本:</p>
<ul>
<li>CTS v1 适用于 Android 6.0 及更早版本</li><li>CTS v2 适用于 Android 7.0 及更高版本</li></ul>
<p class="note"><strong>注意</strong>:所提供的结果旨在帮助您确保软件在整个开发过程中始终兼容,并且可作为通用格式向其他方说明您的设备的兼容性状态。</p>
<h4 id="device-information">设备信息</h4>
<p>在 CTS v6.0 及更早版本中,选择“Device Information”(“Test Summary”上方的链接)可查看关于设备、固件(品牌、型号、固件版本号、平台)和设备硬件(屏幕分辨率、键盘、屏幕类型)的详细信息(CTS v7.0 不显示设备信息)。</p>
<h4 id="test-summary">测试摘要</h4>
<p>“Test Summary”部分可提供已执行的测试计划的详细信息,例如 CTS 计划名称以及执行开始时间和结束时间。<em></em>该部分还会提供通过、失败、超时或无法执行的测试数量的汇总摘要。</p>
<section class="expandable">
<h4 class="showalways">显示 CTS v1 测试摘要示例</h4>
<img src="/compatibility/cts/images/cts-test-summary.png" alt="CTS v1 测试摘要" id="figure1a"/>
<p class="img-caption"><strong>图 1a.</strong> CTS v1 测试摘要示例</p>
</section>
<section class="expandable">
<h4 class="showalways">显示 CTS v2 测试摘要示例</h4>
<img src="/compatibility/cts/images/cts-v2-test-summary.png" alt="CTS v2 测试摘要" id="figure1b"/>
<p class="img-caption"><strong>图 1b.</strong> CTS v2 测试摘要示例</p>
</section>
<p> </p>
<h4 id="test-report">测试报告</h4>
<p>下一部分为 CTS 测试报告,它会按文件包显示已通过的测试的摘要。</p>
<p>接下来是所执行的实际测试的详细信息。该报告会列出测试包、测试套件、测试用例和执行的测试。它会显示测试执行结果:通过、失败、超时或未执行。如果测试失败,则该报告会提供详细信息以供诊断原因。</p>
<p>此外,为了确保简洁性,失败的测试的堆栈跟踪信息会包含在 XML 文件中,但不会包含在报告中;使用文本编辑器查看 XML 文件可了解有关测试失败的详细信息(搜索与失败的测试对应的 &lt;Test&gt; 标记,并在其中查找 &lt;StackTrace&gt; 标记)。<em></em><em></em></p>
<section class="expandable">
<h4 class="showalways">显示 CTS v1 测试报告示例</h4>
<img src="/compatibility/cts/images/cts-test-report.png" alt="CTS v1 测试报告" id="figure2a"/>
<p class="img-caption"><strong>图 2a.</strong> CTS v1 测试报告示例</p>
</section>
<section class="expandable">
<h4 class="showalways">显示 CTS v2 测试报告示例</h4>
<img src="/compatibility/cts/images/cts-v2-test-report.png" alt="CTS v2 测试报告" id="figure2b"/>
<p class="img-caption"><strong>图 2b.</strong> CTS v2 测试报告示例</p>
</section>
<p> </p>
<h3 id="incomplete-test-modules">查看 test_result.xml 以了解未完成的测试模块</h3>
<p>要确定某个测试会话中的未完成模块数量,请运行命令“list results”。系统会列出之前每个会话的“已完成模块数量”和“模块总数量”。要确定哪些模块已完成,哪些模块未完成,请打开 test_result.xml 文件,并读取结果报告中每个模块的“done”属性的值。“done”值为“false”表示模块尚未运行完毕。
</p>
</body></html>