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, runMetrics)

測試結束時的回呼。

void setCollectOnTestEnd(boolean collect)

設定是否要在 testRunEnded 上收集涵蓋率。

void setConfiguration(IConfiguration config)

插入正在使用的 IConfiguration

公用建構函式

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, 
                 runMetrics)

測試結束時的回呼。這時應該要清理了。

參數
runData DeviceMetricData:儲存執行作業資料的 DeviceMetricData。會與 BaseDeviceMetricCollector.onTestRunStart(com.android.tradefed.device.metric.DeviceMetricData) 期間相同的物件。

runMetrics :傳遞至 ERROR(/#testRunEnded(long,Map)) 的目前指標對應項目。

擲回
DeviceNotAvailableException

setCollectOnTestEnd

public void setCollectOnTestEnd (boolean collect)

設定是否要在 testRunEnded 上收集涵蓋率。

請在重新執行期間將此值設為 false,否則每個個別測試重新執行作業都會收集涵蓋率,而非取得單一合併的涵蓋率結果。

參數
collect boolean

setConfiguration

public void setConfiguration (IConfiguration config)

插入正在使用的 IConfiguration

參數
config IConfiguration