GcovCodeCoverageCollector
public
final
class
GcovCodeCoverageCollector
extends BaseDeviceMetricCollector
implements
IConfigurationReceiver
| java.lang.Object | ||
| ↳ | com.android.tradefed.device.metric.BaseDeviceMetricCollector | |
| ↳ | com.android.tradefed.device.metric.GcovCodeCoverageCollector | |
BaseDeviceMetricCollector,可從裝置中提取 gcov 涵蓋範圍測量結果,並將其記錄為測試構件。
摘要
公用建構函式 | |
|---|---|
GcovCodeCoverageCollector()
|
|
公用方法 | |
|---|---|
void
|
extraInit(IInvocationContext context, ITestInvocationListener listener)
|
void
|
logCoverageMeasurements(ITestDevice device, String runName)
從裝置擷取原生涵蓋範圍測量結果並記錄。 |
void
|
onTestRunEnd(DeviceMetricData runData, Map<String, MetricMeasurement.Metric> runMetrics)
測試作業結束時的回呼。 |
void
|
setCollectOnTestEnd(boolean collect)
設定是否要在 testRunEnded 上收集涵蓋範圍。 |
void
|
setConfiguration(IConfiguration config)
注入使用的 |
公用建構函式
GcovCodeCoverageCollector
public GcovCodeCoverageCollector ()
公用方法
extraInit
public void extraInit (IInvocationContext context, ITestInvocationListener listener)
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
logCoverageMeasurements
public void logCoverageMeasurements (ITestDevice device, String runName)
從裝置擷取原生涵蓋範圍測量結果並記錄。
| 參數 | |
|---|---|
device |
ITestDevice |
runName |
String |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
onTestRunEnd
public void onTestRunEnd (DeviceMetricData runData, Map<String, MetricMeasurement.Metric> runMetrics)
測試作業結束時的回呼。這時應進行清理。
| 參數 | |
|---|---|
runData |
DeviceMetricData:DeviceMetricData,其中包含執行作業的資料。與 onTestRunStart(DeviceMetricData) 期間的物件相同。 |
runMetrics |
Map:傳遞至 testRunEnded(long,Map) 的指標目前對應。 |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
setCollectOnTestEnd
public void setCollectOnTestEnd (boolean collect)
設定是否要在 testRunEnded 上收集涵蓋範圍。
重新執行時請將此值設為 false,否則每個個別測試重新執行作業都會收集涵蓋範圍,而不是合併涵蓋範圍結果。
| 參數 | |
|---|---|
collect |
boolean |
setConfiguration
public void setConfiguration (IConfiguration config)
注入使用的 IConfiguration。
| 參數 | |
|---|---|
config |
IConfiguration |