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

2

19

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 .)"

Columba answered 13/5, 2010 at 1:54 Comment(1)
I have an answer for post-ICS CTS, where it gets a facelift: https://mcmap.net/q/668453/-how-to-run-cts-tests-in-android-eclair -- my answer is kind of identical to @knmanish's answer over at https://mcmap.net/q/668454/-android-cts-downloading-of-cts-environment-setup-building-and-executionHent
T
6

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>

enter image description here

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/

Transonic answered 3/11, 2017 at 9:26 Comment(1)
Great answer. Thank you.Extrabold
I
0

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

Here is another CTS introduction about building CTS.

Illuminator answered 27/5, 2010 at 6:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.