ArtRun測試

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

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


運行 ART 運行測試的測試運行器。

概括

嵌套類

class ArtRunTest.AdbShellCommandException

一個異常類,用於報告在執行 ADB shell 命令期間發生的錯誤。

領域

public static final String CHECKER_PAR_FILENAME

公共構造函數

ArtRunTest ()

公共方法

void addAllExcludeFilters ( filters) addAllExcludeFilters ( filters)

添加要排除的測試的過濾器的ERROR(/Set)

void addAllIncludeFilters ( filters) 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 存檔)。

runChecker (String[] checkerCommandLine)

運行 Checker 命令並檢查其結果。

領域

CHECKER_PAR_FILENAME

public static final String CHECKER_PAR_FILENAME

公共構造函數

ArtRun測試

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 ()

刪除當前跟踪的所有排除過濾器。

清除包含過濾器

public void clearIncludeFilters ()

刪除當前跟踪的所有包含過濾器。

得到阿比

public IAbi getAbi ()

退貨
IAbi

獲取排除過濾器

public  getExcludeFilters ()

返回排除過濾器的當前ERROR(/Set)

退貨

getIncludeFilters

public  getIncludeFilters ()

返回包含過濾器的當前ERROR(/Set)

退貨

跑步

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

運行測試,並將結果報告給偵聽器。

參數
testInfo TestInformation :包含運行測試的有用信息的TestInformation對象。

listener ITestInvocationListener : 測試結果的ITestInvocationListener

投擲
DeviceNotAvailableException

設置Abi

public void setAbi (IAbi abi)

參數
abi IAbi

setCollectTestsOnly

public void setCollectTestsOnly (boolean shouldCollectTest)

啟用或禁用測試收集模式

受保護的方法

檢查出口代碼

protected  checkExitCode (Integer exitCode)

檢查測試命令返回的退出代碼。

參數
exitCode Integer : 測試命令返回的退出碼

退貨
可選的錯誤消息,如果測試退出代碼指示成功則為空

檢查測試輸出

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

檢查測試命令產生的輸出。

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

參數
testInfo TestInformation :與執行的測試關聯的TestInformation對象

actualOutputText String :測試產生的輸出

outputShortName String : 輸出通道的簡稱

outputPrettyName String :輸出通道的更漂亮的名稱,用於錯誤消息

退貨
可選的錯誤消息,如果檢查的輸出有效則為空

創建測試本地臨時目錄

protected File createTestLocalTempDirectory (TestInformation testInfo)

在測試的依賴項文件夾中創建一個本地臨時目錄,以收集從被測設備中提取的測試輸出。

參數
testInfo TestInformation :與執行的測試關聯的TestInformation對象

退貨
File指向創建的臨時目錄的ERROR(/File)對象。

投擲
如果創建臨時目錄失敗。

執行檢查器測試

protected  executeCheckerTest (TestInformation testInfo, 
                ITestInvocationListener listener)

執行 Checker 測試並檢查其輸出。

Checker 測試是一些 ART 運行測試中包​​含的附加測試,在測試源文件的註釋中作為註釋編寫,用於驗證 ART 的編譯器。

參數
testInfo TestInformation :與執行的測試關聯的TestInformation對象

listener ITestInvocationListener :與執行的測試關聯的ITestInvocationListener對象

退貨
可選的錯誤消息,如果 Checker 測試成功則為空

投擲
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 存檔)。

參數
testInfo TestInformation

退貨
File

運行檢查器

protected  runChecker (String[] checkerCommandLine)

運行 Checker 命令並檢查其結果。

參數
checkerCommandLine String :要執行的 Checker 命令行

退貨
可選的錯誤消息,如果 Checker 調用成功則為空