GTestBase

public abstract class GTestBase
extends Object implements IAbiReceiver, IConfigurationReceiver, IRemoteTest, IRuntimeHintProvider, IShardableTest, ITestCollector, ITestFilterReceiver

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


gTest の基本クラス

概要

フィールド

protected static final String FILTER_EXTENSION

protected static final String GTEST_FLAG_FILE

protected static final String GTEST_FLAG_FILTER

protected static final String GTEST_FLAG_LIST_TESTS

protected static final String GTEST_FLAG_PRINT_TIME

protected static final String GTEST_FLAG_RUN_DISABLED_TESTS

protected static final String GTEST_XML_OUTPUT

パブリック コンストラクタ

GTestBase()

パブリック メソッド

void addAllExcludeFilters( filters)

除外するテストのフィルタの ERROR(/Set) を追加します。

void addAllIncludeFilters( filters)

含めるテストのフィルタの ERROR(/Set) を追加します。

void addExcludeFilter(String filter)

除外するテストのフィルタを追加します。

void addIncludeFilter(String filter)

含めるテストのフィルタを追加します。

String cleanFilter(String filter)
void clearExcludeFilters()

現在トラッキングされている除外フィルタをすべて削除します。

void clearIncludeFilters()

現在トラッキングされている一致フィルタをすべて削除します。

IAbi getAbi()
getAfterTestCmd()

GTest の後に実行するシェルコマンドを取得します。

getBeforeTestCmd()

GTest の前に実行するシェルコマンドを取得します。

getExcludeFilters()

除外フィルタの現在の ERROR(/Set) を返します。

getFileExclusionFilterRegex()

特定のファイルを実行対象から除外する正規表現を取得します。

getGTestFlags()

ネイティブ テストのシェルコマンドに渡す追加のフラグ値を取得します。

getIncludeFilters()

一致フィルタの現在の ERROR(/Set) を返します。

long getMaxTestTimeMs()

gtest の最大実行時間を取得します。

String getModuleName()

実行する Android ネイティブ テスト モジュールを取得します。

boolean getRunDisabledTests()

GTest が無効なテストを実行するかどうかを取得します。

long getRuntimeHint()

テストで想定される実行時間を ミリ秒単位です。

int getShardCount()

現在のシャード数を返します。

int getShardIndex()

このテストのシャード インデックスを取得します。

String getTestFilterKey()

テストフィルタキーを取得します。

String getTestModule()

モジュール名を取得します。

boolean isCollectTestsOnly()

テストバイナリの呼び出しのみを行い、該当するテストケースのリストを収集します。

boolean isEnableXmlOutput()

テスト結果に gtest xml 出力を使用するかどうかを取得します。

boolean isSharded()

isSharded フラグを取得します。

void notifyTestExecution(boolean incompleteTestFound, failedTests)

包含フィルタと除外フィルタを適切に処理できるように、テスト実行を親に通知 再試行回数を表します。

void setAbi(IAbi abi)
void setCollectTestsOnly(boolean shouldCollectTest)

テスト収集モードを有効または無効にします

void setConfiguration(IConfiguration configuration)

使用中の IConfiguration を注入します。

void setModuleName(String moduleName)

Android ネイティブ テスト モジュールを実行するように設定します。

void setShardCount(int shardCount)

このテストのシャード数を設定します。

void setShardIndex(int shardIndex)

このテストのシャード インデックスを設定します。

split(int shardCountHint)

split() の代替バージョン。試行対象の shardCount も提供されます。 指定します。

保護されたメソッド

String createFlagFile(String filter)

OS を回避するために --gtest_flagfile を介して使用するフィルタを含むファイルを作成します いくつかあります。

void erasePrependedFileName( filters, String filename)
String getAllGTestFlags(String path)

adb シェルコマンドに渡すすべての GTest フラグを取得するヘルパー。

IConfiguration getConfiguration()

テスト構成を返します。

String getExceptionMessage(Exception e)

与えられた意味のある短い説明メッセージを取得するために最善を尽くす Exception

String getGTestCmdLine(String fullPath, String flags)

実行する gtest コマンドをビルドするヘルパー メソッド。

String getGTestCmdLineWrapper(String fullPath, String flags)

派生クラスが gtest コマンドを他のツール(chroot、 strace、gdb など)。

String getGTestFilters(String path)

実行するテストの g-test フィルタを取得するヘルパー。

ITestInvocationListener getGTestListener(ITestInvocationListener listener)

追加のデバッグ情報(Detection や mDisabledDuplicateCheck が false の場合、重複テストを報告。

abstract String loadFilter(String path)

get フィルタ メソッドを定義します。

void setRunDisabled(boolean runDisabled)

GTest が無効なテストを実行するかどうかを設定します。

フィールド

フィルタ拡張

protected static final String FILTER_EXTENSION

GTEST_FLAG_FILE

protected static final String GTEST_FLAG_FILE

GTEST_FLAG_FILTER

protected static final String GTEST_FLAG_FILTER

GTEST_FLAG_LIST_TESTS

protected static final String GTEST_FLAG_LIST_TESTS

GTEST_FLAG_PRINT_TIME

protected static final String GTEST_FLAG_PRINT_TIME

GTEST_FLAG_RUN_DISABLED_TESTS

protected static final String GTEST_FLAG_RUN_DISABLED_TESTS

GTEST_XML_OUTPUT

protected static final String GTEST_XML_OUTPUT

パブリック コンストラクタ

GTestBase

public GTestBase ()

パブリック メソッド

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

cleanFilter

public String cleanFilter (String filter)

パラメータ
filter String

戻り値
String

「clearExcludeFilters」

public void clearExcludeFilters ()

現在トラッキングされている除外フィルタをすべて削除します。

ClearIncludeFilters

public void clearIncludeFilters ()

現在トラッキングされている一致フィルタをすべて削除します。

getAbi

public IAbi getAbi ()

戻り値
IAbi

getAfterTestCmd

public  getAfterTestCmd ()

GTest の後に実行するシェルコマンドを取得します。

戻り値

getBeforeTestCmd

public  getBeforeTestCmd ()

GTest の前に実行するシェルコマンドを取得します。

戻り値

getExcludeFilters

public  getExcludeFilters ()

除外フィルタの現在の ERROR(/Set) を返します。

戻り値

getFileExclusionFilterRegex

public  getFileExclusionFilterRegex ()

特定のファイルを実行対象から除外する正規表現を取得します。

戻り値

getGTestFlags

public  getGTestFlags ()

ネイティブ テストのシェルコマンドに渡す追加のフラグ値を取得します。

戻り値

getIncludeFilters

public  getIncludeFilters ()

一致フィルタの現在の ERROR(/Set) を返します。

戻り値

getMaxTestTimeMs

public long getMaxTestTimeMs ()

gtest の最大実行時間を取得します。

戻り値
long

getModuleName

public String getModuleName ()

実行する Android ネイティブ テスト モジュールを取得します。

戻り値
String 実行するネイティブ テスト モジュールの名前。設定されていない場合は null

getRunDisabledTests

public boolean getRunDisabledTests ()

GTest が無効なテストを実行するかどうかを取得します。

戻り値
boolean 無効化されたテストを実行する場合は true、それ以外の場合は false

getRuntimeHint

public long getRuntimeHint ()

テストで想定される実行時間を ミリ秒単位です。 この時間は、シャーディングされた実行のロード バランシングに使用されます

戻り値
long

getShardCount

public int getShardCount ()

現在のシャード数を返します。

戻り値
int

getShardIndex

public int getShardIndex ()

このテストのシャード インデックスを取得します。

戻り値
int

getTestFilterKey

public String getTestFilterKey ()

テストフィルタキーを取得します。

戻り値
String

getTestModule

public String getTestModule ()

モジュール名を取得します。

戻り値
String

isCollectTestsOnly

public boolean isCollectTestsOnly ()

テストバイナリの呼び出しのみを行い、該当するテストケースのリストを収集します。

戻り値
boolean

isEnableXmlOutput

public boolean isEnableXmlOutput ()

テスト結果に gtest xml 出力を使用するかどうかを取得します。

戻り値
boolean

isSharded

public boolean isSharded ()

isSharded フラグを取得します。

戻り値
boolean

notificationTestExecution

public void notifyTestExecution (boolean incompleteTestFound, 
                 failedTests)

包含フィルタと除外フィルタを適切に処理できるように、テスト実行を親に通知 再試行回数を表します。

パラメータ
incompleteTestFound boolean

failedTests

setAbi

public void setAbi (IAbi abi)

パラメータ
abi IAbi

setCollectTestsOnly

public void setCollectTestsOnly (boolean shouldCollectTest)

テスト収集モードを有効または無効にします

setConfiguration

public void setConfiguration (IConfiguration configuration)

使用中の IConfiguration を注入します。

パラメータ
configuration IConfiguration

setModuleName

public void setModuleName (String moduleName)

Android ネイティブ テスト モジュールを実行するように設定します。

パラメータ
moduleName String: 実行するネイティブ テスト モジュールの名前

setShardCount

public void setShardCount (int shardCount)

このテストのシャード数を設定します。

パラメータ
shardCount int

setShardIndex

public void setShardIndex (int shardIndex)

このテストのシャード インデックスを設定します。

パラメータ
shardIndex int

分割

public  split (int shardCountHint)

split() の代替バージョン。試行対象の shardCount も提供されます。 指定します。これは、場合によって任意に決定できないテストランナーに有用です。

パラメータ
shardCountHint int: 試行されたシャードの数。

戻り値
個別に実行するサブテストのコレクション。テストが必要な場合は null 現在シャーディング不可

保護されたメソッド

createFlagFile

protected String createFlagFile (String filter)

OS を回避するために --gtest_flagfile を介して使用するフィルタを含むファイルを作成します いくつかあります。

パラメータ
filter String: フィルタ文字列

戻り値
String フィルタを含むファイルのパス。

例外
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

消去 PrependedFileName

protected void erasePrependedFileName ( filters, 
                String filename)

パラメータ
filters

filename String

getAllGTestFlags

protected String getAllGTestFlags (String path)

adb シェルコマンドに渡すすべての GTest フラグを取得するヘルパー。

パラメータ
path String: デバイス上のバイナリのフルパス。

戻り値
String GTest に渡すすべての GTest フラグの String

例外
DeviceNotAvailableException

getConfiguration

protected IConfiguration getConfiguration ()

テスト構成を返します。

戻り値
IConfiguration IConfiguration

getExceptionMessage

protected String getExceptionMessage (Exception e)

与えられた意味のある短い説明メッセージを取得するために最善を尽くす Exception

パラメータ
e Exception: Exception

戻り値
String 短いメッセージ

getGTestCmdLine

protected String getGTestCmdLine (String fullPath, 
                String flags)

実行する gtest コマンドをビルドするヘルパー メソッド。

パラメータ
fullPath String: デバイス上の gtest バイナリへのファイル システムの絶対パス

flags String: gtest 実行フラグ

戻り値
String gtest で実行するシェル コマンドライン

getGTestCmdLineWrapper

protected String getGTestCmdLineWrapper (String fullPath, 
                String flags)

派生クラスが gtest コマンドを他のツール(chroot、 strace、gdb など)。

パラメータ
fullPath String

flags String

戻り値
String

getGTestFilters

protected String getGTestFilters (String path)

実行するテストの g-test フィルタを取得するヘルパー。

フィルタは関数名のみでフィルタします(例: Google Test "Test")。すべての Google 「テストケース」をテストする考慮されません。

パラメータ
path String: デバイス上のバイナリのフルパス。

戻り値
String g-test に渡す完全なフィルタフラグ。存在しない場合は空の文字列。 指定済み

例外
DeviceNotAvailableException

getGTestListener

protected ITestInvocationListener getGTestListener (ITestInvocationListener listener)

追加のデバッグ情報(Detection や mDisabledDuplicateCheck が false の場合、重複テストを報告。それ以外の場合は、渡された 呼び出すことができます。

パラメータ
listener ITestInvocationListener

戻り値
ITestInvocationListener

loadFilter

protected abstract String loadFilter (String path)

get フィルタ メソッドを定義します。

サブクラスは、独自のフィルタを取得する方法を実装する必要があります。

パラメータ
path String: フィルタ ファイルのフルパス。

戻り値
String フィルタ文字列を指定します。

例外
DeviceNotAvailableException

setRunDisabled

protected void setRunDisabled (boolean runDisabled)

GTest が無効なテストを実行するかどうかを設定します。

パラメータ
runDisabled boolean