mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector Class Reference

Select default host_test supervision (replaced after auto detection) More...

Inheritance diagram for mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector:

## Public Member Functions

| __init__ (self, options)
| ctor
| is_host_test_obj_compatible (self, obj_instance)
| Check if host test object loaded is actually host test class derived from 'mbed_host_tests.BaseHostTest()' Additionaly if host test class implements custom ctor it should call BaseHostTest().__Init__()
| run_test (self)
| This function implements key-value protocol state-machine.
| execute (self)
| Test runner for host test.
| match_log (self, line)
Public Member Functions inherited from mbed_host_tests.host_tests_runner.host_test.Test
| run (self)
| setup (self)
| Setup and check if configuration for test is correct.
| notify (self, msg)
| On screen notification function.
| print_result (self, result)
| Test result unified printing function.
| finish (self)
| get_hello_string (self)
Public Member Functions inherited from mbed_host_tests.host_tests_runner.host_test.HostTestResults
| enum (self, **enums)
| get_test_result_int (self, test_result_str)
| Maps test result string to unique integer.
| __getitem__ (self, test_result_str)
| Returns numerical result code.

## Public Attributes

| options
| logger
| registry
| compare_log
| serial_output_file
| compare_log_idx
| test_supervisor
| client_version
Public Attributes inherited from mbed_host_tests.host_tests_runner.host_test.Test
| mbed
| RESULT_END
Public Attributes inherited from mbed_host_tests.host_tests_runner.host_test.HostTestResults
| TestResults
| TestResultsList

## Static Public Attributes

str | RESET_TYPE_SW_RST = "software_reset"
str | RESET_TYPE_HW_RST = "hardware_reset"

## Detailed Description

Select default host_test supervision (replaced after auto detection)

Definition at line 51 of file host_test_default.py.

## Constructor & Destructor Documentation

## __init__()

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.__init__ | ( |  | self,
|  |  | options
| ) |  |

ctor

Reimplemented from mbed_host_tests.host_tests_runner.host_test.DefaultTestSelectorBase.

Definition at line 56 of file host_test_default.py.

## Member Function Documentation

## execute()

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.execute | ( |  | self | ) |

Test runner for host test.

This function will start executing test and forward test result via serial port to test suite. This function is sensitive to work-flow flags such as –skip-flashing, –skip-reset etc. First function will flash device with binary, initialize serial port for communication, reset target. On serial port handshake with test case will be performed. It is when host test reads property data from serial port (sent over serial port). At the end of the procedure proper host test (defined in set properties) will be executed and test execution timeout will be measured.

Definition at line 529 of file host_test_default.py.

## is_host_test_obj_compatible()

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.is_host_test_obj_compatible | ( |  | self,
|  |  | obj_instance
| ) |  |

Check if host test object loaded is actually host test class derived from 'mbed_host_tests.BaseHostTest()' Additionaly if host test class implements custom ctor it should call BaseHostTest().__Init__()

Parameters

  obj_instance | Instance of host test derived class

Returns
  True if obj_instance is derived from mbed_host_tests.BaseHostTest() and BaseHostTest.__init__() was called, else return False

Definition at line 119 of file host_test_default.py.

## match_log()

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.match_log | ( |  | self,
|  |  | line
| ) |  |

    Matches lines from compare log with the target serial output. Compare log lines are matched in seq using index
    self.compare_log_idx. Lines can be strings to be matched as is or regular expressions.

    :param line:
    :return:

Definition at line 576 of file host_test_default.py.

## run_test()

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.run_test | ( |  | self | ) |

This function implements key-value protocol state-machine.

Handling of all events and connector are handled here.

Returns
  Return self.TestResults.RESULT_* enum

Definition at line 147 of file host_test_default.py.

## Member Data Documentation

## client_version

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.client_version

Definition at line 176 of file host_test_default.py.

## compare_log

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.compare_log

Definition at line 111 of file host_test_default.py.

## compare_log_idx

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.compare_log_idx

Definition at line 116 of file host_test_default.py.

## logger

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.logger

Definition at line 61 of file host_test_default.py.

## options

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.options

Definition at line 59 of file host_test_default.py.

## registry

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.registry

Definition at line 63 of file host_test_default.py.

## RESET_TYPE_HW_RST

str mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.RESET_TYPE_HW_RST = "hardware_reset"

static

Definition at line 54 of file host_test_default.py.

## RESET_TYPE_SW_RST

str mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.RESET_TYPE_SW_RST = "software_reset"

static

Definition at line 53 of file host_test_default.py.

## serial_output_file

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.serial_output_file

Definition at line 115 of file host_test_default.py.

## test_supervisor

mbed_host_tests.host_tests_runner.host_test_default.DefaultTestSelector.test_supervisor

Definition at line 174 of file host_test_default.py.

The documentation for this class was generated from the following file:

- mbed_host_tests/host_tests_runner/host_test_default.py