藝術運行測試

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)

將 src 目錄從給定的 jar 檔案提取到給定的目錄。

File getCheckerBinaryPath ( TestInformation testInfo)

找到 Checker 二進位(Python 檔案)。

runChecker (String[] checkerCommandLine)

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

領域

CHECKER_PAR_FILENAME

public static final String CHECKER_PAR_FILENAME

公共構造函數

藝術運行測試

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)

退貨

取得包含過濾器

public  getIncludeFilters ()

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

退貨

跑步

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

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

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

listener ITestInvocationListener :測試結果的ITestInvocationListener

投擲
DeviceNotAvailableException

設定阿比

public void setAbi (IAbi abi)

參數
abi IAbi

僅設定收集測試

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 測試並檢查其輸出。

檢查器測試是一些 ART 運行測試中包​​含的附加測試,以註釋形式編寫在測試原始檔的註釋中,並用於驗證 ART 的編譯器。

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

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

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

投擲
ArtRunTest.AdbShellCommandException
DeviceNotAvailableException

從 Jar 中提取來源

protected void extractSourcesFromJar (File tmpCheckerLocalDir, 
                File jar)

將 src 目錄從給定的 jar 檔案提取到給定的目錄。

參數
tmpCheckerLocalDir File

jar File

取得CheckerBinaryPath

protected File getCheckerBinaryPath (TestInformation testInfo)

找到 Checker 二進位(Python 檔案)。

參數
testInfo TestInformation

退貨
File

運行檢查器

protected  runChecker (String[] checkerCommandLine)

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

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

退貨
可選錯誤訊息,如果 Checker 呼叫成功則為空

,

藝術運行測試

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)

將 src 目錄從給定的 jar 檔案提取到給定的目錄。

File getCheckerBinaryPath ( TestInformation testInfo)

找到 Checker 二進位(Python 檔案)。

runChecker (String[] checkerCommandLine)

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

領域

CHECKER_PAR_FILENAME

public static final String CHECKER_PAR_FILENAME

公共構造函數

藝術運行測試

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)

退貨

取得包含過濾器

public  getIncludeFilters ()

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

退貨

跑步

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

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

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

listener ITestInvocationListener :測試結果的ITestInvocationListener

投擲
DeviceNotAvailableException

設定阿比

public void setAbi (IAbi abi)

參數
abi IAbi

僅設定收集測試

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 測試並檢查其輸出。

檢查器測試是一些 ART 運行測試中包​​含的附加測試,以註釋形式編寫在測試原始檔的註釋中,並用於驗證 ART 的編譯器。

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

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

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

投擲
ArtRunTest.AdbShellCommandException
DeviceNotAvailableException

從 Jar 中提取來源

protected void extractSourcesFromJar (File tmpCheckerLocalDir, 
                File jar)

將 src 目錄從給定的 jar 檔案提取到給定的目錄。

參數
tmpCheckerLocalDir File

jar File

取得CheckerBinaryPath

protected File getCheckerBinaryPath (TestInformation testInfo)

找到 Checker 二進位(Python 檔案)。

參數
testInfo TestInformation

退貨
File

運行檢查器

protected  runChecker (String[] checkerCommandLine)

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

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

退貨
可選錯誤訊息,如果 Checker 呼叫成功則為空