Stay organized with collections
Save and categorize content based on your preferences.
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. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-06-06 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2023-06-06 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-06-06 UTC."]]