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)

Runs the tests, and reports result to the 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
IOException

受保護的方法

checkCommandResult

protected void checkCommandResult (CommandResult result, 
                ITestInvocationListener listener, 
                TestDescription description)

檢查測試指令的結果。

參數
result CommandResult:指令 CommandResult 的測試結果

listener ITestInvocationListenerITestInvocationListener

description TestDescription:正在進行的測試。

doesRunBinaryGenerateTestResults

protected boolean doesRunBinaryGenerateTestResults ()

傳回
boolean