to top
public class

NativeBenchmarkTest

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

Class Overview

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

It uses NativeBenchmarkTestParser to parse out the average operation time vs delay between operations those results to the ITestInvocationListeners.

Summary

Constants
String AVG_OP_TIME_KEY_PREFIX
String DEFAULT_TEST_PATH
String ITERATION_KEY
Fields
private int mClientCpu @Option(name = "client-cpu", description = "Optionally specify a client cpu.")
private Collection<Integer> mDelays @Option(name = "delay-per-run", description = "The delay between each benchmark iteration, in micro seconds.Multiple values may be given to specify multiple runs with different delay values.")
private String mDeviceTestPath @Option(name = "native-benchmark-device-path", description = "The path on the device where native stress tests are located.")
private boolean mMaxCpuFreq @Option(name = "max-cpu-freq", description = "Flag to force device cpu to run at maximum frequency.")
private int mMaxRunTime @Option(name = "max-run-time", description = "The maximum time to allow for one benchmark run in ms.")
private int mNumIterations @Option(name = "iterations", description = "The number of benchmark test iterations per run.")
private String mReportRunName @Option(name = "benchmark-run-name", description = "Optional name to pass to test reporters. If unspecified, will use--benchmark-module-name.")
private int mServerCpu @Option(name = "server-cpu", description = "Optionally specify a server cpu.")
private String mTestModule @Option(name = "benchmark-module-name", description = "The name of the native benchmark test module to run. If not specified all tests in --native-benchmark-device-path will be run.")
Public Constructors
NativeBenchmarkTest()
Public Methods
ITestDevice getDevice()
Get the device under test.
String getModuleName(String moduleName)
Get the Android native benchmark 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 benchmark 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_OP_TIME_KEY_PREFIX

Constant Value: "avg-operation-time"

static final String DEFAULT_TEST_PATH

Constant Value: "data/nativebenchmark"

static final String ITERATION_KEY

Constant Value: "iterations"

Fields

private int mClientCpu

private Collection<Integer> mDelays

private String mDeviceTestPath

private boolean mMaxCpuFreq

private int mMaxRunTime

private int mNumIterations

private String mReportRunName

private int mServerCpu

private String mTestModule

Public Constructors

public NativeBenchmarkTest ()

Public Methods

public ITestDevice getDevice ()

Get the device under test.

Returns

public String getModuleName (String moduleName)

Get the Android native benchmark 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 benchmark test module to run.

Parameters
moduleName The name of the native test module to run