ArtRunTest

public class ArtRunTest
extends Object implements IAbiReceiver, IRemoteTest, ITestCollector, ITestFilterReceiver

java.lang.Object
   ↳ com.android.tradefed.testtype.ArtRunTest


執行 ART 執行測試的測試執行器。

摘要

巢狀類別

class ArtRunTest.AdbShellCommandException

這個例外狀況類別可回報執行 ADB 殼層期間發生的錯誤 指令 

欄位

public static final String CHECKER_PAR_FILENAME

公用建構函式

ArtRunTest()

公用方法

void addAllExcludeFilters( filters)

新增要排除測試的篩選器 ERROR(/Set)

void addAllIncludeFilters( filters)

新增要納入測試的篩選器 ERROR(/Set)

void addExcludeFilter(String filter)

新增篩選器,篩選出要排除的測試。

void addIncludeFilter(String filter)

新增篩選器,選取要納入的測試。

void clearExcludeFilters()

刪除目前追蹤的所有「排除」篩選器。

void clearIncludeFilters()

刪除目前追蹤的所有「包含」篩選器。

IAbi getAbi()
getExcludeFilters()

傳回目前 ERROR(/Set) 的「排除」篩選器。

getIncludeFilters()

傳回「包含」篩選器的目前 ERROR(/Set)

void run(TestInformation testInfo, ITestInvocationListener listener)

執行測試,並將結果回報給事件監聽器。

void setAbi(IAbi abi)

void setCollectTestsOnly(boolean shouldCollectTest)

啟用或停用測試收集模式

保護方法

checkExitCode(Integer exitCode)

檢查測試指令傳回的結束代碼。

checkTestOutput(TestInformation testInfo, String actualOutputText, String outputShortName, String outputPrettyName)

檢查測試指令產生的輸出內容。

File createTestLocalTempDirectory(TestInformation testInfo)

在測試的依附元件資料夾中建立本機暫存目錄,以收集測試 當中包含測試的裝置輸出內容

executeCheckerTest(TestInformation testInfo, ITestInvocationListener listener)

執行 Checker 測試並檢查輸出結果。

void extractSourcesFromJar(File tmpCheckerLocalDir, File jar)

將指定 jar 檔案中的 src 目錄擷取至指定的目錄。

File getCheckerBinaryPath(TestInformation testInfo)

找出 Checker 二進位檔 (Python Archive)。

runChecker(String[] checkerCommandLine)

執行 Checker 指令並查看結果。

欄位

CHECKER_PAR_FILENAME

public static final String CHECKER_PAR_FILENAME

公用建構函式

ArtRunTest

public ArtRunTest ()

公用方法

加入所有排除篩選器

public void addAllExcludeFilters ( filters)

新增要排除測試的篩選器 ERROR(/Set)

參數
filters

加入所有篩選器

public void addAllIncludeFilters ( filters)

新增要納入測試的篩選器 ERROR(/Set)

參數
filters

新增排除篩選器

public void addExcludeFilter (String filter)

新增篩選器,篩選出要排除的測試。

參數
filter String

加入篩選器

public void addIncludeFilter (String filter)

新增篩選器,選取要納入的測試。

參數
filter String

清除排除篩選器

public void clearExcludeFilters ()

刪除目前追蹤的所有「排除」篩選器。

ClearIncludeFilters

public void clearIncludeFilters ()

刪除目前追蹤的所有「包含」篩選器。

getAbi

public IAbi getAbi ()

傳回
IAbi

取得排除篩選器

public  getExcludeFilters ()

傳回目前 ERROR(/Set) 的「排除」篩選器。

傳回

getIncludeFilters

public  getIncludeFilters ()

傳回「包含」篩選器的目前 ERROR(/Set)

傳回

得分

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

執行測試,並將結果回報給事件監聽器。

參數
testInfo TestInformationTestInformation 物件,包含可執行的實用資訊 測試。

listener ITestInvocationListener:測試結果的 ITestInvocationListener

擲回
DeviceNotAvailableException

SetAbi

public void setAbi (IAbi abi)

參數
abi IAbi

setCollectTestsOnly

public void setCollectTestsOnly (boolean shouldCollectTest)

啟用或停用測試收集模式

保護方法

檢查結束程式碼

protected  checkExitCode (Integer exitCode)

檢查測試指令傳回的結束代碼。

參數
exitCode Integer:測試指令傳回的結束代碼

傳回
選用的錯誤訊息;如果測試結束代碼表示成功,就會留空

checkTestOutput

protected  checkTestOutput (TestInformation testInfo, 
                String actualOutputText, 
                String outputShortName, 
                String outputPrettyName)

檢查測試指令產生的輸出內容。

用於檢查測試的標準輸出內容和標準錯誤。

參數
testInfo TestInformation:與所執行測試相關聯的 TestInformation 物件

actualOutputText String:測試產生的輸出內容

outputShortName String:輸出頻道的簡稱

outputPrettyName String:輸出管道的優先名稱,用於錯誤訊息

傳回
選填的錯誤訊息;如果勾選的輸出有效,則為空白

createTestLocalTempDirectory

protected File createTestLocalTempDirectory (TestInformation testInfo)

在測試的依附元件資料夾中建立本機暫存目錄,以收集測試 當中包含測試的裝置輸出內容

參數
testInfo TestInformation:與所執行測試相關聯的 TestInformation 物件

傳回
File 指向所建立暫存目錄的 ERROR(/File) 物件。

擲回
如果無法建立臨時目錄。

runCheckerTest

protected  executeCheckerTest (TestInformation testInfo, 
                ITestInvocationListener listener)

執行 Checker 測試並檢查輸出結果。

檢查工具測試是部分 ART 執行測試中包含的額外測試,並以註解形式編寫 ,並用於驗證 ART 編譯器。

參數
testInfo TestInformation:與所執行測試相關聯的 TestInformation 物件

listener ITestInvocationListener:與所執行測試相關聯的 ITestInvocationListener 物件

傳回
選用的錯誤訊息,如果檢查工具測試成功,則為空白

擲回
ArtRunTest.AdbShellCommandException
DeviceNotAvailableException

extractSourcesFromJar

protected void extractSourcesFromJar (File tmpCheckerLocalDir, 
                File jar)

將指定 jar 檔案中的 src 目錄擷取至指定的目錄。

參數
tmpCheckerLocalDir File

jar File

getCheckerBinaryPath

protected File getCheckerBinaryPath (TestInformation testInfo)

找出 Checker 二進位檔 (Python Archive)。

參數
testInfo TestInformation

傳回
File

RunChecker

protected  runChecker (String[] checkerCommandLine)

執行 Checker 指令並查看結果。

參數
checkerCommandLine String:要執行的 Checker 指令列

傳回
選用的錯誤訊息,如果 Checker 叫用成功,就會留空