MoblyBinaryHost測試
public class MoblyBinaryHostTest
extends Object
implements IRemoteTest , IDeviceTest , IBuildReceiver , ITestFilterReceiver , IShardableTest
java.lang.Object | |
↳ | com.android.tradefed.testtype.mobly.MoblyBinaryHostTest |
主機測試意味著從 Android 建置系統運行 mobly python 二進位檔案 (Soong)
概括
公共構造函數 | |
---|---|
MoblyBinaryHostTest () |
公共方法 | |
---|---|
void | addAllExcludeFilters ( filters) addAllExcludeFilters ( filters) 新增要排除的測試的過濾器的 |
void | addAllIncludeFilters ( filters) addAllIncludeFilters ( filters) 新增要包含的測試的過濾器的 |
void | addExcludeFilter (String filter) 新增要排除的測試的過濾器。 |
void | addIncludeFilter (String filter) 新增要包含的測試的過濾器。 |
void | clearExcludeFilters () 刪除目前追蹤的所有排除過濾器。 |
void | clearIncludeFilters () 刪除目前追蹤的所有包含過濾器。 |
ITestDevice | getDevice () 獲取被測設備。 |
getExcludeFilters () 傳回排除過濾器的目前 | |
getIncludeFilters () 傳回包含篩選器的目前 | |
final void | run ( TestInformation testInfo, ITestInvocationListener listener) 運行測試,並將結果報告給偵聽器。 |
void | setBuild ( IBuildInfo buildInfo) |
void | setDevice ( ITestDevice device) 注入被測設備。 |
split (int shardCountHint) |
受保護的方法 | |
---|---|
String[] | buildCommandLineArray (String filePath, String configPath, tests) buildCommandLineArray (String filePath, String configPath, tests) |
String[] | buildCommandLineArray (String filePath, String configPath) |
filterTests (String[] testListLines, String runName, ITestInvocationListener listener) | |
String | getLogDirAbsolutePath () |
File | getLogDirFile () |
boolean | processYamlTestResults (InputStream inputStream, MoblyYamlResultParser parser, ITestInvocationListener listener, String runName) 解析 Mobly 測試結果並進行結果報告。 |
void | reportLogs (File logDir, ITestInvocationListener listener) |
void | updateConfigFile (InputStream configInputStream, Writer writer) |
公共構造函數
MoblyBinaryHost測試
public MoblyBinaryHostTest ()
公共方法
新增排除過濾器
public void addExcludeFilter (String filter)
新增要排除的測試的過濾器。
參數 | |
---|---|
filter | String |
新增包含過濾器
public void addIncludeFilter (String filter)
新增要包含的測試的過濾器。
參數 | |
---|---|
filter | String |
清除排除過濾器
public void clearExcludeFilters ()
刪除目前追蹤的所有排除過濾器。
清除包含過濾器
public void clearIncludeFilters ()
刪除目前追蹤的所有包含過濾器。
跑步
public final void run (TestInformation testInfo, ITestInvocationListener listener)
運行測試,並將結果報告給偵聽器。
參數 | |
---|---|
testInfo | TestInformation : TestInformation 物件包含執行測試的有用資訊。 |
listener | ITestInvocationListener :測試結果的ITestInvocationListener |
分裂
publicsplit (int shardCountHint)
split()
的替代版本還提供嘗試運行的 shardCount。這對於某些有時無法隨意決定的測試運行者很有用。
參數 | |
---|---|
shardCountHint | int :嘗試的分片計數。 |
退貨 | |
---|---|
要單獨執行的子測試的集合,如果測試目前不可分片,則為null |
受保護的方法
建置命令列數組
protected String[] buildCommandLineArray (String filePath, String configPath,tests)
參數 | |
---|---|
filePath | String |
configPath | String |
tests |
退貨 | |
---|---|
String[] |
建置命令列數組
protected String[] buildCommandLineArray (String filePath, String configPath)
參數 | |
---|---|
filePath | String |
configPath | String |
退貨 | |
---|---|
String[] |
過濾測試
protectedfilterTests (String[] testListLines, String runName, ITestInvocationListener listener)
參數 | |
---|---|
testListLines | String |
runName | String |
listener | ITestInvocationListener |
退貨 | |
---|---|
取得LogDirAbsolutePath
protected String getLogDirAbsolutePath ()
退貨 | |
---|---|
String |
取得日誌目錄文件
protected File getLogDirFile ()
退貨 | |
---|---|
File |
流程Yaml測試結果
protected boolean processYamlTestResults (InputStream inputStream, MoblyYamlResultParser parser, ITestInvocationListener listener, String runName)
解析 Mobly 測試結果並進行結果報告。
參數 | |
---|---|
inputStream | InputStream :讀取 Mobly 測試結果檔案中的 InputStream 物件。 |
parser | MoblyYamlResultParser :處理 Mobly 測試結果的 MoblyYamlResultParser 物件。 |
listener | ITestInvocationListener :執行各種報表的 ITestInitationListener 實例。 |
runName | String : str,Mobly 測試二進位運行的名稱。 |
退貨 | |
---|---|
boolean |
報告日誌
protected void reportLogs (File logDir, ITestInvocationListener listener)
參數 | |
---|---|
logDir | File |
listener | ITestInvocationListener |
更新設定檔
protected void updateConfigFile (InputStream configInputStream, Writer writer)
參數 | |
---|---|
configInputStream | InputStream |
writer | Writer |
投擲 | |
---|---|
HarnessRuntimeException |