核心目標測試
public class KernelTargetTest
extends ExecutableTargetTest
java.lang.Object | |||
↳ | com.android.tradefed.testtype.binary.ExecutableBaseTest | ||
↳ | com.android.tradefed.testtype.binary.ExecutableTargetTest | ||
↳ | com.android.tradefed.testtype.binary.KernelTargetTest |
用於在目標上運行的可執行檔的測試運行器並解析內核測試的測試結果。
概括
公共構造函數 | |
---|---|
KernelTargetTest () |
公共方法 | |
---|---|
boolean | compareKernelVersion (String minKernelVersion) 檢查核心版本是否滿足或超過此測試的最低核心版本。 |
String | findBinary (String binary) 跳過 findBinary 中的二進位檢查。 |
Integer | getDeviceKernelVersion () 使用 uname -r 取得裝置內核版本。 |
Integer | parseKernelVersion (String version) 將版本字串中的核心版本、主要修訂版和最小修訂版(可選)解析為可用於數字比較的單一整數。 |
void | run ( TestInformation testInfo, ITestInvocationListener listener) 運行測試,並將結果報告給偵聽器。 |
void | runBinary (String binaryPath, ITestInvocationListener listener, TestDescription description) 實際上在給定路徑上運行二進位檔案。 |
受保護的方法 | |
---|---|
void | checkCommandResult ( CommandResult result, ITestInvocationListener listener, TestDescription description) 檢查測試命令的結果。 |
boolean | doesRunBinaryGenerateTestResults () |
公共構造函數
核心目標測試
public KernelTargetTest ()
公共方法
比較核心版本
public boolean compareKernelVersion (String minKernelVersion)
檢查核心版本是否滿足或超過此測試的最低核心版本。
參數 | |
---|---|
minKernelVersion | String :配置中的最低版本字串。 |
退貨 | |
---|---|
boolean |
尋找二進位文件
public String findBinary (String binary)
跳過 findBinary 中的二進位檢查。與 mSkipBinaryCheck 冗餘,但需要向後相容。
參數 | |
---|---|
binary | String :二進位檔案的路徑或簡單的二進位檔案名稱。 |
退貨 | |
---|---|
String | 二進位檔案的路徑,如果未找到則為 null。 |
投擲 | |
---|---|
DeviceNotAvailableException |
取得設備內核版本
public Integer getDeviceKernelVersion ()
使用 uname -r 取得裝置內核版本。
退貨 | |
---|---|
Integer |
投擲 | |
---|---|
DeviceNotAvailableException |
解析內核版本
public Integer parseKernelVersion (String version)
將版本字串中的核心版本、主要修訂版和最小修訂版(可選)解析為可用於數字比較的單一整數。
參數 | |
---|---|
version | String : Linux 版本字串。 |
退貨 | |
---|---|
Integer |
跑步
public void run (TestInformation testInfo, ITestInvocationListener listener)
運行測試,並將結果報告給偵聽器。
參數 | |
---|---|
testInfo | TestInformation : TestInformation 物件包含執行測試的有用資訊。 |
listener | ITestInvocationListener :測試結果的ITestInvocationListener |
投擲 | |
---|---|
DeviceNotAvailableException |
運行二進位文件
public void runBinary (String binaryPath, ITestInvocationListener listener, TestDescription description)
實際上在給定路徑上運行二進位檔案。
參數 | |
---|---|
binaryPath | String :二進位檔案的路徑。 |
listener | ITestInvocationListener :報告結果的偵聽器。 |
description | TestDescription :測試正在進行中。 |
投擲 | |
---|---|
DeviceNotAvailableException |
受保護的方法
檢查命令結果
protected void checkCommandResult (CommandResult result, ITestInvocationListener listener, TestDescription description)
檢查測試命令的結果。
參數 | |
---|---|
result | CommandResult : 指令CommandResult 的測試結果 |
listener | ITestInvocationListener : ITestInvocationListener |
description | TestDescription :測試正在進行中。 |
doesRunBinary產生測試結果
protected boolean doesRunBinaryGenerateTestResults ()
退貨 | |
---|---|
boolean |