KernelTargetTest
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()
|
公用建構函式
KernelTargetTest
public KernelTargetTest ()
公用方法
compareKernelVersion
public boolean compareKernelVersion (String minKernelVersion)
檢查核心版本是否符合或超過此測試的核心版本最低需求。
| 參數 | |
|---|---|
minKernelVersion |
String:設定檔中的最低版本字串。 |
| 傳回 | |
|---|---|
boolean |
|
findBinary
public String findBinary (String binary)
略過 findBinary 中的二進位檢查。與 mSkipBinaryCheck 重複,但為了回溯相容性而需要。
| 參數 | |
|---|---|
binary |
String:二進位檔的路徑或二進位檔名稱。 |
| 傳回 | |
|---|---|
String |
二進位檔案的路徑,如果找不到則傳回 null。 |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
getDeviceKernelVersion
public Integer getDeviceKernelVersion ()
使用 uname -r 取得裝置核心版本。
| 傳回 | |
|---|---|
Integer |
|
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
parseKernelVersion
public Integer parseKernelVersion (String version)
將核心版本、主要修訂版本,以及選用的次要修訂版本,從版本字串解析為可用於數字比較的單一整數。
| 參數 | |
|---|---|
version |
String:Linux 版本字串。 |
| 傳回 | |
|---|---|
Integer |
|
得分
public void run (TestInformation testInfo, ITestInvocationListener listener)
執行測試,並將結果回報給監聽器。
| 參數 | |
|---|---|
testInfo |
TestInformation:包含執行測試所需實用資訊的 TestInformation 物件。 |
listener |
ITestInvocationListener:測試結果的 ITestInvocationListener |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
runBinary
public void runBinary (String binaryPath,
ITestInvocationListener listener,
TestDescription description)實際在指定路徑中執行二進位檔。
| 參數 | |
|---|---|
binaryPath |
String:二進位檔的路徑。 |
listener |
ITestInvocationListener:用於回報結果的事件監聽器。 |
description |
TestDescription:測試中。 |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
受保護的方法
checkCommandResult
protected void checkCommandResult (CommandResult result, ITestInvocationListener listener, TestDescription description)
查看測試指令的結果。
| 參數 | |
|---|---|
result |
CommandResult:指令 CommandResult 的測試結果 |
listener |
ITestInvocationListener:ITestInvocationListener |
description |
TestDescription:測試中。 |
doesRunBinaryGenerateTestResults
protected boolean doesRunBinaryGenerateTestResults ()
| 傳回 | |
|---|---|
boolean |
|