ExecutableBaseTest
public
abstract
class
ExecutableBaseTest
extends Object
implements
IAbiReceiver,
IConfigurationReceiver,
IDiscoverDependencies,
IRemoteTest,
IRuntimeHintProvider,
IShardableTest,
ITestCollector,
ITestFilterReceiver
| java.lang.Object | |
| ↳ | com.android.tradefed.testtype.binary.ExecutableBaseTest |
実行可能なスタイルのテスト用の基本クラス。例: バイナリ、シェル スクリプト。
概要
フィールド | |
|---|---|
public
static
final
String |
NO_BINARY_ERROR
|
パブリック コンストラクタ | |
|---|---|
ExecutableBaseTest()
|
|
パブリック メソッド | |
|---|---|
void
|
addAllExcludeFilters(
除外するテストのフィルタの |
void
|
addAllIncludeFilters(
含めるテストのフィルタの |
void
|
addExcludeFilter(String filter)
除外するテストのフィルタを追加します。 |
void
|
addIncludeFilter(String filter)
含めるテストのフィルタを追加します。 |
void
|
clearExcludeFilters()
現在トラッキングされている除外フィルタをすべて削除します。 |
void
|
clearIncludeFilters()
現在トラッキングされている除外フィルタをすべて削除します。 |
abstract
String
|
findBinary(String binary)
バイナリを検索して実行できるようにします。 |
IAbi
|
getAbi()
|
boolean
|
getCollectTestsOnly()
|
|
getExcludeFilters()
除外フィルタの現在の |
|
getIncludeFilters()
包含フィルタの現在の |
final
long
|
getRuntimeHint()
テストの予想実行時間をミリ秒単位で返します。 |
|
reportDependencies()
|
void
|
run(TestInformation testInfo, ITestInvocationListener listener)
テストを実行し、結果をリスナーに報告します。 |
abstract
void
|
runBinary(String binaryPath, ITestInvocationListener listener, TestDescription description)
指定されたパスでバイナリを実際に実行します。 |
final
void
|
setAbi(IAbi abi)
|
final
void
|
setCollectTestsOnly(boolean shouldCollectTest)
テスト収集モードを有効または無効にする |
void
|
setConfiguration(IConfiguration configuration)
使用中の |
FailureDescription
|
shouldAbortRun(TestDescription description)
testRun を早期に終了する必要があるかどうかを確認します。 |
final
|
split(int shardHint)
|
保護されたメソッド | |
|---|---|
boolean
|
doesRunBinaryGenerateTestResults()
|
boolean
|
doesRunBinaryGenerateTestRuns()
|
|
getAllTestCommands()
整合性を確保するため、mBinaryPaths を mTestCommands に変換。 |
IConfiguration
|
getConfiguration()
テスト構成を返します。 |
TestDescription[]
|
getFilterDescriptions(
|
String
|
getModuleId(IInvocationContext context)
|
long
|
getTimeoutPerBinaryMs()
|
boolean
|
isTestFailed(String testName)
|
フィールド
NO_BINARY_ERROR
public static final String NO_BINARY_ERROR
パブリック コンストラクタ
ExecutableBaseTest
public ExecutableBaseTest ()
パブリック メソッド
addAllExcludeFilters
public void addAllExcludeFilters (filters)
除外するテストのフィルタの ERROR(/Set) を追加します。
| パラメータ | |
|---|---|
filters |
|
addAllIncludeFilters
public void addAllIncludeFilters (filters)
含めるテストのフィルタの ERROR(/Set) を追加します。
| パラメータ | |
|---|---|
filters |
|
addExcludeFilter
public void addExcludeFilter (String filter)
除外するテストのフィルタを追加します。
| パラメータ | |
|---|---|
filter |
String |
addIncludeFilter
public void addIncludeFilter (String filter)
含めるテストのフィルタを追加します。
| パラメータ | |
|---|---|
filter |
String |
clearExcludeFilters
public void clearExcludeFilters ()
現在トラッキングされている除外フィルタをすべて削除します。
clearIncludeFilters
public void clearIncludeFilters ()
現在トラッキングされている含めるフィルタをすべて削除します。
findBinary
public abstract String findBinary (String binary)
バイナリを検索して実行できるようにします。
| パラメータ | |
|---|---|
binary |
String: バイナリのパスまたはバイナリ名。 |
| 戻り値 | |
|---|---|
String |
バイナリのパス。見つからない場合は null。 |
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
getCollectTestsOnly
public boolean getCollectTestsOnly ()
| 戻り値 | |
|---|---|
boolean |
|
getRuntimeHint
public final long getRuntimeHint ()
テストの予想実行時間をミリ秒単位で返します。この時間は、シャーディングされた実行のロード バランシングに使用されます。
| 戻り値 | |
|---|---|
long |
|
reportDependencies
publicreportDependencies ()
| 戻り値 | |
|---|---|
|
|
ホームラン
public void run (TestInformation testInfo, ITestInvocationListener listener)
テストを実行し、結果をリスナーに報告します。
| パラメータ | |
|---|---|
testInfo |
TestInformation: テストの実行に役立つ情報が含まれる TestInformation オブジェクト。 |
listener |
ITestInvocationListener: テスト結果の ITestInvocationListener |
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
runBinary
public abstract void runBinary (String binaryPath,
ITestInvocationListener listener,
TestDescription description)指定されたパスでバイナリを実際に実行します。
| パラメータ | |
|---|---|
binaryPath |
String: バイナリのパス。 |
listener |
ITestInvocationListener: 結果を報告するリスナー。 |
description |
TestDescription: 進行中のテスト。 |
| 例外 | |
|---|---|
DeviceNotAvailableException |
|
setCollectTestsOnly
public final void setCollectTestsOnly (boolean shouldCollectTest)
テスト収集モードを有効または無効にする
setConfiguration
public void setConfiguration (IConfiguration configuration)
使用中の IConfiguration を挿入します。
| パラメータ | |
|---|---|
configuration |
IConfiguration |
shouldAbortRun
public FailureDescription shouldAbortRun (TestDescription description)
testRun を早期に終了する必要があるかどうかを確認します。
| パラメータ | |
|---|---|
description |
TestDescription: 進行中のテスト。 |
| 戻り値 | |
|---|---|
FailureDescription |
実行ループを終了する必要がある場合の FailureDescription。 |
分割
public finalsplit (int shardHint)
split() の代替バージョン。実行が試行される shardCount も提供します。これは、場合によっては任意に決定できない一部のテストランナーに便利です。
| パラメータ | |
|---|---|
shardHint |
int: 試行されたシャードの数。 |
| 戻り値 | |
|---|---|
|
個別に実行されるサブテストのコレクション。テストが現在シャーディング可能でない場合は null |
保護されたメソッド
doesRunBinaryGenerateTestResults
protected boolean doesRunBinaryGenerateTestResults ()
| 戻り値 | |
|---|---|
boolean |
|
doesRunBinaryGenerateTestRuns
protected boolean doesRunBinaryGenerateTestRuns ()
| 戻り値 | |
|---|---|
boolean |
|
getAllTestCommands
protectedgetAllTestCommands ()
整合性を保つため、mBinaryPaths を mTestCommands に変換しました。
| 戻り値 | |
|---|---|
|
testCommands の MapERROR(/LinkedHashMap)<string, string="">。</string,> |
getConfiguration
protected IConfiguration getConfiguration ()
テスト構成を返します。
| 戻り値 | |
|---|---|
IConfiguration |
IConfiguration |
getFilterDescriptions
protected TestDescription[] getFilterDescriptions (testCommands)
| パラメータ | |
|---|---|
testCommands |
|
| 戻り値 | |
|---|---|
TestDescription[] |
|
getModuleId
protected String getModuleId (IInvocationContext context)
| パラメータ | |
|---|---|
context |
IInvocationContext |
| 戻り値 | |
|---|---|
String |
|
getTimeoutPerBinaryMs
protected long getTimeoutPerBinaryMs ()
| 戻り値 | |
|---|---|
long |
各バイナリに適用される実行タイムアウト。 |
isTestFailed
protected boolean isTestFailed (String testName)
| パラメータ | |
|---|---|
testName |
String |
| 戻り値 | |
|---|---|
boolean |
|