GTest

public class GTest
extends GTestBase implements IDeviceTest

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


特定のデバイスでネイティブ テスト パッケージを実行するテスト。

まとめ

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

GTest ()

公開メソッド

ITestDevice getDevice ()

テスト対象のデバイスを取得します。

boolean isRebootBeforeTestEnabled ()
void run ( TestInformation testInfo, ITestInvocationListener listener)

void setDevice ( ITestDevice device)

テスト対象のデバイスを注入します。

void setNativeTestDevicePath (String path)

保護されたメソッド

String createFlagFile (String filter)

--gtest_flagfile を介して使用されるフィルターを含むファイルを作成して、引数サイズの OS 制限を回避します。

void executeCommandByScript ( ITestDevice testDevice, String cmd, IShellOutputReceiver resultParser)

コマンドが長すぎて adb で直接実行できない場合に、一時スクリプトから gtest コマンドを実行するヘルパー メソッド。

String getGTestCmdLine (String fullPath, String flags)

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

String loadFilter (String binaryOnDevice)

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

boolean shouldRunFile (String fullPath)

特定のファイルを実行する必要があるかどうかを判断するヘルパー メソッド。

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

GTest

public GTest ()

公開メソッド

getDevice

public ITestDevice getDevice ()

テスト対象のデバイスを取得します。

戻り値
ITestDevice ITestDevice

isRebootBeforeTestEnabled

public boolean isRebootBeforeTestEnabled ()

戻り値
boolean

走る

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

パラメーター
testInfo TestInformation

listener ITestInvocationListener

スロー
DeviceNotAvailableException

setDevice

public void setDevice (ITestDevice device)

テスト対象のデバイスを注入します。

パラメーター
device ITestDevice : 使用するITestDevice

setNativeTestDevicePath

public void setNativeTestDevicePath (String path)

パラメーター
path String

保護されたメソッド

createFlagFile

protected String createFlagFile (String filter)

--gtest_flagfile を介して使用されるフィルターを含むファイルを作成して、引数サイズの OS 制限を回避します。

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

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

スロー
DeviceNotAvailableException

executeCommandByScript

protected void executeCommandByScript (ITestDevice testDevice, 
                String cmd, 
                IShellOutputReceiver resultParser)

コマンドが長すぎて adb で直接実行できない場合に、一時スクリプトから gtest コマンドを実行するヘルパー メソッド。

パラメーター
testDevice ITestDevice : コマンドを実行するデバイス

cmd String : 実行するコマンド文字列

resultParser IShellOutputReceiver : テスト結果を読み取るための出力レシーバー

スロー
DeviceNotAvailableException

getGTestCmdLine

protected String getGTestCmdLine (String fullPath, 
                String flags)

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

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

flags String : gtest 実行フラグ

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

ロードフィルター

protected String loadFilter (String binaryOnDevice)

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

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

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

戻り値
Stringフィルタ文字列。

スロー
DeviceNotAvailableException

shouldRunFile

protected boolean shouldRunFile (String fullPath)

特定のファイルを実行する必要があるかどうかを判断するヘルパー メソッド。

パラメーター
fullPath String : 問題のファイルのフル パス

戻り値
boolean上記のファイルを実行する必要がある場合は true。

スロー
DeviceNotAvailableException