2011年11月18日 星期五

android CTS 介紹---cts plan 包含哪些東西

1. CTS從大到小包含了
Plan > package > suite > case > method


Plan:
User can create plan in cts shell. Plan should include packages, suites, cases or methods. Picture below shows the “add plan” command.

  • Cts test plan comes from [android source tree]/out/host/linux-x86/repository/plans/[xml file];
  • User can also create cts plan by adding xml file manually, without cts shell. This means when user types command “ls --plan”, cts shell search xml immediately.
  • Cts shell will check contents in plan when processing user command, following picture shows the error message for the item.
Package:
  • Package comes from [android source tree]/out/host/linux-x86/repository/plans/*.xml
  • Each package should responds to one xml and one apk file in [android source tree]/out/host/linux-x86/repository/testcase/. (but some package don’t.)
Suite:
  • Following picture shows the xml structure. It show the relationship between suite, TestCase(Case) and Test(Method).
  • And picture below shows the source code for corresponded class method.
  • We can find Suite in each xml file in [android source tree]/out/host/linux-x86/repository/testcase/*.xml.

Case:
  • It corresponds to class name in java file.
  • Test case is recorded in xml as suite child node. We can find them in source code as a class name.

Method:
  • Method is recorded in xml as TestCase child node. We can find them in source code as a class method.


android CTS 介紹---運作方式

需要設備.

  • Host side: PC with linux OS or windows OS.
  • Client side: tablet.

運作流程.

  • When cts start on host pc. Host pc will install test apk to tablet via adb.
  • After installing, tablet will start apk to test. And send result to host pc.
  • Host pc send adb command to remove apk on tablet.
  • Host pc gathers result information and generates xml report.