GTest
public
class
GTest
extends GTestBase
implements
IDeviceTest
A Test that runs a native test package on given device.
Summary
Public constructors |
GTest()
|
Protected methods |
String
|
createFlagFile(String filter)
Create a file containing the filters that will be used via --gtest_flagfile to avoid any OS
limitation in args size.
|
void
|
executeCommandByScript(ITestDevice testDevice, String cmd, IShellOutputReceiver resultParser)
Helper method to run a gtest command from a temporary script, in the case that the command
is too long to be run directly by adb.
|
String
|
getGTestCmdLine(String fullPath, String flags)
Helper method to build the gtest command to run.
|
String
|
loadFilter(String binaryOnDevice)
Define get filter method.
|
boolean
|
shouldRunFile(String fullPath)
Helper method to determine if we should execute a given file.
|
Public constructors
Public methods
getDevice
public ITestDevice getDevice ()
Get the device under test.
isRebootBeforeTestEnabled
public boolean isRebootBeforeTestEnabled ()
setDevice
public void setDevice (ITestDevice device)
Inject the device under test.
setNativeTestDevicePath
public void setNativeTestDevicePath (String path)
Protected methods
createFlagFile
protected String createFlagFile (String filter)
Create a file containing the filters that will be used via --gtest_flagfile to avoid any OS
limitation in args size.
Parameters |
filter |
String : The filter string |
Returns |
String |
The path to the file containing the filter. |
executeCommandByScript
protected void executeCommandByScript (ITestDevice testDevice,
String cmd,
IShellOutputReceiver resultParser)
Helper method to run a gtest command from a temporary script, in the case that the command
is too long to be run directly by adb.
Parameters |
testDevice |
ITestDevice : the device on which to run the command |
cmd |
String : the command string to run |
resultParser |
IShellOutputReceiver : the output receiver for reading test results |
getGTestCmdLine
protected String getGTestCmdLine (String fullPath,
String flags)
Helper method to build the gtest command to run.
Parameters |
fullPath |
String : absolute file system path to gtest binary on device |
flags |
String : gtest execution flags |
Returns |
String |
the shell command line to run for the gtest |
loadFilter
protected String loadFilter (String binaryOnDevice)
Define get filter method.
Sub class must implement how to get it's own filter.
Parameters |
binaryOnDevice |
String : the full path of the filter file. |
Returns |
String |
filter string. |
shouldRunFile
protected boolean shouldRunFile (String fullPath)
Helper method to determine if we should execute a given file.
Parameters |
fullPath |
String : the full path of the file in question |
Returns |
boolean |
true if we should execute the said file. |