SystemUtil

public class SystemUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.SystemUtil


Utility class for making system calls.

Summary

Nested classes

enum SystemUtil.EnvVariable

 

Constants

String ENV_ANDROID_PRODUCT_OUT

Fields

static SystemUtil singleton

Public constructors

SystemUtil()

Public methods

static File getExternalTestCasesDir(SystemUtil.EnvVariable envVariable)

Get the file associated with the env.

static List<File> getExternalTestCasesDirs()

Get a list of File pointing to tests directories external to Tradefed.

static File getProductOutputDir()

Gets the product specific output dir from an Android build tree.

static List<File> getTestCasesDirs(IBuildInfo buildInfo)

Get a list of File of the test cases directories

Constants

ENV_ANDROID_PRODUCT_OUT

static final String ENV_ANDROID_PRODUCT_OUT

Constant Value: "ANDROID_PRODUCT_OUT"

Fields

singleton

static SystemUtil singleton

Public constructors

SystemUtil

public SystemUtil ()

Public methods

getExternalTestCasesDir

public static File getExternalTestCasesDir (SystemUtil.EnvVariable envVariable)

Get the file associated with the env. variable.

Parameters
envVariable SystemUtil.EnvVariable: ANDROID_TARGET_OUT_TESTCASES or ANDROID_HOST_OUT_TESTCASES

Returns
File The directory associated.

getExternalTestCasesDirs

public static List<File> getExternalTestCasesDirs ()

Get a list of File pointing to tests directories external to Tradefed.

Returns
List<File>

getProductOutputDir

public static File getProductOutputDir ()

Gets the product specific output dir from an Android build tree. Typically this location contains images for various device partitions, bootloader, radio and so on.

Note: the method does not guarantee that this path exists.

Returns
File the location of the output dir or null if the current build is not

getTestCasesDirs

public static List<File> getTestCasesDirs (IBuildInfo buildInfo)

Get a list of File of the test cases directories

Parameters
buildInfo IBuildInfo: the build artifact information. Set it to null if build info is not available or there is no need to get test cases directories from build info.

Returns
List<File> a list of File of directories of the test cases folder of build output, based on the value of environment variables and the given build info.