G測試
public class GTest
extends GTestBase
implements IDeviceTest
在給定設備上運行本機測試包的測試。
概括
受保護的方法 |
---|
String | createFlagFile (String filter) 創建一個包含將通過 --gtest_flagfile 使用的過濾器的文件,以避免 args 大小的任何操作系統限制。 |
void | executeCommandByScript ( ITestDevice testDevice, String cmd, IShellOutputReceiver resultParser) 從臨時腳本運行 gtest 命令的輔助方法,以防命令太長而無法由 adb 直接運行。 |
String | getGTestCmdLine (String fullPath, String flags) 構建要運行的 gtest 命令的幫助程序方法。 |
String | loadFilter (String binaryOnDevice) 定義獲取過濾器方法。 |
boolean | shouldRunFile (String fullPath) 確定我們是否應該執行給定文件的輔助方法。 |
公共構造函數
公共方法
isRebootBeforeTestEnabled
public boolean isRebootBeforeTestEnabled ()
setNativeTestDevicePath
public void setNativeTestDevicePath (String path)
受保護的方法
創建標誌文件
protected String createFlagFile (String filter)
創建一個包含將通過 --gtest_flagfile 使用的過濾器的文件,以避免 args 大小的任何操作系統限制。
executeCommandByScript
protected void executeCommandByScript (ITestDevice testDevice,
String cmd,
IShellOutputReceiver resultParser)
從臨時腳本運行 gtest 命令的輔助方法,以防命令太長而無法由 adb 直接運行。
參數 |
---|
testDevice | ITestDevice :運行命令的設備 |
cmd | String : 要運行的命令字符串 |
resultParser | IShellOutputReceiver :讀取測試結果的輸出接收器 |
getGTestCmdLine
protected String getGTestCmdLine (String fullPath,
String flags)
構建要運行的 gtest 命令的幫助程序方法。
參數 |
---|
fullPath | String :設備上 gtest 二進製文件的絕對文件系統路徑 |
flags | String :gtest 執行標誌 |
退貨 |
---|
String | 為 gtest 運行的 shell 命令行 |
加載過濾器
protected String loadFilter (String binaryOnDevice)
定義獲取過濾器方法。
子類必須實現如何獲取它自己的過濾器。
參數 |
---|
binaryOnDevice | String : 過濾器文件的完整路徑。 |
應該運行文件
protected boolean shouldRunFile (String fullPath)
確定我們是否應該執行給定文件的輔助方法。
參數 |
---|
fullPath | String :相關文件的完整路徑 |
退貨 |
---|
boolean | 如果我們應該執行所述文件,則為真。 |