CodeCoverageListener

final class CodeCoverageListener
extends ResultForwarder

java.lang.Object
   ↳ com.android.tradefed.result.ResultForwarder
     ↳ com.android.tradefed.testtype.CodeCoverageListener


A ResultForwarder that will pull coverage measurements off of the device and log them as test artifacts.

Summary

Constants

String COVERAGE_MEASUREMENT_KEY

Public constructors

CodeCoverageListener(ITestDevice device, ITestInvocationListener... listeners)

Public methods

void testRunEnded(long elapsedTime, HashMap<String, MetricMeasurement.Metric> runMetrics)

Reports end of test run.

void testRunStarted(String runName, int testCount)

Reports the start of a test run.

Constants

COVERAGE_MEASUREMENT_KEY

public static final String COVERAGE_MEASUREMENT_KEY

Constant Value: "coverageFilePath"

Public constructors

CodeCoverageListener

public CodeCoverageListener (ITestDevice device, 
                ITestInvocationListener... listeners)

Parameters
device ITestDevice

listeners ITestInvocationListener

Public methods

testRunEnded

public void testRunEnded (long elapsedTime, 
                HashMap<String, MetricMeasurement.Metric> runMetrics)

Reports end of test run. FIXME: We cannot have two Map<> interfaces with different type, so we have to use HashMap here.

Parameters
elapsedTime long: device reported elapsed time, in milliseconds

runMetrics HashMap: key-value pairs reported at the end of a test run with MetricMeasurement.Metric.

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

Reports the start of a test run.

Parameters
runName String: the test run name

testCount int: total number of tests in test run