CTS Test Coverage

817 views
Skip to first unread message

Rajchinna

unread,
May 24, 2011, 8:35:32 AM5/24/11
to android-platform
Hi,

I have been using CTS for quite sometime and recently found 'make cts-
test-coverage' option. This gave me a html report which gives what all
are the API's covered in CTS test cases(apks). It also gives what all
are the API's covered in certain package and what all are not
covered.

But, I found another intersting thing that this report is not 100%
promising. As I look at the source code of a certain test case
(MediaScannerConnection) inside the source code all the aAPI's
covered.

But, when I look at the the coverage report, it doesn't give 100%. It
gave only 38% (3 API's only covered out of 8 API's).

Here is the report generated from "make cts-test-coverage" command for
MediaScannerConnection class.

MediaScannerConnection 38% (3/8)
[X] MediaScannerConnection(android.content.Context,
android.media.MediaScannerConnection.MediaScannerConnectionClient)
[ ] void connect()
[ ] void disconnect()
[ ] boolean isConnected()
[X] void onServiceConnected(android.content.ComponentName,
android.os.IBinder)
[X] void onServiceDisconnected(android.content.ComponentName)
[ ] void scanFile(java.lang.String, java.lang.String)
[ ] void scanFile(android.content.Context, java.lang.String[],
java.lang.String[],
android.media.MediaScannerConnection.OnScanCompletedListener)


Here is the source code for the same class in CTS source code.
http://android.git.kernel.org/?p=platform/cts.git;a=blob;f=tests/tests/media/src/android/media/cts/MediaScannerConnectionTest.java;h=cc25d07bed71151615d36f49fa77633af19e3e49;hb=HEAD



Can someone make it clear like why this CTS Test coverage report not
listing all the API's which are used inside the test cases? Or am I
missing something?

muke...@pathpartnertech.com

unread,
Aug 22, 2013, 9:01:17 AM8/22/13
to android-...@googlegroups.com
Hi All,
Do mukesh@cpu-049:~/27.IS.2.M1/mydroid$ make cts-test-coverage it will generate the cts-api-coverage containing xml file.
it will be at /home/mukesh/27.IS.2.M1/mydroid/out/host/linux-x86/cts-api-coverage.

Regards
Mukesh

On Friday, June 15, 2012 10:22:03 PM UTC+5:30, Swati wrote:

Hi Rajchinna,

I am now dealing with the same sort of problem. and you can be my only hope as i am not able to find any document and notes on google related to how to get cts code coverage.

Please let me know the steps you did for taking out html report by executing "make cts-test-coverage" command.

I am stuck with this step itself and dont know what all changes need to be done in my Android source code or in cts source files to make this file generate html reports.

I will be highly obliged if you can help me in any sense.

 

-Regards,

Swati

Reply all
Reply to author
Forward
0 new messages