to top
public class

NativeStressTest

extends Object
implements IDeviceTest IRemoteTest @OptionClass(alias = "native-stress")
java.lang.Object
   ↳ com.android.tradefed.testtype.NativeStressTest

Class Overview

A Test that runs a native stress test executable on given device.

It uses NativeStressTestParser to parse out number of iterations completed and report those results to the ITestInvocationListeners.

Summary

Constants
String AVG_ITERATION_TIME_KEY
String DEFAULT_TEST_PATH
String ITERATION_KEY
Fields
private String mDeviceTestPath @Option(name = "native-stress-device-path", description = "The path on the device where native stress tests are located.")
private int mMaxIterationTime @Option(name = "max-iteration-time", description = "The maximum time to allow for one stress test iteration in ms.")
private Integer mNumIterations @Option(name = "iterations", description = "The number of stress test iterations per run.", importance = com.android.tradefed.config.Option.Importance.IF_UNSET)
private int mNumRuns @Option(name = "runs", description = "The number of stress test runs to perform.")
private String mTestModule @Option(name = "stress-module-name", description = "The name of the native test module to run. If not specified all tests in --native-stress-device-path will be run.")
Public Constructors
NativeStressTest()
Public Methods
ITestDevice getDevice()
Get the device under test.
String getModuleName(String moduleName)
Get the Android native test module to run.
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 stress test module 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 AVG_ITERATION_TIME_KEY

Constant Value: "avg-iteration-time"

static final String DEFAULT_TEST_PATH

Constant Value: "data/nativestresstest"

static final String ITERATION_KEY

Constant Value: "iterations"

Fields

private String mDeviceTestPath

private int mMaxIterationTime

private Integer mNumIterations

private int mNumRuns

private String mTestModule

Public Constructors

public NativeStressTest ()

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 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 stress test module to run.

Parameters
moduleName The name of the native test module to run