简体   繁体   中英

How to build android cts? And how to add and run your test case?

From 2.0 the cts is freely downloadable from android's repository.

But there is no documents about it.

Does anyone can tell me:

  1. how to build cts? Is there a standard procedure?
  2. How to run cts?
  3. How to add customized test case?

Here, share my experience. After repo sync all source, you can't directly run "make" to build all source. You will get some errors.

Now, I'am trying to first build android source without cts, and then build cts alone.

Also, here are some reference for run cts:

  1. http://i-miss-erin.blogspot.com/2010/05/how-to-add-test-plan-package-to-android.html
  2. www.mentby.com/chenny/how-does-cts-work-where-can-i-get-the-test-streams.html
  3. www.jxva.com/?act=blog!article&articleId=157

1st time Update @ 5-13 18:39 +8:00

I do the following steps:

1.build android source without cts (move cts out of the $SDK_ROOT).

2.build cts (move cts back).

both jdk1.5 and 1.6 have the following errors:

1.The 1st time "make cts" report:

"Caused by: java.io.FileNotFoundException: ...(Too many open files)"

2.The 2nd time "make cts" report:

"acp: file 'out/host/linux-x86/obj/EXECUTABLES/vm-tests_intermediates/tests/data' does not exist"

3.The 3rd time "make cts" report:

"/bin/bash: line 0: cd: out/host/linux-x86/obj/EXECUTABLES/vm-tests_intermediates/hostjunit_files/classes: No such file or directory"

4.The last time "make cts" report:

"zip error: Nothing to do! (try: zip -q -r ../../android.core.vm-tests.jar . -i .)"

Before running the CTS,

1) Make sure you have recent versions of both Android Debug Bridge (adb) and Android Asset Packaging Tool (AAPT) installed

2) Make sure you have atleast the Android CTS version (android-cts-7.0_r13) SDK installed on your machine. Download the CTS version:- https://source.android.com/compatibility/cts/downloads

Run CTS:-

1) Set the SDK path:-

export PATH=$PATH:/home/apuser/SDK_for_linux/android-sdk-linux/build-tools/24.0.3/

2) Go to the tools director of CTS SDK android- cts/tools

3) Run the tradefed script file ./cts-tradefed

4) Execute the CTS command run cts -m <module_name>

在此输入图像描述

Build CTS source code :-

Download cts source code :

$ mkdir <dir_name>
$ cd <dir_name>
$ repo init -u https://android.googlesource.com/platform/manifest -b <tag_name> ( tag_name :-  android-cts-8.0_r2,  android-cts-7.1_r10)
$ repo sync -d -c –q

Compile complete cts package:

$ cd <dir_name>
$ . build/envsetup.sh
$ make cts -j TARGET_PRODUCT=aosp_arm64 

Compile particular cts :

$  cd <dir_name>
$  . build/envsetup.sh
$  cd <testcase_dir_name>
$  mm

After compiling the copy test case file : /home/apuser/android-cts-8.0_r1/out/host/linux-x86/cts/android-cts/testcases/

Replace them at below path(ubantu/linux system) /android-cts-8.0_r1/testcases/

Not only SDK, it need Android building system, you could set it up from Android site .

Here is another CTS introduction about building CTS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM