GoogleBenchmarkTest

public class GoogleBenchmarkTest
extends Object implements IDeviceTest, IRemoteTest, ITestFilterReceiver

java.lang.Object
   ↳ com.android.tradefed.testtype.GoogleBenchmarkTest


A Test that runs a Google benchmark test package on given device.

Summary

Public constructors

GoogleBenchmarkTest()

Public methods

void addAllExcludeFilters( filters)

Adds the ERROR(/Set) of filters of which tests to exclude.

void addAllIncludeFilters( filters)

Adds the ERROR(/Set) of filters of which tests to include.

void addExcludeFilter(String filter)

Adds a filter of which tests to exclude.

void addIncludeFilter(String filter)

Adds a filter of which tests to include.

void addModuleName(String moduleName)

Add the Android native benchmark test module to run.

String cleanFilter(String filter)
void clearExcludeFilters()

Delete all the exclude filters currently tracked.

void clearIncludeFilters()

Delete all the include filters currently tracked.

ITestDevice getDevice()

Get the device under test.

getExcludeFilters()

Returns the current ERROR(/Set) of exclude filters.

getIncludeFilters()

Returns the current ERROR(/Set) of include filters.

getModuleNames()

Get the Android native benchmark test module to run.

void run(TestInformation testInfo, ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

void setDevice(ITestDevice device)

Inject the device under test.

void setReportRunName(String reportRunName)

Protected methods

CommandResult executeCommand(ITestDevice testDevice, String cmd)

Helper method to run a benchmarktest command.

String getFilterFlagForFilters( filters)
String getFilterFlagForTests( fitlererTests)
boolean shouldSkipFile(String fullPath)

Helper method to determine if we should skip the execution of a given file.

Public constructors

GoogleBenchmarkTest

public GoogleBenchmarkTest ()

Public methods

addAllExcludeFilters

public void addAllExcludeFilters ( filters)

Adds the ERROR(/Set) of filters of which tests to exclude.

Parameters
filters

addAllIncludeFilters

public void addAllIncludeFilters ( filters)

Adds the ERROR(/Set) of filters of which tests to include.

Parameters
filters

addExcludeFilter

public void addExcludeFilter (String filter)

Adds a filter of which tests to exclude.

Parameters
filter String

addIncludeFilter

public void addIncludeFilter (String filter)

Adds a filter of which tests to include.

Parameters
filter String

addModuleName

public void addModuleName (String moduleName)

Add the Android native benchmark test module to run.

Parameters
moduleName String: The name of the native test module to run

cleanFilter

public String cleanFilter (String filter)

Parameters
filter String

Returns
String

clearExcludeFilters

public void clearExcludeFilters ()

Delete all the exclude filters currently tracked.

clearIncludeFilters

public void clearIncludeFilters ()

Delete all the include filters currently tracked.

getDevice

public ITestDevice getDevice ()

Get the device under test.

Returns
ITestDevice the ITestDevice

getExcludeFilters

public  getExcludeFilters ()

Returns the current ERROR(/Set) of exclude filters.

Returns

getIncludeFilters

public  getIncludeFilters ()

Returns the current ERROR(/Set) of include filters.

Returns

getModuleNames

public  getModuleNames ()

Get the Android native benchmark test module to run.

Returns
the name of the native test module to run, or null if not set

run

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

Parameters
testInfo TestInformation: The TestInformation object containing useful information to run tests.

listener ITestInvocationListener: the ITestInvocationListener of test results

Throws
DeviceNotAvailableException

setDevice

public void setDevice (ITestDevice device)

Inject the device under test.

Parameters
device ITestDevice: the ITestDevice to use

setReportRunName

public void setReportRunName (String reportRunName)

Parameters
reportRunName String

Protected methods

executeCommand

protected CommandResult executeCommand (ITestDevice testDevice, 
                String cmd)

Helper method to run a benchmarktest command. If the command is too long to be run directly by adb, it runs from a temporary script.

Parameters
testDevice ITestDevice: the device on which to run the command

cmd String: the command string to run

Returns
CommandResult shell output if outputReceiver is null

Throws
DeviceNotAvailableException

getFilterFlagForFilters

protected String getFilterFlagForFilters ( filters)

Parameters
filters

Returns
String

getFilterFlagForTests

protected String getFilterFlagForTests ( fitlererTests)

Parameters
fitlererTests

Returns
String

shouldSkipFile

protected boolean shouldSkipFile (String fullPath)

Helper method to determine if we should skip the execution of a given file.

Parameters
fullPath String: the full path of the file in question

Returns
boolean true if we should skip the said file.