mbedmicro/mbed — pull request #597 by PrzemekWirkus (2014-10-23 16:44:00+00:00)
Title: Host test plugin improvements

## Rationale
Test API and host tests are using the same functionality to serve mbed platforms with flashing (in most cases copy binary to virtual disk) and platform reset.
Idea behind this pull request is to;
* Consolidate all host test non-generic behavior in separate plugins.
* Divide plugins' families into few groups depending on functionality. For now there are two group (types) of plugins:
* 'CopyMethod' and 'ResetMethod'. First type of plugin implements various mbed platform flashing procedures, second is responsible for reseting mbed platform in order to perform e.g. test.
* For now test suite is using 'CopyMethod' plugins to copy generated target platform binary but with next pull request this functionality will be also moved to host tests where it belongs - host test will not only reset device and take ownership over device's serial port but will also copy (flash) mbed platform with binary.
* Plugins are statically loaded during module __init__, but I will add functionality which is loading dynamically plugins from plugin directory if they are not registered.
* Some plugins e.g. with support for MPS2 copy / reset are not yet stable but MPS2 related functionality was moved from test suite to plugin to consolidate one responsibility per plugin and remove unnecesary work flow from test suite.
* Test suite should be as "thin" as possible so in future plugins for building will also be introduced and extracted from test suite itself.
* Test suite should be as "thin" as possible so in future plugins for detecting / listing of connected platforms will also be introduced as separate plugins / CLI tools..
* In future plugins will be attached to command line help of test suite CLI so users can see which plugins attach to which command line switches.

## Validation
I've validated this solution on mbed enabled platform:
```
Test summary:
+--------+---------------+-----------+-----------+---------------------------------------+--------------------+---------------+-------+
| Result | Target | Toolchain | Test ID | Test Description | Elapsed Time (sec) | Timeout (sec) | Loops |
+--------+---------------+-----------+-----------+---------------------------------------+--------------------+---------------+-------+
| OK | NUCLEO_F072RB | uARM | DTCT_1 | Simple detect test | 0.57 | 10 | 1/1 |
| OK | NUCLEO_F072RB | uARM | EXAMPLE_1 | /dev/null | 3.51 | 10 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_10 | Hello World | 0.5 | 10 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_11 | Ticker Int | 11.42 | 20 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_12 | C++ | 1.47 | 10 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_16 | RTC | 4.84 | 15 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_2 | stdio | 0.88 | 20 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_23 | Ticker Int us | 11.42 | 15 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_24 | Timeout Int us | 11.56 | 15 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_25 | Time us | 11.44 | 15 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_26 | Integer constant division | 1.47 | 10 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_34 | Ticker Two callbacks | 11.44 | 15 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_A1 | Basic | 1.47 | 10 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_A21 | Call function before main (mbed_main) | 1.47 | 10 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_A5 | DigitalIn DigitalOut | 1.47 | 10 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_A6 | DigitalInOut | 1.42 | 10 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_A7 | InterruptIn | 9.43 | 10 | 1/1 |
| OK | NUCLEO_F072RB | uARM | MBED_A9 | Serial Echo at 115200 | 6.09 | 10 | 1/1 |
+--------+---------------+-----------+-----------+---------------------------------------+--------------------+---------------+-------+
Result: 18 OK

Completed in 135.93 sec
```