MoblyBinaryHostTest
public class MoblyBinaryHostTest
extends Object
implements IRemoteTest , IDeviceTest , IBuildReceiver , ITestFilterReceiver
java.lang.Object | |
↳ | com.android.tradefed.testtype.mobly.MoblyBinaryHostTest |
主機測試意味著從 Android 構建系統 (Soong) 運行一個 mobly python 二進製文件
概括
公共構造函數 | |
---|---|
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) 注入被測設備。 |
受保護的方法 | |
---|---|
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) |
公共構造函數
MoblyBinaryHostTest
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 |
受保護的方法
構建命令行數組
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 |
退貨 | |
---|---|
獲取日誌目錄絕對路徑
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 :執行各種報告的 ITestInvocationListener 實例。 |
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 |