測試
public class GTest
extends GTestBase
implements IDeviceTest
在給定設備上執行本機測試包的測試。
概括
受保護的方法 |
---|
String | createFlagFile (String filter) 建立一個包含將通過 --gtest_flagfile 使用的過濾器的文件,以避免 args 大小的任何作業系統限制。 |
void | executeCommandByScript ( ITestDevice testDevice, String cmd, IShellOutputReceiver resultParser) 在命令太長而無法直接由 adb 執行的情況下,從臨時腳本執行 gtest 命令的幫助程式方法。 |
String | getGTestCmdLine (String fullPath, String flags) 建立要執行的 gtest 命令的幫助程式方法。 |
String | loadFilter (String binaryOnDevice) 定義獲取過濾器方法。 |
boolean | shouldRunFile (String fullPath) 幫助方法來確定我們是否應該執行給定的文件。 |
公共構造函數
公共方法
isRebootBeforeTestEnabled
public boolean isRebootBeforeTestEnabled ()
設定NativeTestDevicePath
public void setNativeTestDevicePath (String path)
受保護的方法
建立標誌文件
protected String createFlagFile (String filter)
建立一個包含將通過 --gtest_flagfile 使用的過濾器的文件,以避免 args 大小的任何作業系統限制。
透過腳本執行命令
protected void executeCommandByScript (ITestDevice testDevice,
String cmd,
IShellOutputReceiver resultParser)
在命令太長而無法直接由 adb 執行的情況下,從臨時腳本執行 gtest 命令的幫助程式方法。
參數 |
---|
testDevice | ITestDevice :運行命令的設備 |
cmd | String : 要執行的命令字串 |
resultParser | IShellOutputReceiver :用於讀取測試結果的輸出接收器 |
取得GTestCmdLine
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 | true 如果我們應該執行該檔案。 |