KUnitModuleTest

public class KUnitModuleTest
extends ExecutableTargetTest

java.lang.Object
   ↳ com.android.tradefed.testtype.binary.ExecutableBaseTest
     ↳ com.android.tradefed.testtype.binary.ExecutableTargetTest
       ↳ com.android.tradefed.testtype.binary.KUnitModuleTest


Test runner for running KUnit test modules on device.

Summary

Fields

public static final String INSMOD_COMMAND_FMT

public static final String KUNIT_DEBUGFS_PATH

public static final String KUNIT_RESULTS_FMT

public static final String RMMOD_COMMAND_FMT

Public constructors

KUnitModuleTest()

Public methods

String findBinary(String binary)

Search for the binary to be able to run it.

boolean getCollectTestsOnly()
void run(TestInformation testInfo, ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

void runBinary(String modulePath, ITestInvocationListener listener, TestDescription description)

Actually run the binary at the given path.

Protected methods

boolean doesRunBinaryGenerateTestResults()
getAllTestCommands()

Convert mBinaryPaths to mTestCommands for consistency.

Fields

INSMOD_COMMAND_FMT

public static final String INSMOD_COMMAND_FMT

KUNIT_DEBUGFS_PATH

public static final String KUNIT_DEBUGFS_PATH

KUNIT_RESULTS_FMT

public static final String KUNIT_RESULTS_FMT

RMMOD_COMMAND_FMT

public static final String RMMOD_COMMAND_FMT

Public constructors

KUnitModuleTest

public KUnitModuleTest ()

Public methods

findBinary

public String findBinary (String binary)

Search for the binary to be able to run it.

Parameters
binary String: the path of the binary or simply the binary name.

Returns
String The path to the binary, or null if not found.

Throws
DeviceNotAvailableException

getCollectTestsOnly

public boolean getCollectTestsOnly ()

Returns
boolean

run

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

Parameters
testInfo TestInformation: The TestInformation object containing useful information to run tests.

listener ITestInvocationListener: the ITestInvocationListener of test results

Throws
DeviceNotAvailableException

runBinary

public void runBinary (String modulePath, 
                ITestInvocationListener listener, 
                TestDescription description)

Actually run the binary at the given path.

Parameters
modulePath String: The path of the binary.

listener ITestInvocationListener: The listener where to report the results.

description TestDescription: The test in progress.

Throws
DeviceNotAvailableException

Protected methods

doesRunBinaryGenerateTestResults

protected boolean doesRunBinaryGenerateTestResults ()

Returns
boolean

getAllTestCommands

protected  getAllTestCommands ()

Convert mBinaryPaths to mTestCommands for consistency.

Returns
a MapERROR(/LinkedHashMap) of testCommands.