twister: add flash-before option

Add option to flash board before attach serial.

Current implementation performs the following sequence:

1. Open serial port to listen to board log output
2. Flash device

In case of ESP32 where it uses the same serial port
for both operations, flashing needs to come first.

This PR adds a twister option named --flash-before
which enables the process above, allowing tests to be
performed properly.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
This commit is contained in:
Lucas Tamborrino 2023-04-27 10:44:56 -03:00 committed by Anas Nashif
commit d65b6bc199
4 changed files with 48 additions and 6 deletions

View file

@ -61,3 +61,6 @@ sequence:
"flash_with_test":
type: bool
required: false
"flash_before":
type: bool
required: false