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)

args 크기의 OS 제한을 방지하기 위해 --gtest_flagfile을 통해 사용될 필터가 포함된 파일을 만듭니다.

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

명령어가 너무 길어 adb에서 직접 실행할 수 없는 경우 임시 스크립트에서 gtest 명령어를 실행하는 도우미 메서드입니다.

String getGTestCmdLine(String fullPath, String flags)

실행할 gtest 명령어를 빌드하는 도우미 메서드입니다.

String loadFilter(String binaryOnDevice)

get filter 메서드를 정의합니다.

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)

args 크기의 OS 제한을 방지하기 위해 --gtest_flagfile을 통해 사용될 필터가 포함된 파일을 만듭니다.

매개변수
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를 실행할 셸 명령줄

loadFilter

protected String loadFilter (String binaryOnDevice)

get filter 메서드를 정의합니다.

서브클래스는 자체 필터를 가져오는 방법을 구현해야 합니다.

매개변수
binaryOnDevice String: 필터 파일의 전체 경로입니다.

반환 값
String 필터 문자열을 사용합니다.

생성 값
DeviceNotAvailableException

shouldRunFile

protected boolean shouldRunFile (String fullPath)

지정된 파일을 실행해야 하는지 확인하는 도우미 메서드입니다.

매개변수
fullPath String: 문제의 파일의 전체 경로입니다.

반환 값
boolean 해당 파일을 실행해야 하는 경우 true입니다.