CodeCoverageTestBase.CoverageCollectingListener

public static class CodeCoverageTestBase.CoverageCollectingListener
extends ResultForwarder implements AutoCloseable

java.lang.Object
   ↳ com.android.tradefed.result.ResultForwarder
     ↳ com.android.tradefed.testtype.CodeCoverageTestBase.CoverageCollectingListener


A ResultForwarder which collects coverage files.

Summary

Public constructors

CodeCoverageTestBase.CoverageCollectingListener(ITestDevice device, ITestInvocationListener... listeners)

Public methods

void close()

List<File> getCoverageFiles()

Returns the list of collected coverage files.

void testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)

Provides the associated log or debug data from the test invocation.

void testRunEnded(long elapsedTime, Map<String, String> runMetrics)

void testRunStarted(String runName, int testCount)

Public constructors

CodeCoverageTestBase.CoverageCollectingListener

CodeCoverageTestBase.CoverageCollectingListener (ITestDevice device, 
                ITestInvocationListener... listeners)

Parameters
device ITestDevice

listeners ITestInvocationListener

Throws
IOException

Public methods

close

void close ()

getCoverageFiles

List<File> getCoverageFiles ()

Returns the list of collected coverage files.

Returns
List<File>

testLog

void testLog (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream)

Provides the associated log or debug data from the test invocation.

Must be called before invocationFailed(Throwable) or invocationEnded(long)

The TradeFederation framework will automatically call this method, providing the host log and if applicable, the device logcat.

Parameters
dataName String: a String descriptive name of the data. e.g. "device_logcat". Note dataName may not be unique per invocation. ie implementers must be able to handle multiple calls with same dataName

dataType LogDataType: the LogDataType of the data

dataStream InputStreamSource: the InputStreamSource of the data. Implementers should call createInputStream to start reading the data, and ensure to close the resulting InputStream when complete. Callers should ensure the source of the data remains present and accessible until the testLog method completes.

testRunEnded

void testRunEnded (long elapsedTime, 
                Map<String, String> runMetrics)

Parameters
elapsedTime long

runMetrics Map

testRunStarted

void testRunStarted (String runName, 
                int testCount)

Parameters
runName String

testCount int