to top
public class

GTest

extends Object
implements IDeviceTest IRemoteTest
java.lang.Object
   ↳ com.android.tradefed.testtype.GTest

Class Overview

A Test that runs a native test package on given device.

Summary

Constants
String DEFAULT_NATIVETEST_PATH
Public Constructors
GTest()
Public Methods
ITestDevice getDevice()
Get the device under test.
String getModuleName(String moduleName)
Get the Android native test module to run.
boolean getRunDisabledTests()
Get whether GTest should run disabled tests.
String getTestNameNegativeFilter()
Get the Android native test name to run (negative filter).
String getTestNamePositiveFilter()
Get the Android native test name to run (positive filter).
void run(ITestInvocationListener listener)
Runs the tests, and reports result to the listener.
void setDevice(ITestDevice device)
Inject the device under test.
void setModuleName(String moduleName)
Set the Android native test module to run.
void setRunDisabled(boolean runDisabled)
Set whether GTest should run disabled tests.
void setTestNameNegativeFilter(String testName)
Set the Android native test name to run (negative filter).
void setTestNamePositiveFilter(String testName)
Set the Android native test name to run (positive filter).
Protected Methods
String getGTestCmdLine(String fullPath, String flags)
Helper method to build the gtest command to run.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.tradefed.testtype.IDeviceTest
From interface com.android.tradefed.testtype.IRemoteTest

Constants

static final String DEFAULT_NATIVETEST_PATH

Constant Value: "/data/nativetest"

Public Constructors

public GTest ()

Public Methods

public ITestDevice getDevice ()

Get the device under test.

Returns

public String getModuleName (String moduleName)

Get the Android native test module to run.

Returns
  • the name of the native test module to run, or null if not set

public boolean getRunDisabledTests ()

Get whether GTest should run disabled tests.

Returns
  • True if disabled tests should be run, false otherwise

public String getTestNameNegativeFilter ()

Get the Android native test name to run (negative filter).

Returns
  • the negative filter of the name of the native test to run

public String getTestNamePositiveFilter ()

Get the Android native test name to run (positive filter).

Returns
  • the positive filter of the name of the native test to run

public void run (ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

Parameters
listener the ITestInvocationListener of test results

public void setDevice (ITestDevice device)

Inject the device under test.

Parameters
device the ITestDevice to use

public void setModuleName (String moduleName)

Set the Android native test module to run.

Parameters
moduleName The name of the native test module to run

public void setRunDisabled (boolean runDisabled)

Set whether GTest should run disabled tests.

public void setTestNameNegativeFilter (String testName)

Set the Android native test name to run (negative filter).

Parameters
testName A negative filter of the name of the native test to run

public void setTestNamePositiveFilter (String testName)

Set the Android native test name to run (positive filter).

Parameters
testName A positive filter of the name of the native test to run

Protected Methods

protected String getGTestCmdLine (String fullPath, String flags)

Helper method to build the gtest command to run.

Parameters
fullPath absolute file system path to gtest binary on device
flags gtest execution flags
Returns
  • the shell command line to run for the gtest