藝術運行測試
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) 新增要排除的測試的過濾器的 |
void | addAllIncludeFilters ( filters) addAllIncludeFilters ( filters) 新增要包含的測試的過濾器的 |
void | addExcludeFilter (String filter) 新增要排除的測試的過濾器。 |
void | addIncludeFilter (String filter) 新增要包含的測試的過濾器。 |
void | clearExcludeFilters () 刪除目前追蹤的所有排除過濾器。 |
void | clearIncludeFilters () 刪除目前追蹤的所有包含過濾器。 |
IAbi | getAbi () |
getExcludeFilters () 傳回排除過濾器的目前 | |
getIncludeFilters () 傳回包含篩選器的目前 | |
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 addExcludeFilter (String filter)
新增要排除的測試的過濾器。
參數 | |
---|---|
filter | String |
新增包含過濾器
public void addIncludeFilter (String filter)
新增要包含的測試的過濾器。
參數 | |
---|---|
filter | String |
清除排除過濾器
public void clearExcludeFilters ()
刪除目前追蹤的所有排除過濾器。
清除包含過濾器
public void clearIncludeFilters ()
刪除目前追蹤的所有包含過濾器。
跑步
public void run (TestInformation testInfo, ITestInvocationListener listener)
運行測試,並將結果報告給偵聽器。
參數 | |
---|---|
testInfo | TestInformation : TestInformation 物件包含執行測試的有用資訊。 |
listener | ITestInvocationListener :測試結果的ITestInvocationListener |
投擲 | |
---|---|
DeviceNotAvailableException |
僅設定收集測試
public void setCollectTestsOnly (boolean shouldCollectTest)
啟用或停用測試收集模式
受保護的方法
檢查退出代碼
protectedcheckExitCode (Integer exitCode)
檢查測試命令傳回的退出代碼。
參數 | |
---|---|
exitCode | Integer : 測試命令傳回的退出程式碼 |
退貨 | |
---|---|
可選的錯誤訊息,如果測試退出代碼指示成功,則為空 |
檢查測試輸出
protectedcheckTestOutput (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) 物件。 |
投擲 | |
---|---|
| 如果暫存目錄建立失敗。 |
執行檢查器測試
protectedexecuteCheckerTest (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 |
運行檢查器
protectedrunChecker (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) 新增要排除的測試的過濾器的 |
void | addAllIncludeFilters ( filters) addAllIncludeFilters ( filters) 新增要包含的測試的過濾器的 |
void | addExcludeFilter (String filter) 新增要排除的測試的過濾器。 |
void | addIncludeFilter (String filter) 新增要包含的測試的過濾器。 |
void | clearExcludeFilters () 刪除目前追蹤的所有排除過濾器。 |
void | clearIncludeFilters () 刪除目前追蹤的所有包含過濾器。 |
IAbi | getAbi () |
getExcludeFilters () 傳回排除過濾器的目前 | |
getIncludeFilters () 傳回包含篩選器的目前 | |
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 addExcludeFilter (String filter)
新增要排除的測試的過濾器。
參數 | |
---|---|
filter | String |
新增包含過濾器
public void addIncludeFilter (String filter)
新增要包含的測試的過濾器。
參數 | |
---|---|
filter | String |
清除排除過濾器
public void clearExcludeFilters ()
刪除目前追蹤的所有排除過濾器。
清除包含過濾器
public void clearIncludeFilters ()
刪除目前追蹤的所有包含過濾器。
跑步
public void run (TestInformation testInfo, ITestInvocationListener listener)
運行測試,並將結果報告給偵聽器。
參數 | |
---|---|
testInfo | TestInformation : TestInformation 物件包含執行測試的有用資訊。 |
listener | ITestInvocationListener :測試結果的ITestInvocationListener |
投擲 | |
---|---|
DeviceNotAvailableException |
僅設定收集測試
public void setCollectTestsOnly (boolean shouldCollectTest)
啟用或停用測試收集模式
受保護的方法
檢查退出代碼
protectedcheckExitCode (Integer exitCode)
檢查測試命令傳回的退出代碼。
參數 | |
---|---|
exitCode | Integer : 測試命令傳回的退出程式碼 |
退貨 | |
---|---|
可選的錯誤訊息,如果測試退出代碼指示成功,則為空 |
檢查測試輸出
protectedcheckTestOutput (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) 物件。 |
投擲 | |
---|---|
| 如果暫存目錄建立失敗。 |
執行檢查器測試
protectedexecuteCheckerTest (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 |
運行檢查器
protectedrunChecker (String[] checkerCommandLine)
執行 Checker 命令並檢查其結果。
參數 | |
---|---|
checkerCommandLine | String : 要執行的 Checker 命令列 |
退貨 | |
---|---|
可選錯誤訊息,如果 Checker 呼叫成功則為空 |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2023-12-01 (世界標準時間)。