GTest

public class GTest
extends GTestBase implements IDeviceTest

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


Test, który uruchamia natywny pakiet testów na danym urządzeniu.

Podsumowanie

Konstruktory publiczne

GTest()

Metody publiczne

ITestDevice getDevice()

Przygotuj urządzenie do testowania.

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

void setDevice(ITestDevice device)

Wstrzyknij urządzenie testowe.

void setNativeTestDevicePath(String path)

Chronione metody

String createFlagFile(String filter)

Aby uniknąć ograniczeń systemu operacyjnego dotyczących rozmiaru argumentów, utwórz plik zawierający filtry, które będą używane za pomocą opcji --gtest_flagfile.

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

Metoda pomocnicza do uruchamiania polecenia gtest ze skryptu tymczasowego, gdy polecenie jest zbyt długie, aby można było je uruchomić bezpośrednio przez adb.

String getGTestCmdLine(String fullPath, String flags)

Metoda pomocnicza do tworzenia polecenia gtest do uruchomienia.

String loadFilter(String binaryOnDevice)

Zdefiniuj metodę filtrowania get.

boolean shouldRunFile(String fullPath)

Metoda pomocnicza, która określa, czy należy wykonać dany plik.

Konstruktory publiczne

GTest

public GTest ()

Metody publiczne

getDevice

public ITestDevice getDevice ()

Przygotuj urządzenie do testowania.

Zwroty
ITestDevice ITestDevice

isRebootBeforeTestEnabled

public boolean isRebootBeforeTestEnabled ()

Zwroty
boolean

home run

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

Parametry
testInfo TestInformation

listener ITestInvocationListener

Rzuty
DeviceNotAvailableException

setDevice

public void setDevice (ITestDevice device)

Wstrzyknij urządzenie testowe.

Parametry
device ITestDevice: ITestDevice do użycia

setNativeTestDevicePath

public void setNativeTestDevicePath (String path)

Parametry
path String

Chronione metody

createFlagFile

protected String createFlagFile (String filter)

Aby uniknąć ograniczeń systemu operacyjnego dotyczących rozmiaru argumentów, utwórz plik zawierający filtry, które będą używane za pomocą opcji --gtest_flagfile.

Parametry
filter String: ciąg znaków filtra

Zwroty
String Ścieżka do pliku zawierającego filtr.

Rzuty
DeviceNotAvailableException

executeCommandByScript

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

Metoda pomocnicza do uruchamiania polecenia gtest ze skryptu tymczasowego, gdy polecenie jest zbyt długie, aby można było je uruchomić bezpośrednio przez adb.

Parametry
testDevice ITestDevice: urządzenie, na którym ma być wykonywane polecenie

cmd String: ciąg znaków polecenia do wykonania

resultParser IShellOutputReceiver: odbiorca danych wyjściowych do odczytu wyników testu.

Rzuty
DeviceNotAvailableException

getGTestCmdLine

protected String getGTestCmdLine (String fullPath, 
                String flags)

Metoda pomocnicza do tworzenia polecenia gtest do uruchomienia.

Parametry
fullPath String: bezwzględna ścieżka do pliku binarnego gtest na urządzeniu

flags String: flagi wykonania gtest

Zwroty
String wiersz poleceń w powłoce do uruchomienia dla gtest

loadFilter

protected String loadFilter (String binaryOnDevice)

Zdefiniuj metodę filtrowania get.

Klasa podrzędna musi implementować sposób uzyskiwania własnego filtra.

Parametry
binaryOnDevice String: pełna ścieżka do pliku filtra.

Zwroty
String ciąg znaków filtra.

Rzuty
DeviceNotAvailableException

shouldRunFile

protected boolean shouldRunFile (String fullPath)

Metoda pomocnicza, która określa, czy należy wykonać dany plik.

Parametry
fullPath String: pełna ścieżka do odpowiedniego pliku

Zwroty
boolean true, jeśli należy wykonać wspomniany plik.