testrunner: allow setting custom delay before reset
On some boards, such as hifive1b, resetting right after flashing could crash the running firmware
This commit is contained in:
parent
c310bfbf75
commit
c6a2b39a0b
7
dist/pythonlibs/testrunner/spawn.py
vendored
7
dist/pythonlibs/testrunner/spawn.py
vendored
@ -24,6 +24,10 @@ RIOTBASE = (os.environ.get('RIOTBASE') or
|
|||||||
# default value (3)
|
# default value (3)
|
||||||
MAKE_TERM_STARTED_DELAY = int(os.environ.get('TESTRUNNER_START_DELAY') or 3)
|
MAKE_TERM_STARTED_DELAY = int(os.environ.get('TESTRUNNER_START_DELAY') or 3)
|
||||||
|
|
||||||
|
# Setting an empty 'TESTRUNNER_RESET_DELAY' environment variable use the
|
||||||
|
# default value (0, no delay)
|
||||||
|
MAKE_RESET_DELAY = int(os.environ.get('TESTRUNNER_RESET_DELAY') or 0)
|
||||||
|
|
||||||
# Allow customizing test interactive settings with environment variables
|
# Allow customizing test interactive settings with environment variables
|
||||||
TEST_INTERACTIVE_RETRIES = int(os.environ.get('TEST_INTERACTIVE_RETRIES') or 5)
|
TEST_INTERACTIVE_RETRIES = int(os.environ.get('TEST_INTERACTIVE_RETRIES') or 5)
|
||||||
TEST_INTERACTIVE_DELAY = int(os.environ.get('TEST_INTERACTIVE_DELAY') or 1)
|
TEST_INTERACTIVE_DELAY = int(os.environ.get('TEST_INTERACTIVE_DELAY') or 1)
|
||||||
@ -35,6 +39,9 @@ TESTRUNNER_RESET_AFTER_TERM = int(os.environ.get('TESTRUNNER_RESET_AFTER_TERM')
|
|||||||
|
|
||||||
|
|
||||||
def _reset_board(env):
|
def _reset_board(env):
|
||||||
|
if MAKE_RESET_DELAY > 0:
|
||||||
|
time.sleep(MAKE_RESET_DELAY)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.check_output(('make', 'reset'), env=env,
|
subprocess.check_output(('make', 'reset'), env=env,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user